Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TClassRef Class Reference

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.

Definition at line 28 of file TClassRef.h.

Public Member Functions

 TClassRef ()
 
 TClassRef (const char *classname)
 Create reference to specified class name, but don't set referenced class object.
 
 TClassRef (const TClassRef &)
 Copy ctor, increases reference count to original TClass object.
 
 TClassRef (TClass *cl)
 Add reference to specified class object.
 
 ~TClassRef ()
 
TClassGetClass () const
 
const char * GetClassName ()
 
 operator TClass * () const
 
TClassoperator-> () const
 
TClassRefoperator= (const TClassRef &rhs)
 
TClassRefoperator= (TClass *rhs)
 
void Reset ()
 
void SetName (const char *new_name)
 

Private Member Functions

void Assign (const TClassRef &)
 Assignment operator implementation, increases reference count to original class object.
 
void Assign (TClass *)
 Assignment operator, increases reference count to original class object.
 
TClassInternalGetClass () const
 Return the current TClass object corresponding to fClassName.
 

Private Attributes

std::string fClassName
 
TClass *const * fClassPtr
 

Friends

class TClass
 Ptr to the permanent TClass ptr/reference.
 

#include <TClassRef.h>

Constructor & Destructor Documentation

◆ TClassRef() [1/4]

TClassRef::TClassRef ( )
inline

Definition at line 40 of file TClassRef.h.

◆ TClassRef() [2/4]

TClassRef::TClassRef ( TClass cl)

Add reference to specified class object.

Definition at line 47 of file TClassRef.cxx.

◆ TClassRef() [3/4]

TClassRef::TClassRef ( const char *  classname)

Create reference to specified class name, but don't set referenced class object.

Definition at line 39 of file TClassRef.cxx.

◆ TClassRef() [4/4]

TClassRef::TClassRef ( const TClassRef org)

Copy ctor, increases reference count to original TClass object.

Definition at line 30 of file TClassRef.cxx.

◆ ~TClassRef()

TClassRef::~TClassRef ( )
inline

Definition at line 59 of file TClassRef.h.

Member Function Documentation

◆ Assign() [1/2]

void TClassRef::Assign ( const TClassRef rhs)
private

Assignment operator implementation, increases reference count to original class object.

This routines assumes that the copy actually need to be done.

Definition at line 59 of file TClassRef.cxx.

◆ Assign() [2/2]

void TClassRef::Assign ( TClass rhs)
private

Assignment operator, increases reference count to original class object.

This routines assumes that the copy actually need to be done.

Definition at line 69 of file TClassRef.cxx.

◆ GetClass()

TClass * TClassRef::GetClass ( ) const
inline

Definition at line 66 of file TClassRef.h.

◆ GetClassName()

const char * TClassRef::GetClassName ( )
inline

Definition at line 65 of file TClassRef.h.

◆ InternalGetClass()

TClass * TClassRef::InternalGetClass ( ) const
private

Return the current TClass object corresponding to fClassName.

Definition at line 83 of file TClassRef.cxx.

◆ operator TClass *()

TClassRef::operator TClass * ( ) const
inline

Definition at line 70 of file TClassRef.h.

◆ operator->()

TClass * TClassRef::operator-> ( ) const
inline

Definition at line 69 of file TClassRef.h.

◆ operator=() [1/2]

TClassRef & TClassRef::operator= ( const TClassRef rhs)
inline

Definition at line 44 of file TClassRef.h.

◆ operator=() [2/2]

TClassRef & TClassRef::operator= ( TClass rhs)
inline

Definition at line 51 of file TClassRef.h.

◆ Reset()

void TClassRef::Reset ( )
inline

Definition at line 67 of file TClassRef.h.

◆ SetName()

void TClassRef::SetName ( const char *  new_name)
inline

Definition at line 61 of file TClassRef.h.

Friends And Related Symbol Documentation

◆ TClass

friend class TClass
friend

Ptr to the permanent TClass ptr/reference.

Definition at line 34 of file TClassRef.h.

Member Data Documentation

◆ fClassName

std::string TClassRef::fClassName
private

Definition at line 31 of file TClassRef.h.

◆ fClassPtr

TClass* const* TClassRef::fClassPtr
private

Definition at line 32 of file TClassRef.h.

  • core/meta/inc/TClassRef.h
  • core/meta/src/TClassRef.cxx