dlite-python-singletons#
Python singletons.
Functions
-
PyObject *dlite_python_maindict(void)#
Returns a pointer to main.__dict__ of the embedded interpreater or NULL on error.
-
PyObject *dlite_python_mainclass(const char *classname)#
Creates a new empty singleton class and return it.
The name of the new class is
classname
.Returns NULL on error.
-
PyObject *dlite_python_storage_base(void)#
Returns the base class for storage plugins.
-
PyObject *dlite_python_mapping_base(void)#
Returns the base class for mapping plugins.
-
PyObject *dlite_python_module_dict(void)#
Returns a pointer to the dlite module dict of the embedded interpreater or NULL on error.
-
PyObject *dlite_python_module_class(const char *classname)#
Return a borrowed reference to singleton class
classname
in the dlite module. The class is created if it doesn’t already exists.Returns NULL on error.
-
PyObject *dlite_python_module_error(DLiteErrCode code)#
Returns a borrowed reference to singleton Python exception object for the given DLite error code.
The singleton object is created the first time this function is called with a given
code
. All following calles with the samecode
will return a reference to the same object.Returns NULL if
code
is out of range.