Workspace 6.21.5
Public Member Functions | Static Public Member Functions | List of all members
PythonTypesRegistry Class Reference

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)
 
PythonTypesRegistryoperator= (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 PythonTypesRegistrygetInstance ()
 

Constructor & Destructor Documentation

◆ PythonTypesRegistry()

Member Function Documentation

◆ getInstance()

PythonTypesRegistry & getInstance ( )
static

◆ getRegisteredTypes()

QList< const CSIRO::DataExecution::DataFactory * > getRegisteredTypes ( ) const

◆ isTypeSupported()

bool isTypeSupported ( const CSIRO::DataExecution::DataFactory obj)

Check if a type is supported return true if it's registered, false otherwise

◆ map()

pyb::object map ( DataExecution::DataObject obj,
bool &  succeeded 
)

Convert DataObject to python object

Parameters
objDataObject to convert
succeededtrue if successfully converted, false otherwise return converted python object

◆ operator=()

PythonTypesRegistry & operator= ( const PythonTypesRegistry )
delete

◆ registerType()

void registerType ( const CSIRO::DataExecution::DataFactory instance,
DataObjToPythonObjMapFunc  objToPyFunc,
PythonObjToDataObjMapFunc  pyToObjFunc 
)

Register supported type for runPythonScript

Parameters
instanceinstance of the type
objToPyFuncfunction pointer for converting registered type to python object
pyToObjFuncfunction pointer for converting python object to registered type

◆ unmap()

bool unmap ( pyb::object  pyObj,
CSIRO::DataExecution::DataObject obj 
)

Convert python object to DataObject

Parameters
pyObjpython object to convert
objconverted DataObject return true if successfully converted, false otherwise