frepple::utils::PythonExtension< T > Class Template Reference

Template class to define Python extensions. More...

#include <utils.h>

Inheritance diagram for frepple::utils::PythonExtension< T >:

List of all members.

Public Member Functions

 PythonExtension ()
virtual ~PythonExtension ()
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
virtual PyObject * call (const PythonObject &args, const PythonObject &kwds)
virtual int compare (const PyObject *other) const
virtual PyObject * getattro (const Attribute &attr)
Py_ssize_t getReferenceCount () const
void initType (const MetaClass *t)
void initType (PyTypeObject *t)
virtual PyObject * iternext ()
 PythonExtensionBase ()
void resetReferenceCount ()
virtual int setattro (const Attribute &attr, const PythonObject &field)
virtual PyObject * str () const
virtual ~PythonExtensionBase ()

Static Public Member Functions

static void deallocator (PyObject *o)
static PythonTypegetType ()

Additional Inherited Members

- Protected Member Functions inherited from frepple::utils::NonCopyable
 NonCopyable ()
 ~NonCopyable ()
- Static Protected Member Functions inherited from frepple::utils::PythonExtensionBase
static PythonTyperegisterPythonType (int, const type_info *)
- Static Protected Attributes inherited from frepple::utils::PythonExtensionBase
static vector< PythonType * > table

Detailed Description

template<class T>
class frepple::utils::PythonExtension< T >

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 3208 of file utils.h.


Constructor & Destructor Documentation

template<class T>
frepple::utils::PythonExtension< T >::PythonExtension ( )
inlineexplicit

Constructor.
The Python metadata fields always need to be set correctly.

Definition at line 3214 of file utils.h.

template<class T>
virtual frepple::utils::PythonExtension< T >::~PythonExtension ( )
inlinevirtual

Destructor.

Definition at line 3220 of file utils.h.


Member Function Documentation

template<class T>
static void frepple::utils::PythonExtension< T >::deallocator ( PyObject *  o)
inlinestatic

Free the memory.
See the note on the memory management in the class documentation for PythonExtensionBase.

Definition at line 3241 of file utils.h.

template<class T>
static PythonType& frepple::utils::PythonExtension< T >::getType ( )
inlinestatic

This method keeps the type information object for your extension.

Definition at line 3223 of file utils.h.


The documentation for this class was generated from the following file: