A calendar storing double values in its buckets. More...

#include <model.h>

Inheritance diagram for frepple::CalendarDouble:

Classes

class  BucketDouble
 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

 CalendarDouble (const string &n)
 
void endElement (XMLInput &, const Attribute &, const DataElement &)
 
virtual PyObject * getattro (const Attribute &)
 
virtual bool getBool () const
 
double getDefault () const
 
virtual const MetaClassgetType () const
 
double getValue (const Date d) const
 
double getValue (Calendar::BucketIterator &i) const
 
virtual int setattro (const Attribute &, const PythonObject &)
 
virtual void setDefault (const double v)
 
void setValue (Date start, Date end, const double v)
 
void writeElement (XMLOutput *, const Keyword &, mode m=DEFAULT) const
 
 ~CalendarDouble ()
 
- Public Member Functions inherited from frepple::Calendar
BucketaddBucket (Date, Date, int=1)
 
BucketIterator beginBuckets () const
 
void beginElement (XMLInput &, const Attribute &)
 
 Calendar (const string &n)
 
BucketcreateBucket (const AttributeList &)
 
BucketIterator endBuckets () const
 
BucketfindBucket (Date d, bool fwd=true) const
 
BucketfindBucket (int ident) const
 
virtual size_t getSize () const
 
void removeBucket (Bucket *bkt)
 
 ~Calendar ()
 
- Public Member Functions inherited from frepple::utils::HasName< Calendar >
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 ()
 
- Public Member Functions inherited from frepple::utils::Tree::TreeNode
TreeNodedecrement () const
 
const string & getName () const
 
TreeNodeincrement () const
 
bool operator< (const TreeNode &o)
 
 TreeNode (const string &n)
 
virtual ~TreeNode ()
 
- Public Member Functions inherited from frepple::utils::Object
virtual bool getHidden () const
 
 Object ()
 
virtual void setHidden (bool b)
 
virtual ~Object ()
 
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
virtual PyObject * call (const PythonObject &args, const PythonObject &kwds)
 
Py_ssize_t getReferenceCount () const
 
void initType (const MetaClass *t)
 
void initType (PyTypeObject *t)
 
virtual PyObject * iternext ()
 
 PythonExtensionBase ()
 
void resetReferenceCount ()
 
virtual ~PythonExtensionBase ()
 

Static Public Member Functions

static int initialize ()
 
static PyObject * setPythonValue (PyObject *, PyObject *, PyObject *)
 
- Static Public Member Functions inherited from frepple::Calendar
static PyObject * addPythonBucket (PyObject *, PyObject *, PyObject *)
 
static PyObject * getEvents (PyObject *, PyObject *)
 
static int initialize ()
 
- Static Public Member Functions inherited from frepple::utils::HasName< Calendar >
static Calendaradd (const string &k, const MetaClass &cls)
 
static Calendaradd (Calendar *t)
 
static Calendaradd (Calendar *t, Calendar *hint)
 
static iterator begin ()
 
static void clear ()
 
static bool empty ()
 
static iterator end ()
 
static Calendarfind (const string &k)
 
static CalendarfindLowerBound (const string &k, bool *f=NULL)
 
static Objectreader (const MetaClass *cat, const AttributeList &in)
 
static size_t size ()
 
static void verify ()
 
static void writer (const MetaCategory *c, XMLOutput *o)
 
- Static Public Member Functions inherited from frepple::utils::Object
template<class T >
static PyObject * create (PyTypeObject *pytype, PyObject *args, PyObject *kwds)
 
template<class T >
static ObjectcreateDefault ()
 
template<class T >
static ObjectcreateString (const string &n)
 
static PyObject * toXML (PyObject *, PyObject *)
 

Static Public Attributes

static const MetaClassmetadata
 
- Static Public Attributes inherited from frepple::Calendar
static const MetaCategorymetadata
 

Additional Inherited Members

- Protected Member Functions inherited from frepple::Calendar
int lowestPriority () const
 
- Static Protected Member Functions inherited from frepple::utils::PythonExtensionBase
static PythonTyperegisterPythonType (int, const type_info *)
 
- Static Protected Attributes inherited from frepple::utils::PythonExtensionBase
static vector< PythonType * > table
 

Detailed Description

A calendar storing double values in its buckets.

Definition at line 445 of file model.h.

Constructor & Destructor Documentation

frepple::CalendarDouble::CalendarDouble ( const string &  n)
inline

Default constructor.

Definition at line 520 of file model.h.

frepple::CalendarDouble::~CalendarDouble ( )

Destructor.

Definition at line 182 of file calendar.cpp.

Member Function Documentation

void frepple::CalendarDouble::endElement ( XMLInput ,
const Attribute ,
const DataElement  
)
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 154 of file calendar.cpp.

PyObject * frepple::CalendarDouble::getattro ( const Attribute attr)
virtual

Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.

Reimplemented from frepple::Calendar.

Definition at line 826 of file calendar.cpp.

virtual bool frepple::CalendarDouble::getBool ( ) const
inlinevirtual

Convert the value of the calendar to a boolean value.

Reimplemented from frepple::Calendar.

Definition at line 558 of file model.h.

double frepple::CalendarDouble::getDefault ( ) const
inline

Returns the default calendar value when no entry is matching.

Definition at line 555 of file model.h.

virtual const MetaClass& frepple::CalendarDouble::getType ( ) const
inlinevirtual

This returns the type information on the object, a bit similar to the standard type_info information.

Reimplemented from frepple::Calendar.

Definition at line 526 of file model.h.

double frepple::CalendarDouble::getValue ( const Date  d) const
inline

Returns the value on the specified date.

Definition at line 538 of file model.h.

double frepple::CalendarDouble::getValue ( Calendar::BucketIterator i) const
inline

Definition at line 549 of file model.h.

int frepple::CalendarDouble::initialize ( )
static

Definition at line 71 of file calendar.cpp.

int frepple::CalendarDouble::setattro ( const Attribute attr,
const PythonObject field 
)
virtual

Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.

Reimplemented from frepple::Calendar.

Definition at line 834 of file calendar.cpp.

virtual void frepple::CalendarDouble::setDefault ( const double  v)
inlinevirtual

Update the default calendar value when no entry is matching.

Definition at line 561 of file model.h.

PyObject * frepple::CalendarDouble::setPythonValue ( PyObject *  self,
PyObject *  args,
PyObject *  kwdict 
)
static

Definition at line 844 of file calendar.cpp.

void frepple::CalendarDouble::setValue ( Date  start,
Date  end,
const double  v 
)

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

Definition at line 110 of file calendar.cpp.

void frepple::CalendarDouble::writeElement ( XMLOutput ,
const Keyword ,
mode  = DEFAULT 
) const
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 125 of file calendar.cpp.

Member Data Documentation

const MetaClass * frepple::CalendarDouble::metadata
static

Definition at line 527 of file model.h.


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