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) |
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 Protected Member Functions | |
static PythonType * | registerPythonType (int, const type_info *) |
Static Protected Attributes | |
static vector< PythonType * > | table |
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.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
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< Skill >, frepple::utils::HasName< Operation >, and frepple::utils::HasName< Buffer >.
|
inlinevirtual |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented in frepple::LoadPlan, frepple::Demand, frepple::Plan, frepple::Load, frepple::ResourceSkill, frepple::Resource, frepple::Skill, frepple::SetupMatrix, frepple::SetupMatrix::Rule, frepple::BufferProcure, frepple::Buffer, frepple::Item, frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationFixedTime, frepple::OperationPlan, frepple::Operation, frepple::Customer, frepple::Location, frepple::Solver, frepple::Problem, frepple::CalendarDouble, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
staticprotected |
Definition at line 441 of file pythonutils.cpp.
|
inline |
|
inlinevirtual |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented in frepple::LoadPlan, frepple::Demand, frepple::Plan, frepple::Load, frepple::ResourceSkill, frepple::Resource, frepple::Skill, frepple::SetupMatrix, frepple::SetupMatrix::Rule, frepple::BufferProcure, frepple::Buffer, frepple::Item, frepple::OperationAlternate, frepple::OperationTimePer, frepple::OperationFixedTime, frepple::OperationPlan, frepple::Operation, frepple::Customer, frepple::Location, frepple::Solver, frepple::CalendarDouble, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.
|
inlinevirtual |
Default str method.
Subclasses are expected to implement an override if the type supports conversion to a string.
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< Skill >, frepple::utils::HasName< Operation >, frepple::utils::HasName< Buffer >, frepple::OperationPlan, and frepple::Problem.
|
staticprotected |