Object is the abstract base class for the main entities. More...
#include <utils.h>

Public Member Functions | |
virtual void | beginElement (XMLInput &, const Attribute &) |
virtual void | endElement (XMLInput &, const Attribute &, const DataElement &)=0 |
virtual bool | getHidden () const |
virtual size_t | getSize () const =0 |
virtual const MetaClass & | getType () const =0 |
Object () | |
virtual void | setHidden (bool b) |
virtual void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
virtual | ~Object () |
Static Public Member Functions | |
template<class T > | |
static PyObject * | create (PyTypeObject *pytype, PyObject *args, PyObject *kwds) |
template<class T > | |
static Object * | createDefault () |
template<class T > | |
static Object * | createString (const string &n) |
static PyObject * | toXML (PyObject *, PyObject *) |
Detailed Description
Object is the abstract base class for the main entities.
It handles to following capabilities:
- Metadata: All subclasses publish metadata about their structure.
- Python object: All objects live a double life as a Python object.
- Callbacks: When objects are created or deleted, interested classes or objects can get a callback notification.
- Serialization: Objects need to be persisted and later restored. Subclasses that don't need to be persisted can skip the implementation of the writeElement method.
Instances can be marked as hidden, which means that they are not serialized at all.
Constructor & Destructor Documentation
frepple::utils::Object::Object | ( | ) | [inline, explicit] |
virtual frepple::utils::Object::~Object | ( | ) | [inline, virtual] |
Member Function Documentation
virtual void frepple::utils::Object::beginElement | ( | XMLInput & | , |
const Attribute & | |||
) | [inline, virtual] |
Called while restoring the model from an XML-file.
This is called for each element within the "this" element, for which the "this" element is immediate parent.
It is called when the open element tag is encountered.
Reimplemented in frepple::utils::HasHierarchy< T >, frepple::utils::HasHierarchy< Item >, frepple::utils::HasHierarchy< Location >, frepple::utils::HasHierarchy< Demand >, frepple::utils::HasHierarchy< Customer >, frepple::utils::HasHierarchy< Resource >, frepple::utils::HasHierarchy< Buffer >, frepple::Demand, frepple::Plan, frepple::Load, frepple::Resource, frepple::SetupMatrix, frepple::Flow, frepple::Buffer, frepple::Item, frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationPlan, frepple::Operation, frepple::Customer, frepple::Location, module_forecast::Forecast, frepple::CalendarPointer< T >, frepple::CalendarPointer< T >::BucketPointer, and frepple::Calendar.
static PyObject* frepple::utils::Object::create | ( | PyTypeObject * | pytype, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [inline, static] |
Template function that generates a factory method callable from Python.
Reimplemented in frepple::OperationPlan.
static Object* frepple::utils::Object::createDefault | ( | ) | [inline, static] |
static Object* frepple::utils::Object::createString | ( | const string & | n | ) | [inline, static] |
virtual void frepple::utils::Object::endElement | ( | XMLInput & | , |
const Attribute & | , | ||
const DataElement & | |||
) | [pure virtual] |
Called while restoring the model from an XML-file.
This is called when the corresponding close element tag is encountered, and the Data() member of pElement is valid.
Implemented in frepple::PeggingIterator, frepple::utils::HasHierarchy< T >, frepple::utils::HasHierarchy< Item >, frepple::utils::HasHierarchy< Location >, frepple::utils::HasHierarchy< Demand >, frepple::utils::HasHierarchy< Customer >, frepple::utils::HasHierarchy< Resource >, frepple::utils::HasHierarchy< Buffer >, 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 >, frepple::utils::HasName< Buffer >, frepple::Demand, frepple::Plan, frepple::Load, frepple::Resource, frepple::SetupMatrix, frepple::SetupMatrix::Rule, frepple::Flow, 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, module_forecast::Forecast, frepple::CalendarPointer< T >, frepple::CalendarPointer< T >::BucketPointer, frepple::CalendarValue< T >, frepple::CalendarValue< T >::BucketValue, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.
virtual bool frepple::utils::Object::getHidden | ( | ) | const [inline, virtual] |
Returns whether an entity is real or dummy.
Reimplemented in frepple::Demand, frepple::Load, frepple::Resource, frepple::Flow, frepple::Buffer, frepple::OperationPlan, and frepple::Operation.
virtual size_t frepple::utils::Object::getSize | ( | ) | const [pure virtual] |
Return the memory size of the object in bytes.
Implemented in frepple::PeggingIterator, frepple::ProblemMaterialExcess, frepple::ProblemMaterialShortage, frepple::ProblemCapacityUnderload, frepple::ProblemCapacityOverload, frepple::ProblemExcess, frepple::ProblemShort, frepple::ProblemInvalidData, frepple::ProblemEarly, frepple::ProblemLate, frepple::ProblemDemandNotPlanned, frepple::ProblemPrecedence, frepple::ProblemBeforeFence, frepple::ProblemBeforeCurrent, frepple::DemandDefault, frepple::Plan, frepple::Load, frepple::ResourceInfinite, frepple::ResourceDefault, frepple::SetupMatrixDefault, frepple::SetupMatrix, frepple::SetupMatrix::Rule, frepple::FlowEnd, frepple::FlowStart, frepple::Flow, frepple::BufferProcure, frepple::BufferInfinite, frepple::BufferDefault, frepple::ItemDefault, frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationSetup, frepple::OperationFixedTime, frepple::OperationPlan, frepple::CustomerDefault, frepple::LocationDefault, module_forecast::ForecastSolver, module_forecast::ForecastBucket, module_forecast::Forecast, frepple::CalendarString, frepple::CalendarPointer< T >::BucketPointer, frepple::CalendarValue< T >::BucketValue, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.
virtual const MetaClass& frepple::utils::Object::getType | ( | ) | const [pure virtual] |
This returns the type information on the object, a bit similar to the standard type_info information.
Implemented in frepple::PeggingIterator, frepple::ProblemMaterialExcess, frepple::ProblemMaterialShortage, frepple::ProblemCapacityUnderload, frepple::ProblemCapacityOverload, frepple::ProblemExcess, frepple::ProblemShort, frepple::ProblemInvalidData, frepple::ProblemEarly, frepple::ProblemLate, frepple::ProblemDemandNotPlanned, frepple::ProblemPrecedence, frepple::ProblemBeforeFence, frepple::ProblemBeforeCurrent, frepple::DemandDefault, frepple::Demand, frepple::Plan, frepple::Load, frepple::ResourceInfinite, frepple::ResourceDefault, frepple::Resource, frepple::SetupMatrixDefault, frepple::SetupMatrix, frepple::SetupMatrix::Rule, frepple::FlowEnd, frepple::FlowStart, frepple::Flow, frepple::BufferProcure, frepple::BufferInfinite, frepple::BufferDefault, frepple::Buffer, frepple::ItemDefault, frepple::Item, frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationSetup, frepple::OperationFixedTime, frepple::OperationPlan, frepple::CustomerDefault, frepple::Customer, frepple::LocationDefault, frepple::Location, module_forecast::ForecastSolver, frepple::Solver, module_forecast::ForecastBucket, module_forecast::Forecast, frepple::Problem, frepple::CalendarOperation, frepple::CalendarString, frepple::CalendarBool, frepple::CalendarInt, frepple::CalendarDouble, frepple::CalendarVoid, frepple::CalendarPointer< T >, frepple::CalendarPointer< Operation >, frepple::CalendarPointer< T >::BucketPointer, frepple::CalendarValue< T >, frepple::CalendarValue< double >, frepple::CalendarValue< int >, frepple::CalendarValue< string >, frepple::CalendarValue< bool >, frepple::CalendarValue< T >::BucketValue, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.
virtual void frepple::utils::Object::setHidden | ( | bool | b | ) | [inline, virtual] |
Mark the object as hidden or not. Hidden objects are not exported and are used only as dummy constructs.
Reimplemented in frepple::Demand, frepple::Resource, frepple::Buffer, and frepple::Operation.
PyObject * frepple::utils::Object::toXML | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
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 452 of file pythonutils.cpp.
virtual void frepple::utils::Object::writeElement | ( | XMLOutput * | , |
const Keyword & | , | ||
mode | = DEFAULT |
||
) | const [inline, virtual] |
Called while writing the model into an XML-file. The user class should write itself out, using the IOutStream members for its "simple" members and calling writeElement recursively for any contained objects. Not all classes are expected to implement this method. In instances of such a class can be created but can't be persisted. E.g. Command
Reimplemented in frepple::utils::HasHierarchy< T >, frepple::utils::HasHierarchy< Item >, frepple::utils::HasHierarchy< Location >, frepple::utils::HasHierarchy< Demand >, frepple::utils::HasHierarchy< Customer >, frepple::utils::HasHierarchy< Resource >, frepple::utils::HasHierarchy< Buffer >, frepple::Demand, frepple::Plan, frepple::Load, frepple::ResourceInfinite, frepple::Resource, frepple::SetupMatrix, frepple::SetupMatrix::Rule, frepple::FlowEnd, frepple::Flow, frepple::BufferProcure, frepple::BufferInfinite, frepple::Buffer, frepple::Item, frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationSetup, frepple::OperationFixedTime, frepple::OperationPlan, frepple::Operation, frepple::Customer, frepple::Location, module_forecast::ForecastSolver, frepple::Solver, frepple::Problem, module_forecast::Forecast, frepple::CalendarPointer< T >, frepple::CalendarPointer< T >::BucketPointer, frepple::CalendarValue< T >, frepple::CalendarValue< T >::BucketValue, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
