class TClassRef


TClassRef is used to implement a permanent reference to a TClass
object.  In particular this reference will change if and when the
TClass object is regenerated.  This regeneration usually happens
when a library containing the described class is loaded after a
file containing an instance of this class has been opened.

The references kept track of using an intrusive double linked list.
The intrusive list is maintained by TClass::AddRef and
TClass::RemoveRef.  The 'start' of the list is held in
TClass::fRefStart.


Function Members (Methods)

public:
TClassRef()
TClassRef(TClass* cl)
TClassRef(const char* classname)
TClassRef(const TClassRef&)
~TClassRef()
TClass*GetClass() const
const char*GetClassName()
TClass*operator TClass*() const
TClass*operator->() const
TClassRef&operator=(const TClassRef&)
TClassRef&operator=(TClass*)
voidReset()
voidSetName(const char* new_name)
private:
TClass*InternalGetClass() const
voidListReset()

Data Members

private:
stringfClassNameName of referenced class
TClass*fClassPtr! Ptr to the TClass object
TClassRef*fNext! link to the next refs
TClassRef*fPrevious! link to the previous refs

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TClassRef(const TClassRef &org)
 Copy ctor, increases reference count to original TClass object.
TClassRef(const char *classname)
 Create reference to specified class name, but don't set referenced
 class object.
TClassRef(TClass *cl)
 Add reference to specified class object.
TClassRef & operator=(const TClassRef &rhs)
 Assignment operator, increases reference count to original class object.
TClassRef & operator=(TClass* rhs)
 Assignment operator, increases reference count to original class object.
TClass * InternalGetClass()
 Return the current TClass object corresponding to fClassName.
void ListReset()
 Reset this object and all the objects in the list.
 We assume that the TClass has also reset its fRefStart data member.
TClassRef()
{}
~TClassRef()
{ if (fClassPtr) fClassPtr->RemoveRef(this); }
void SetName(const char* new_name)
const char * GetClassName()
{ return fClassName.c_str(); }
TClass * GetClass()
{ return fClassPtr ? fClassPtr : InternalGetClass(); }
void Reset()
{ if (fClassPtr) fClassPtr->RemoveRef(this); fClassPtr = 0; }
TClass* operator->()
{ return fClassPtr ? fClassPtr : InternalGetClass(); }
operator TClass*()
{ return fClassPtr ? fClassPtr : InternalGetClass(); }

Author: Philippe Canal 15/03/2005
Last change: root/meta:$Id: TClassRef.h 20882 2007-11-19 11:31:26Z rdm $
Last generated: 2008-06-25 08:35
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.