frepple::CalendarValue< T > Class Template Reference

This calendar type is used to store values in its buckets. More...

#include <model.h>

Inheritance diagram for frepple::CalendarValue< T >:

List of all members.

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 MetaClassgetType () 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

template<typename T>
frepple::CalendarValue< T >::CalendarValue ( const string &  n  )  [inline]

Default constructor.

Definition at line 462 of file model.h.


Member Function Documentation

template<typename T>
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.

Definition at line 529 of file model.h.

template<>
bool frepple::CalendarValue< string >::getBool (  )  const [inline, virtual]

Convert the value of the calendar to a boolean value.

Reimplemented from frepple::Calendar.

template<>
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.

template<typename T>
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.

Definition at line 496 of file model.h.

template<typename T>
virtual T frepple::CalendarValue< T >::getDefault (  )  const [inline, virtual]

Returns the default calendar value when no entry is matching.

Definition at line 493 of file model.h.

template<typename T>
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.

template<typename T>
const T& frepple::CalendarValue< T >::getValue ( Calendar::BucketIterator i  )  const [inline]

Definition at line 489 of file model.h.

template<typename T>
const T& frepple::CalendarValue< T >::getValue ( const Date  d  )  const [inline]

Returns the value on the specified date.

Definition at line 465 of file model.h.

template<typename T>
virtual void frepple::CalendarValue< T >::setDefault ( const T  v  )  [inline, virtual]

Update the default calendar value when no entry is matching.

Definition at line 499 of file model.h.

template<typename T>
void frepple::CalendarValue< T >::setValue ( Date  start,
Date  end,
const T &  v 
) [inline]

Updates the value in a certain date range.
This will create a new bucket if required.

Definition at line 473 of file model.h.

template<typename T>
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.

Definition at line 501 of file model.h.


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

Documentation generated for frePPLe by  doxygen