Workspace 6.21.5
|
A registry of PythonTypesRegistry implementations which can be used to create new instances.
#include <Python/pythontypesregistry.h>
Public Member Functions | |
PythonTypesRegistry (const PythonTypesRegistry &)=delete | |
QList< const CSIRO::DataExecution::DataFactory * > | getRegisteredTypes () const |
bool | isTypeSupported (const CSIRO::DataExecution::DataFactory *obj) |
pyb::object | map (DataExecution::DataObject &obj, bool &succeeded) |
PythonTypesRegistry & | operator= (const PythonTypesRegistry &)=delete |
void | registerType (const CSIRO::DataExecution::DataFactory *instance, DataObjToPythonObjMapFunc objToPyFunc, PythonObjToDataObjMapFunc pyToObjFunc) |
bool | unmap (pyb::object pyObj, CSIRO::DataExecution::DataObject &obj) |
Static Public Member Functions | |
static PythonTypesRegistry & | getInstance () |
|
delete |
|
static |
QList< const CSIRO::DataExecution::DataFactory * > getRegisteredTypes | ( | ) | const |
bool isTypeSupported | ( | const CSIRO::DataExecution::DataFactory * | obj | ) |
Check if a type is supported return true if it's registered, false otherwise
pyb::object map | ( | DataExecution::DataObject & | obj, |
bool & | succeeded | ||
) |
Convert DataObject to python object
obj | DataObject to convert |
succeeded | true if successfully converted, false otherwise return converted python object |
|
delete |
void registerType | ( | const CSIRO::DataExecution::DataFactory * | instance, |
DataObjToPythonObjMapFunc | objToPyFunc, | ||
PythonObjToDataObjMapFunc | pyToObjFunc | ||
) |
Register supported type for runPythonScript
instance | instance of the type |
objToPyFunc | function pointer for converting registered type to python object |
pyToObjFunc | function pointer for converting python object to registered type |
bool unmap | ( | pyb::object | pyObj, |
CSIRO::DataExecution::DataObject & | obj | ||
) |
Convert python object to DataObject
pyObj | python object to convert |
obj | converted DataObject return true if successfully converted, false otherwise |