Mantid
|
The values that are held within a given C++ property type all have a fixed type, required by static typing. More...
#include <TypeRegistry.h>
Static Public Member Functions | |
static void | registerBuiltins () |
Register handlers for basic C++ types into the registry. More... | |
static const PropertyValueHandler & | retrieve (const std::type_info &typeInfo) |
Lookup a handler base on a given type_info object. More... | |
template<typename HandlerType > | |
static void | subscribe () |
Subscribe a handler object for given template type. More... | |
static void | subscribe (const std::type_info &typeInfo, PropertyValueHandler *handler) |
Subscribe a handler object for a given typeinfo. More... | |
The values that are held within a given C++ property type all have a fixed type, required by static typing.
This means that when passing a value for a property from Python there must be a match between between the types.
This class defines a registry of mappings between a C++ type T and a PropertyValueHandler object that is able to extract (or attempt to extract) the correct C++ type for that property from a given Python object.
Definition at line 31 of file TypeRegistry.h.
|
static |
Register handlers for basic C++ types into the registry.
Definition at line 38 of file TypeRegistry.cpp.
References SUBSCRIBE_HANDLER.
|
static |
Lookup a handler base on a given type_info object.
Get a PropertyValueHandler if one exists.
typeObject | A pointer to a PyTypeObject |
std::invalid_argument | if one is not registered |
Definition at line 89 of file TypeRegistry.cpp.
|
inlinestatic |
Subscribe a handler object for given template type.
Definition at line 36 of file TypeRegistry.h.
|
static |
Subscribe a handler object for a given typeinfo.
Insert a new property handler for the given type_info.
typeObject | :: A reference to a type object |
handler | :: An object to handle to corresponding templated C++ type. Ownership is transferred here |
std::invalid_argument | if one already exists |
Definition at line 71 of file TypeRegistry.cpp.