Base class for objects using a string as their primary key. More...
#include <utils.h>

Classes | |
class | iterator |
This class models a STL-like iterator that allows us to iterate over the named entities in a simple and safe way. More... | |
Public Member Functions | |
int | compare (const PyObject *other) const |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
HasName (const string &n) | |
HasName (const char *n) | |
void | setName (const string &newname) |
virtual PyObject * | str () const |
~HasName () | |
Static Public Member Functions | |
static T * | add (const string &k, const MetaClass &cls) |
static T * | add (T *t) |
static T * | add (T *t, T *hint) |
static iterator | begin () |
static void | clear () |
static bool | empty () |
static iterator | end () |
static T * | find (const string &k) |
static T * | findLowerBound (const string &k, bool *f=NULL) |
static Object * | reader (const MetaClass *cat, const AttributeList &in) |
static size_t | size () |
static void | verify () |
static void | writer (const MetaCategory *c, XMLOutput *o) |
Detailed Description
template<class T>
class frepple::utils::HasName< T >
Base class for objects using a string as their primary key.
Instances of this class have the following properties:
- Have a unique name.
- A hashtable (keyed on the name) is maintained as a container with all active instances.
Constructor & Destructor Documentation
frepple::utils::HasName< T >::HasName | ( | const string & | n | ) | [inline, explicit] |
frepple::utils::HasName< T >::HasName | ( | const char * | n | ) | [inline, explicit] |
frepple::utils::HasName< T >::~HasName | ( | ) | [inline] |
Member Function Documentation
static T* frepple::utils::HasName< T >::add | ( | const string & | k, |
const MetaClass & | cls | ||
) | [inline, static] |
static T* frepple::utils::HasName< T >::add | ( | T * | t | ) | [inline, static] |
static T* frepple::utils::HasName< T >::add | ( | T * | t, |
T * | hint | ||
) | [inline, static] |
static iterator frepple::utils::HasName< T >::begin | ( | ) | [inline, static] |
static void frepple::utils::HasName< T >::clear | ( | ) | [inline, static] |
int frepple::utils::HasName< T >::compare | ( | const PyObject * | other | ) | const [inline, virtual] |
Comparison operator for Python.
Reimplemented from frepple::utils::PythonExtensionBase.
static bool frepple::utils::HasName< T >::empty | ( | ) | [inline, static] |
static iterator frepple::utils::HasName< T >::end | ( | ) | [inline, static] |
void frepple::utils::HasName< T >::endElement | ( | XMLInput & | , |
const Attribute & | , | ||
const DataElement & | |||
) | [inline, 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.
Implements frepple::utils::Object.
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::Resource, frepple::SetupMatrix, frepple::BufferProcure, frepple::Buffer, frepple::Item, frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationFixedTime, frepple::Operation, frepple::Customer, frepple::Location, module_forecast::Forecast, frepple::Solver, frepple::CalendarDouble, frepple::Calendar, frepple::SolverMRP, and module_lp_solver::LPSolver.
static T* frepple::utils::HasName< T >::find | ( | const string & | k | ) | [inline, static] |
static T* frepple::utils::HasName< T >::findLowerBound | ( | const string & | k, |
bool * | f = NULL |
||
) | [inline, static] |
static Object* frepple::utils::HasName< T >::reader | ( | const MetaClass * | cat, |
const AttributeList & | in | ||
) | [inline, static] |
This method is available as a object creation factory for classes that are using a string as a key identifier, in particular classes derived from the HasName base class. The following attributes are recognized:
- name:
Name of the entity to be created/changed/removed.
The default value is "unspecified". - type:
Determines the subclass to be created.
The default value is "default". - action:
Determines the action to be performed on the object.
This can be A (for 'add'), C (for 'change'), AC (for 'add_change') or R (for 'remove').
'add_change' is the default value.- See also:
- HasName
void frepple::utils::HasName< T >::setName | ( | const string & | newname | ) | [inline] |
static size_t frepple::utils::HasName< T >::size | ( | ) | [inline, static] |
virtual PyObject* frepple::utils::HasName< T >::str | ( | ) | const [inline, virtual] |
Return the name as the string representation in Python.
Reimplemented from frepple::utils::PythonExtensionBase.
static void frepple::utils::HasName< T >::verify | ( | ) | [inline, static] |
static void frepple::utils::HasName< T >::writer | ( | const MetaCategory * | c, |
XMLOutput * | o | ||
) | [inline, static] |
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
