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 >:
frepple::Calendar frepple::utils::HasName< Calendar > frepple::utils::Object frepple::utils::NonCopyable frepple::utils::Tree::TreeNode

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:

Definition at line 372 of file model.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 446 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 513 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 36 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 480 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 477 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 473 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 449 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 483 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 457 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 485 of file model.h.


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

Generated on 25 Sep 2009 for frePPLe by  doxygen 1.6.1