Template class to define Python extensions. More...
#include <pythonutils.h>
Public Member Functions | |
PythonExtension () | |
virtual | ~PythonExtension () |
Static Public Member Functions | |
static void | deallocator (PyObject *o) |
static PythonType & | getType () |
Static Protected Member Functions | |
static PyObject * | toXML (PyObject *self, PyObject *args) |
Template class to define Python extensions.
The template argument should be your extension class, inheriting from this template class: class MyClass : PythonExtension<MyClass>
The structure of the C++ wrappers around the C Python API is heavily inspired on the design of PyCXX.
More information can be found on http://cxx.sourceforge.net
Definition at line 631 of file pythonutils.h.
frepple::utils::PythonExtension< T >::PythonExtension | ( | ) | [inline, explicit] |
Constructor.
Definition at line 635 of file pythonutils.h.
virtual frepple::utils::PythonExtension< T >::~PythonExtension | ( | ) | [inline, virtual] |
Destructor.
Definition at line 641 of file pythonutils.h.
static void frepple::utils::PythonExtension< T >::deallocator | ( | PyObject * | o | ) | [inline, static] |
Free the memory.
See the note on the memory management in the class documentation for PythonExtensionBase.
Definition at line 669 of file pythonutils.h.
static PythonType& frepple::utils::PythonExtension< T >::getType | ( | ) | [inline, static] |
This method keeps the type information object for your extension.
Definition at line 644 of file pythonutils.h.
static PyObject* frepple::utils::PythonExtension< T >::toXML | ( | PyObject * | self, | |
PyObject * | args | |||
) | [inline, static, protected] |
Return an XML representation of the object.
If a file object is passed as argument, the representation is directly written to it.
If no argument is given the representation is returned as a string.
Definition at line 677 of file pythonutils.h.