REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Data Structures | Functions | Variables
REST_Reflection Namespace Reference

This namespace serves for the reflection functionality. More...

Data Structures

struct  DataType_Info
 
class  TRestReflector
 

Functions

TRestReflector Assembly (const std::string &typeName)
 Assembly an object of type: typeName, returning the allocated memory address and size. More...
 
void CloneAny (const TRestReflector &from, const TRestReflector &to)
 Deep copy the content of object from to to More...
 
template<typename T >
TClass * GetClassQuick ()
 Get the type of a "class" object, returning the wrapped type identifier "TClass". More...
 
TClass * GetClassQuick (std::string type)
 
template<typename T >
std::string GetTypeName ()
 Get the type name of an object. More...
 
template<class T >
std::string GetTypeName (T obj)
 Get the type name of an object. More...
 
TRestReflector WrapType (const std::string &typeName)
 Wrap information an object of type: typeName, memory is not allocated. More...
 

Variables

EXTERN_DEF std::map< void *, TClass * > RESTListOfClasses_typeid
 
EXTERN_DEF std::map< std::string, TClass * > RESTListOfClasses_typename
 

Detailed Description

This namespace serves for the reflection functionality.

Function Documentation

◆ Assembly()

TRestReflector REST_Reflection::Assembly ( const std::string &  typeName)

Assembly an object of type: typeName, returning the allocated memory address and size.

Definition at line 260 of file TRestReflector.cxx.

◆ CloneAny()

void REST_Reflection::CloneAny ( const TRestReflector from,
const TRestReflector to 
)

Deep copy the content of object from to to

Calls RESTVirtualConverter::CloneObj(). The actual methods are registered in converter.cpp If not registered, you can add it manually with AddConverter() macro

Definition at line 268 of file TRestReflector.cxx.

◆ GetClassQuick() [1/2]

template<typename T >
TClass * REST_Reflection::GetClassQuick ( )

Get the type of a "class" object, returning the wrapped type identifier "TClass".

Quicker than TClass::GetClass() since it stores limited objects in the std::map, no need to iterate all the valid types. Do not call this method before main function.

Definition at line 258 of file TRestReflector.h.

◆ GetClassQuick() [2/2]

TClass * REST_Reflection::GetClassQuick ( std::string  type)
inline

Wrap the std::string type name into ROOT type identifier "TClass"

Quicker than TClass::GetClass() since it stores limited objects in the std::map, no need to iterate all the valid types. Do not call this method before main function.

Definition at line 239 of file TRestReflector.h.

◆ GetTypeName() [1/2]

template<typename T >
std::string REST_Reflection::GetTypeName ( )

Get the type name of an object.

Definition at line 273 of file TRestReflector.h.

◆ GetTypeName() [2/2]

template<class T >
std::string REST_Reflection::GetTypeName ( obj)

Get the type name of an object.

Definition at line 282 of file TRestReflector.h.

◆ WrapType()

TRestReflector REST_Reflection::WrapType ( const std::string &  typeName)

Wrap information an object of type: typeName, memory is not allocated.

Definition at line 266 of file TRestReflector.cxx.

Variable Documentation

◆ RESTListOfClasses_typeid

EXTERN_DEF std::map<void*, TClass*> REST_Reflection::RESTListOfClasses_typeid

Definition at line 231 of file TRestReflector.h.

◆ RESTListOfClasses_typename

EXTERN_DEF std::map<std::string, TClass*> REST_Reflection::RESTListOfClasses_typename

Definition at line 232 of file TRestReflector.h.