itom
|
Static methods to convert between Python objects and ito::ParamBase. More...
#include <pythontParamConversion.h>
Static Public Member Functions | |
static PyObject * | ParamBaseToPyObject (const ito::ParamBase ¶m) |
static SharedParamBasePointer | PyObjectToParamBase (PyObject *obj, const char *name, ito::RetVal &retVal, int paramBaseType=0, bool strict=true) |
converts a given PyObject to an appropriate ito::ParamBase. | |
Static Private Member Functions | |
static void | PyObjectToParamBaseDeleter (ito::ParamBase *param) |
special deleter for param, where the wrapped object is deleted, too. | |
Static methods to convert between Python objects and ito::ParamBase.
|
static |
converts ito::ParamBase to the most appropriate PyObject (returns nullptr, if conversion not possible / implemented).
This methods returns the given ParamBase object to an appropriate Python object. If the conversion is not possible or implemented, nullptr is returned and a Python exception is set.
param | is the given ito::ParamBase parameter |
|
static |
converts a given PyObject to an appropriate ito::ParamBase.
This method can be used as deleter callback for a shared pointer, covering an ito::ParamBase object. If this object is then deleted, this deleter callback will also finally deleted the internally stored object, if it is among one of the types ito::DataObject*, ito::PCLPointCloud or ito::PCLPolygonMesh.
If the conversion is related to references to dataObjects, point clouds or polygon meshes, a special deleter callback is assigned to the returned shared pointer, such that the referenced object is deleted, too, if the returned ParamBase is deleted within the shared pointer.
obj | is the PyObject to be converted |
name | is the name of the returned ParamBase |
retVal | is used to store the success state of the conversion |
paramBaseType | is the desired type of the returned ParamBase, or 0, if the most appropriate type should be guessed (only implemented for some conversions / types). |
strict | if true, the conversion is only done if the given obj can be directly converted to the desired paramBaseType, else implicit conversions (e.g. from integer to string) are allowed, too. |
|
staticprivate |
special deleter for param, where the wrapped object is deleted, too.
This method can be used as deleter callback for a shared pointer, covering an ito::ParamBase object. If this object is then deleted, this deleter callback will also finally deleted the internally stored object, if it is among one of the types ito::DataObject*, ito::PCLPointCloud or ito::PCLPolygonMesh.
This is necessary, since ito::ParamBase only hold a pointer (like a weak pointer) to these objects and will therefore not automatically deleted them.
param | is the ito::ParamBase object to be deleted. |