Mantid
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Mantid::PythonInterface::Registry::TypeRegistry Class Reference

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 PropertyValueHandlerretrieve (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...
 

Detailed Description

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.

Member Function Documentation

◆ registerBuiltins()

void Mantid::PythonInterface::Registry::TypeRegistry::registerBuiltins ( )
static

Register handlers for basic C++ types into the registry.

Definition at line 38 of file TypeRegistry.cpp.

References SUBSCRIBE_HANDLER.

◆ retrieve()

const PropertyValueHandler & Mantid::PythonInterface::Registry::TypeRegistry::retrieve ( const std::type_info &  typeObject)
static

Lookup a handler base on a given type_info object.

Get a PropertyValueHandler if one exists.

Parameters
typeObjectA pointer to a PyTypeObject
Returns
A pointer to a PropertyValueHandler
Exceptions
std::invalid_argumentif one is not registered

Definition at line 89 of file TypeRegistry.cpp.

◆ subscribe() [1/2]

template<typename HandlerType >
static void Mantid::PythonInterface::Registry::TypeRegistry::subscribe ( )
inlinestatic

Subscribe a handler object for given template type.

Definition at line 36 of file TypeRegistry.h.

◆ subscribe() [2/2]

void Mantid::PythonInterface::Registry::TypeRegistry::subscribe ( const std::type_info &  typeObject,
PropertyValueHandler handler 
)
static

Subscribe a handler object for a given typeinfo.

Insert a new property handler for the given type_info.

Parameters
typeObject:: A reference to a type object
handler:: An object to handle to corresponding templated C++ type. Ownership is transferred here
Exceptions
std::invalid_argumentif one already exists

Definition at line 71 of file TypeRegistry.cpp.


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