frepple::utils::Object Class Referenceabstract

Object is the abstract base class for the main entities. More...

#include <utils.h>

Inheritance diagram for frepple::utils::Object:

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 MetaClassgetType () const =0
 
 Object ()
 
virtual void setHidden (bool b)
 
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 
virtual ~Object ()
 
- 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

template<class T >
static PyObject * create (PyTypeObject *pytype, PyObject *args, PyObject *kwds)
 
template<class T >
static ObjectcreateDefault ()
 
template<class T >
static ObjectcreateString (const string &n)
 
static PyObject * toXML (PyObject *, PyObject *)
 

Additional Inherited Members

- 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

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.

Definition at line 3361 of file utils.h.

Constructor & Destructor Documentation

frepple::utils::Object::Object ( )
inlineexplicit

Constructor.

Definition at line 3365 of file utils.h.

virtual frepple::utils::Object::~Object ( )
inlinevirtual

Destructor.

Definition at line 3368 of file utils.h.

Member Function Documentation

virtual void frepple::utils::Object::beginElement ( XMLInput ,
const Attribute  
)
inlinevirtual
template<class T >
static PyObject* frepple::utils::Object::create ( PyTypeObject *  pytype,
PyObject *  args,
PyObject *  kwds 
)
inlinestatic

Template function that generates a factory method callable from Python.

Definition at line 3428 of file utils.h.

template<class T >
static Object* frepple::utils::Object::createDefault ( )
inlinestatic

This template function can generate a factory method for objects that can be constructed with their default constructor.

Definition at line 3411 of file utils.h.

template<class T >
static Object* frepple::utils::Object::createString ( const string &  n)
inlinestatic

This template function can generate a factory method for objects that need a string argument in their constructor.

Definition at line 3419 of file utils.h.

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< Skill >, frepple::utils::HasName< Operation >, frepple::utils::HasName< Buffer >, frepple::Demand, frepple::Plan, frepple::Load, frepple::ResourceSkill, frepple::Resource, frepple::Skill, 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, frepple::CalendarDouble, frepple::CalendarDouble::BucketDouble, frepple::Calendar, frepple::Calendar::Bucket, frepple::SolverMRP, and module_lp_solver::LPSolver.

virtual bool frepple::utils::Object::getHidden ( ) const
inlinevirtual

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.

Definition at line 3399 of file utils.h.

virtual const MetaClass& frepple::utils::Object::getType ( ) const
pure virtual
virtual void frepple::utils::Object::setHidden ( bool  b)
inlinevirtual

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.

Definition at line 3396 of file utils.h.

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 486 of file pythonutils.cpp.

virtual void frepple::utils::Object::writeElement ( XMLOutput ,
const Keyword ,
mode  = DEFAULT 
) const
inlinevirtual

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