ATLAS Offline Software
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | Friends | List of all members
SG::BaseInfo< T > Class Template Reference

Provide an interface for finding inheritance information at run time. More...

#include <BaseInfo.h>

Collaboration diagram for SG::BaseInfo< T >:

Static Public Member Functions

static void * cast (T *p, CLID clid)
 Cast to a base pointer. More...
 
static void * cast (T *p, const std::type_info &tinfo)
 Cast to a base pointer. More...
 
static T * castTo (void *p, CLID clid)
 Cast to a derived pointer. More...
 
static T * castTo (void *p, const std::type_info &tinfo)
 Cast to a derived pointer. More...
 
static BaseInfoBase::castfn_tcastfn (CLID clid)
 Return a function for casting to a base pointer. More...
 
static BaseInfoBase::castfn_tcastfn (const std::type_info &tinfo)
 Return a function for casting to a base pointer. More...
 
static BaseInfoBase::castfn_tcastfnTo (CLID clid)
 Return a function for casting to a derived pointer. More...
 
static BaseInfoBase::castfn_tcastfnTo (const std::type_info &tinfo)
 Return a function for casting to a derived pointer. More...
 
static const std::vector< CLID > & get_bases ()
 Return the class IDs of all known bases of T (that have class IDs). More...
 
static std::vector< const std::type_info * > get_ti_bases ()
 Return the type_info's of all known bases of T. More...
 
static bool is_base (CLID clid)
 Return true if clid is the ID of a class that is known to be a base of T. More...
 
static bool is_base (const std::type_info &tinfo)
 Return true if tinfo is the std::type_info of a class that is known to be a base of T. More...
 
static bool is_virtual (CLID clid)
 Return true if clid is the ID of a class that is known to be a virtual base of T. More...
 
static bool is_virtual (const std::type_info &tinfo)
 Return true if tinfo is the std::type_info of a class that is known to be a virtual base of T. More...
 
static const BaseInfoBasebaseinfo ()
 Return the non-templated BaseInfoBase object for this type. More...
 
static void maybeInit ()
 

Static Private Member Functions

static BaseInfoImpl< T > & instance ()
 Return a reference to the (singleton) implementation object for this class. More...
 

Static Private Attributes

static BaseInfoImpl< T > s_instance ATLAS_THREAD_SAFE
 

Friends

template<class D , class B >
struct RegisterAddCopyConversionInit
 
template<class D , class B >
struct RegisterAddBaseInit
 

Detailed Description

template<class T>
class SG::BaseInfo< T >

Provide an interface for finding inheritance information at run time.

See the file comments for full details.

Definition at line 750 of file Control/AthenaKernel/AthenaKernel/BaseInfo.h.

Member Function Documentation

◆ baseinfo()

template<class T >
static const BaseInfoBase& SG::BaseInfo< T >::baseinfo ( )
static

Return the non-templated BaseInfoBase object for this type.

◆ cast() [1/2]

template<class T >
static void* SG::BaseInfo< T >::cast ( T *  p,
CLID  clid 
)
static

Cast to a base pointer.

Parameters
pThe pointer to cast.
clidID of the class to which to cast.
Returns
The pointer cast to the requested type, returned as a void*. clid must be known to be a base of T; otherwise, 0 will be returned.

◆ cast() [2/2]

template<class T >
static void* SG::BaseInfo< T >::cast ( T *  p,
const std::type_info &  tinfo 
)
static

Cast to a base pointer.

Parameters
pThe pointer to cast.
clidtype_info of the class to which to cast.
Returns
The pointer cast to the requested type, returned as a void*. tinfo must be known to be a base of T; otherwise, 0 will be returned.

◆ castfn() [1/2]

template<class T >
static BaseInfoBase::castfn_t* SG::BaseInfo< T >::castfn ( CLID  clid)
static

Return a function for casting to a base pointer.

Parameters
clidID of the class to which to cast.
Returns
A function to convert a pointer to a T to a pointer to the type identified by clid. clid must be known to be a base of T; otherwise, 0 will be returned.

◆ castfn() [2/2]

template<class T >
static BaseInfoBase::castfn_t* SG::BaseInfo< T >::castfn ( const std::type_info &  tinfo)
static

