frepple::CalendarValue< T > Class Template Reference
This calendar type is used to store values in its buckets. More...
#include <model.h>

Classes | |
class | BucketValue |
A special type of calendar bucket, designed to hold a a value. More... | |
class | EventIterator |
A special event iterator, providing also access to the current value. More... | |
Public Member Functions | |
CalendarValue (const string &n) | |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
template<> | |
bool | getBool () const |
template<> | |
bool | getBool () const |
virtual bool | getBool () const |
virtual T | getDefault () const |
virtual const MetaClass & | getType () const =0 |
const T & | getValue (Calendar::BucketIterator &i) const |
const T & | getValue (const Date d) const |
virtual void | setDefault (const T v) |
void | setValue (Date start, Date end, const T &v) |
void | writeElement (XMLOutput *o, const Keyword &tag, mode m=DEFAULT) const |
Detailed Description
template<typename T>
class frepple::CalendarValue< T >
This calendar type is used to store values in its buckets.
The template type must statisfy the following requirements:
- XML import supported by the operator >> of the class DataElement.
- XML export supported by the method writeElement of the class XMLOutput. Subclasses will need to implement the getType() method.
- See also:
- CalendarPointer
Definition at line 388 of file model.h.
Constructor & Destructor Documentation
frepple::CalendarValue< T >::CalendarValue | ( | const string & | n | ) | [inline] |
Member Function Documentation
void frepple::CalendarValue< 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.
Reimplemented from frepple::Calendar.
bool frepple::CalendarValue< string >::getBool | ( | ) | const [inline, virtual] |
Convert the value of the calendar to a boolean value.
Reimplemented from frepple::Calendar.
bool frepple::CalendarValue< string >::getBool | ( | ) | const [inline, virtual] |
Convert the value of the calendar to a boolean value.
Reimplemented from frepple::Calendar.
Definition at line 153 of file calendar.cpp.
virtual bool frepple::CalendarValue< T >::getBool | ( | ) | const [inline, virtual] |
Convert the value of the calendar to a boolean value.
Reimplemented from frepple::Calendar.
Reimplemented in frepple::CalendarString.
virtual T frepple::CalendarValue< T >::getDefault | ( | ) | const [inline, virtual] |
virtual const MetaClass& frepple::CalendarValue< T >::getType | ( | ) | const [pure virtual] |
This returns the type information on the object, a bit similar to the standard type_info information.
Reimplemented from frepple::Calendar.
Implemented in frepple::CalendarDouble, frepple::CalendarInt, frepple::CalendarBool, and frepple::CalendarString.
const T& frepple::CalendarValue< T >::getValue | ( | Calendar::BucketIterator & | i | ) | const [inline] |
const T& frepple::CalendarValue< T >::getValue | ( | const Date | d | ) | const [inline] |
virtual void frepple::CalendarValue< T >::setDefault | ( | const T | v | ) | [inline, virtual] |
void frepple::CalendarValue< T >::setValue | ( | Date | start, | |
Date | end, | |||
const T & | v | |||
) | [inline] |
void frepple::CalendarValue< T >::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 from frepple::Calendar.
The documentation for this class was generated from the following file:
Documentation generated for frePPLe by
