frepple::utils Namespace Reference

Core namespace. More...

Classes

class  Association
 This template class represents a data structure for a load or flow network. More...
class  Attribute
 A class to model keyword instances. More...
class  AttributeList
 This class represents a dictionary of keyword + value pairs. More...
class  Command
 Abstract base class for all commands. More...
class  CommandList
 A container command to group a series of commands together. More...
class  CommandLoadLibrary
 Command to dynamically load a shared library in frePPLe. More...
class  CommandPython
 This command executes Python code in the embedded interpreter. More...
class  DataElement
 This abstract class represents a attribute and value pair for updating objects in frePPLe. More...
class  DataException
 An exception of this type is thrown when data errors are found. More...
class  Date
 This class represents a date and time with an accuracy of one second. More...
class  DateRange
 This class defines a date-range, i.e. a start-date and end-date pair. More...
class  Environment
 This class groups some functions used to interact with the operating system environment. More...
class  FreppleCategory
 A template class to expose category classes which use a string as the key to Python . More...
class  FreppleClass
 A template class to expose classes to Python. More...
class  FreppleIterator
 A template class to expose iterators to Python. More...
class  Functor
 This abstract class is the base class used for callbacks. More...
class  FunctorInstance
 This class represents an object subscribing to a signal. More...
class  FunctorStatic
 This class represents a static subscription to a signal. More...
class  HasDescription
 This is a decorator class for the main objects. More...
class  HasHierarchy
 This is a base class for the main objects. More...
class  HasName
 Base class for objects using a string as their primary key. More...
struct  indent
class  Keyword
 This class defines a keyword for the frePPLe data model. More...
class  LibraryUtils
 This class holds functions that used for maintenance of the library. More...
class  LogicException
 An exception of this type is thrown when the library gets in an inconsistent state from which the normal course of action can't continue. More...
class  MetaCategory
 A MetaCategory instance represents metadata for a category of object. More...
class  MetaClass
 This class stores metadata about the classes in the library. The stored information goes well beyond the standard 'type_info'. More...
class  Mutex
 This class is a wrapper around platform specific mutex functions. More...
class  NonCopyable
 Class NonCopyable is a base class.
Derive your own class from it when you want to prohibit copy construction and copy assignment. More...
class  Object
 Object is the abstract base class for the main entities. More...
class  PythonAttributeList
 This class is a wrapper around a Python dictionary. More...
class  PythonExtension
 Template class to define Python extensions. More...
class  PythonExtensionBase
 This is a base class for all Python extension types. More...
class  PythonInterpreter
 This class is used to maintain the Python interpreter. More...
class  PythonObject
 This class handles two-way translation between the data types in C++ and Python. More...
class  PythonType
 This class is a wrapper around the type information in Python. More...
class  RuntimeException
 An exception of this type is thrown when the library runs into problems that are specific at runtime.
These could either be memory problems, threading problems, file system problems, etc... More...
class  ScopeMutexLock
 This is a convenience class that makes it easy (and exception-safe) to lock a mutex in a scope. More...
class  Tags
 This class holds a collection of all XML tags used by frepple. More...
class  TimeLine
 This class implements a "sorted list" data structure, sorting "events" based on a date. More...
class  TimePeriod
 This class represents a time duration with an accuracy of one second. More...
class  Timer
 This class is used to measure the processor time used by the program. More...
class  Tree
 This class implements a binary tree data structure. It is used as a container for entities keyed by their name. More...
class  XMLAttributeList
 This class represents a list of XML attributes. More...
class  XMLElement
 This class represents an XML element being read in from the input file. More...
class  XMLEscape
class  XMLInput
 This class will read in an XML-file and call the appropriate handler functions of the Object classes and objects. More...
class  XMLInputFile
 This class reads XML data from a file system. More...
class  XMLInputString
 This class reads XML data from a string. More...
class  XMLOutput
 Base class for writing XML formatted data to an output stream. More...
class  XMLOutputFile
 This class writes XML data to a flat file. More...
class  XMLOutputString
 This class writes XML data to a string. More...

Typedefs

typedef unsigned int hashtype

Enumerations

enum  Action { ADD = 0, CHANGE = 1, REMOVE = 2, ADD_CHANGE = 3 }
enum  mode { DEFAULT = 0, REFERENCE = 1, NOHEADER = 2, FULL = 3 }
enum  Signal { SIG_ADD = 0, SIG_REMOVE = 1 }

Functions

PyObject * call_handler (PyObject *self, PyObject *args, PyObject *kwds)
int compare_handler (PyObject *self, PyObject *other)
PyObject * getattro_handler (PyObject *self, PyObject *name)
PyObject * iternext_handler (PyObject *self)
ostream logger (cout.rdbuf())
template<class T >
ostream & operator<< (ostream &o, const HasName< T > *n)
template<class T >
ostream & operator<< (ostream &o, const HasName< T > &n)
ostream & operator<< (ostream &os, const DateRange &dr)
ostream & operator<< (ostream &os, const Date &d)
ostream & operator<< (ostream &os, const TimePeriod &t)
ostream & operator<< (ostream &os, const Timer &t)
ostream & operator<< (ostream &os, const indent &i)
ostream & operator<< (ostream &os, const Signal &d)
ostream & operator<< (ostream &os, const Action &d)
ostream & operator<< (ostream &os, const XMLEscape &x)
int setattro_handler (PyObject *self, PyObject *name, PyObject *value)
PyObject * str_handler (PyObject *self)

Variables

ostream logger
PyObject * PythonDataException = NULL
 Python exception class matching with frepple::DataException.
PyObject * PythonLogicException = NULL
 Python exception class matching with frepple::LogicException.
PyObject * PythonRuntimeException = NULL
 Python exception class matching with frepple::RuntimeException.

Detailed Description

Core namespace.


Typedef Documentation

typedef unsigned int frepple::utils::hashtype

This is the datatype used for hashing an XML-element to a numeric value.

Definition at line 416 of file utils.h.


Enumeration Type Documentation

This type defines what operation we want to do with the entity.

Enumerator:
ADD 

or A.
Add an new entity, and report an error if the entity already exists.

CHANGE 

or C.
Change an existing entity, and report an error if the entity doesn't exist yet.

REMOVE 

or D.
Delete an entity, and report an error if the entity doesn't exist.

ADD_CHANGE 

or AC.
Change an entity or create a new one if it doesn't exist yet.
This is the default action.

Definition at line 359 of file utils.h.

This type is used to define different ways of persisting an object.

Enumerator:
DEFAULT 

Write the full object or a reference. If the object is nested more than one level deep a reference is written, otherwise the complete object is written.
This mode is the one to be used when dumping all objects to be restored later. The other modes can dump too little or too much data. Eg: <MODEL NAME="POL" TYPE="a"><FIELD>value</FIELD></MODEL>

REFERENCE 

Write only the key fields of the object.
Eg: <MODEL NAME="POL" TYPE="a"/>

NOHEADER 

Write the full object, but without a header line. This method is typically used when a subclass calls the write method of its parent class.
Eg: <FIELD>value</FIELD></MODEL>

FULL 

Write the full object, with all its fields and a header line.
Eg: <MODEL NAME="POL" TYPE="a"><FIELD>value</FIELD></MODEL>

Definition at line 1877 of file utils.h.

This type defines the types of callback events possible.

Enumerator:
SIG_ADD 

Adding a new entity.

SIG_REMOVE 

Deleting an entity.

Definition at line 394 of file utils.h.


Function Documentation

PyObject * frepple::utils::call_handler ( PyObject *  ,
PyObject *  ,
PyObject *   
)

Handler function called from Python. Internal use only.

int frepple::utils::compare_handler ( PyObject *  ,
PyObject *   
)

Handler function called from Python. Internal use only.

PyObject * frepple::utils::getattro_handler ( PyObject *  ,
PyObject *   
)

Handler function called from Python. Internal use only.

PyObject * frepple::utils::iternext_handler ( PyObject *   ) 

Handler function called from Python. Internal use only.

ostream frepple::utils::logger ( cout.  rdbuf()  ) 
template<class T >
ostream& frepple::utils::operator<< ( ostream &  o,
const HasName< T > *  n 
) [inline]

Definition at line 4455 of file utils.h.

template<class T >
ostream& frepple::utils::operator<< ( ostream &  o,
const HasName< T > &  n 
) [inline]

Definition at line 4449 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const DateRange &  dr 
) [inline]

Prints a date range to the outputstream.

See also:
DateRange::string()

Definition at line 1865 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const Date &  d 
) [inline]

Prints a date to the outputstream.

Definition at line 1736 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const TimePeriod &  t 
) [inline]

Prints a Timeperiod to the outputstream.

See also:
TimePeriod::string()

Definition at line 1549 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const Timer &  t 
) [inline]

Prints a timer to the outputstream. The output is formatted as a double.

Definition at line 1427 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const indent &  i 
) [inline]

Print a number of spaces to the output stream.

Definition at line 430 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const Signal &  d 
) [inline]

Writes a signal description to an output stream.

Definition at line 404 of file utils.h.

ostream& frepple::utils::operator<< ( ostream &  os,
const Action &  d 
) [inline]

Writes an action description to an output stream.

Definition at line 380 of file utils.h.

ostream & frepple::utils::operator<< ( ostream &  ,
const XMLEscape &   
)

Prints the escaped value of the string to the outputstream.

int frepple::utils::setattro_handler ( PyObject *  ,
PyObject *  ,
PyObject *   
)

Handler function called from Python. Internal use only.

PyObject * frepple::utils::str_handler ( PyObject *   ) 

Handler function called from Python. Internal use only.


Variable Documentation

This stream is the general output for all logging and debugging messages.

Python exception class matching with frepple::DataException.

Definition at line 44 of file pythonutils.cpp.

Python exception class matching with frepple::LogicException.

Definition at line 43 of file pythonutils.cpp.

Python exception class matching with frepple::RuntimeException.

Definition at line 45 of file pythonutils.cpp.


Generated on 25 Feb 2010 for frePPLe by  doxygen 1.6.1