Return a function for casting to a base pointer.

Parameters
clidtype_info of the class to which to cast.
Returns
A function to convert a pointer to a T to a pointer to the type identified by tinfo. tinfo must be known to be a base of T; otherwise, 0 will be returned.

◆ castfnTo() [1/2]

template<class T >
static BaseInfoBase::castfn_t* SG::BaseInfo< T >::castfnTo ( CLID  clid)
static

Return a function for casting to a derived pointer.

Parameters
clidID of the class B from which to cast.
Returns
A function to convert a pointer to a T to a pointer to a T. clid must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

◆ castfnTo() [2/2]

template<class T >
static BaseInfoBase::castfn_t* SG::BaseInfo< T >::castfnTo ( const std::type_info &  tinfo)
static

Return a function for casting to a derived pointer.

Parameters
clidtype_info of the class B from which to cast.
Returns
A function to convert a pointer to a B to a pointer to a T. tinfo must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

◆ castTo() [1/2]

template<class T >
static T* SG::BaseInfo< T >::castTo ( void *  p,
CLID  clid 
)
static

Cast to a derived pointer.

Parameters
pThe pointer to cast.
clidID of the class B from which to cast.
Returns
The pointer cast to a T*. B must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

◆ castTo() [2/2]

template<class T >
static T* SG::BaseInfo< T >::castTo ( void *  p,
const std::type_info &  tinfo 
)
static

Cast to a derived pointer.

Parameters
pThe pointer to cast.
clidtype_info of the class B from which to cast.
Returns
The pointer cast to a T*. B must be known to be a base of T; otherwise, 0 will be returned. 0 will also be returned if the dynamic_cast fails.

◆ get_bases()

template<class T >
static const std::vector<CLID>& SG::BaseInfo< T >::get_bases ( )
static

Return the class IDs of all known bases of T (that have class IDs).

The list will include T itself.

◆ get_ti_bases()

template<class T >
static std::vector<const std::type_info*> SG::BaseInfo< T >::get_ti_bases ( )
static

Return the type_info's of all known bases of T.

The list will include T itself.

◆ instance()

template<class T >
static BaseInfoImpl<T>& SG::BaseInfo< T >::instance ( )
staticprivate

Return a reference to the (singleton) implementation object for this class.

◆ is_base() [1/2]

template<class T >
static bool SG::BaseInfo< T >::is_base ( CLID  clid)
static

Return true if clid is the ID of a class that is known to be a base of T.

T is considered to be its own base for this purpose.

Parameters
clidThe ID of the class to test.

◆ is_base() [2/2]

template<class T >
static bool SG::BaseInfo< T >::is_base ( const std::type_info &  tinfo)
static

Return true if tinfo is the std::type_info of a class that is known to be a base of T.

T is considered to be its own base for this purpose.

Parameters
tinfoThe std::type_info of the class to test.

◆ is_virtual() [1/2]

template<class T >
static bool SG::BaseInfo< T >::is_virtual ( CLID  clid)
static

Return true if clid is the ID of a class that is known to be a virtual base of T.

(This will always be false for T itself.)

Parameters
clidThe ID of the class to test.

◆ is_virtual() [2/2]

template<class T >
static bool SG::BaseInfo< T >::is_virtual ( const std::type_info &  tinfo)
static

Return true if tinfo is the std::type_info of a class that is known to be a virtual base of T.

(This will always be false for T itself.)

Parameters
tinfoThe std::type_info of the class to test.

◆ maybeInit()

template<class T >
static void SG::BaseInfo< T >::maybeInit ( )
static

Friends And Related Function Documentation

◆ RegisterAddBaseInit

template<class T >
template<class D , class B >
friend struct RegisterAddBaseInit
friend

◆ RegisterAddCopyConversionInit

template<class T >
template<class D , class B >
friend struct RegisterAddCopyConversionInit
friend

Member Data Documentation

◆ ATLAS_THREAD_SAFE

template<class T >
BaseInfoImpl<T> s_instance SG::BaseInfo< T >::ATLAS_THREAD_SAFE
staticprivate

The documentation for this class was generated from the following file: