frepple::utils::PythonExtensionBase Class Reference
This is a base class for all Python extension types. More...
#include <utils.h>

Public Member Functions | |
virtual PyObject * | call (const PythonObject &args, const PythonObject &kwds) |
virtual int | compare (const PyObject *other) const |
virtual PyObject * | getattro (const Attribute &attr) |
void | initType (PyTypeObject *t) |
void | initType (const MetaClass *t) |
virtual PyObject * | iternext () |
PythonExtensionBase () | |
virtual int | setattro (const Attribute &attr, const PythonObject &field) |
virtual PyObject * | str () const |
virtual | ~PythonExtensionBase () |
Static Protected Member Functions | |
static PythonType * | registerPythonType (int, const type_info *) |
Static Protected Attributes | |
static vector< PythonType * > | table |
Detailed Description
This is a base class for all Python extension types.
When creating you own extensions, inherit from the PythonExtension template class instead of this one.
It inherits from the PyObject C struct, defined in the Python C API.
These functions aren't called directly from Python. Python first calls a handler C-function and the handler function will use a virtual call to run the correct C++-method.
Our extensions don't use the usual Python heap allocator. They are created and initialized with the regular C++ new and delete. A special deallocator is called from Python to delete objects when their reference count reaches zero.
Definition at line 3149 of file utils.h.
Constructor & Destructor Documentation
frepple::utils::PythonExtensionBase::PythonExtensionBase | ( | ) | [inline] |
virtual frepple::utils::PythonExtensionBase::~PythonExtensionBase | ( | ) | [inline, virtual] |
Member Function Documentation
virtual PyObject* frepple::utils::PythonExtensionBase::call | ( | const PythonObject & | args, | |
const PythonObject & | kwds | |||
) | [inline, virtual] |
virtual int frepple::utils::PythonExtensionBase::compare | ( | const PyObject * | other | ) | const [inline, virtual] |
Default compare method.
Subclasses are expected to implement an override if the type supports compare.
Reimplemented in frepple::utils::HasName< T >, frepple::utils::HasName< Item >, frepple::utils::HasName< Location >, frepple::utils::HasName< Calendar >, frepple::utils::HasName< Solver >, frepple::utils::HasName< SetupMatrix >, frepple::utils::HasName< Demand >, frepple::utils::HasName< Customer >, frepple::utils::HasName< Resource >, frepple::utils::HasName< Operation >, and frepple::utils::HasName< Buffer >.
virtual PyObject* frepple::utils::PythonExtensionBase::getattro | ( | const Attribute & | attr | ) | [inline, virtual] |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented in frepple::Calendar::Bucket, frepple::Calendar, frepple::CalendarDouble, frepple::CalendarInt, frepple::CalendarBool, frepple::CalendarString, frepple::CalendarOperation, frepple::Problem, frepple::Solver, frepple::Location, frepple::Customer, frepple::Operation, frepple::OperationPlan, frepple::OperationFixedTime, frepple::OperationTimePer, frepple::OperationRouting, frepple::OperationAlternate, frepple::Item, frepple::Buffer, frepple::BufferProcure, frepple::SetupMatrix::Rule, frepple::SetupMatrix, frepple::Resource, frepple::Load, frepple::Plan, frepple::Demand, frepple::LoadPlan, frepple::SolverMRP, module_forecast::Forecast, module_forecast::ForecastBucket, and module_lp_solver::LPSolver.
void frepple::utils::PythonExtensionBase::initType | ( | PyTypeObject * | t | ) | [inline] |
void frepple::utils::PythonExtensionBase::initType | ( | const MetaClass * | t | ) | [inline] |
virtual PyObject* frepple::utils::PythonExtensionBase::iternext | ( | ) | [inline, virtual] |
PythonType * frepple::utils::PythonExtensionBase::registerPythonType | ( | int | size, | |
const type_info * | t | |||
) | [static, protected] |
Definition at line 446 of file pythonutils.cpp.
virtual int frepple::utils::PythonExtensionBase::setattro | ( | const Attribute & | attr, | |
const PythonObject & | field | |||
) | [inline, virtual] |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented in frepple::Calendar::Bucket, frepple::Calendar, frepple::CalendarDouble, frepple::CalendarInt, frepple::CalendarBool, frepple::CalendarString, frepple::CalendarOperation, frepple::Solver, frepple::Location, frepple::Customer, frepple::Operation, frepple::OperationPlan, frepple::OperationFixedTime, frepple::OperationTimePer, frepple::OperationAlternate, frepple::Item, frepple::Buffer, frepple::BufferProcure, frepple::SetupMatrix::Rule, frepple::SetupMatrix, frepple::Resource, frepple::Load, frepple::Plan, frepple::Demand, frepple::SolverMRP, module_forecast::Forecast, module_forecast::ForecastBucket, and module_lp_solver::LPSolver.
virtual PyObject* frepple::utils::PythonExtensionBase::str | ( | ) | const [inline, virtual] |
Default str method.
Subclasses are expected to implement an override if the type supports conversion to a string.
Reimplemented in frepple::Problem, frepple::OperationPlan, frepple::utils::HasName< T >, frepple::utils::HasName< Item >, frepple::utils::HasName< Location >, frepple::utils::HasName< Calendar >, frepple::utils::HasName< Solver >, frepple::utils::HasName< SetupMatrix >, frepple::utils::HasName< Demand >, frepple::utils::HasName< Customer >, frepple::utils::HasName< Resource >, frepple::utils::HasName< Operation >, and frepple::utils::HasName< Buffer >.
Member Data Documentation
vector< PythonType * > frepple::utils::PythonExtensionBase::table [static, protected] |
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
