This class represents a time bucket as a part of a calendar. More...

#include <model.h>

Inheritance diagram for frepple::Calendar::Bucket:

List of all members.

Public Member Functions

bool checkValid (Date d) const
void endElement (XMLInput &, const Attribute &, const DataElement &)
virtual PyObject * getattro (const Attribute &)
virtual bool getBool () const
CalendargetCalendar () const
Date getEnd () const
string getName () const
int getPriority () const
virtual size_t getSize () const
Date getStart () const
virtual const MetaClassgetType () const
void getValue () const
virtual int setattro (const Attribute &, const PythonObject &)
void setEnd (const Date &d)
void setName (const string &s)
void setPriority (int f)
void setStart (const Date &d)
void setValue ()
bool useDefaultName () const
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const

Static Public Member Functions

static int initialize ()

Static Public Attributes

static const MetaCategorymetadata

Protected Member Functions

 Bucket (Calendar *c, Date start, Date end, string name, int priority=0)
void writeHeader (XMLOutput *, const Keyword &) const

Friends

class BucketIterator
class Calendar
class EventIterator

Detailed Description

This class represents a time bucket as a part of a calendar.

Manipulation of instances of this class need to be handled with the methods on the friend class Calendar.

See also:
Calendar

Definition at line 106 of file model.h.


Constructor & Destructor Documentation

frepple::Calendar::Bucket::Bucket ( Calendar c,
Date  start,
Date  end,
string  name,
int  priority = 0 
) [inline, protected]

Constructor.

Definition at line 149 of file model.h.


Member Function Documentation

bool frepple::Calendar::Bucket::checkValid ( Date  d) const [inline]

Verifies whether this entry is effective on a given date.

Definition at line 215 of file model.h.

void frepple::Calendar::Bucket::endElement ( XMLInput pIn,
const Attribute pAttr,
const DataElement pElement 
) [virtual]

Reads the bucket information from the input. Only the fields "name" and "start" are read in. Other fields as also written out but these are information-only fields.

Implements frepple::utils::Object.

Reimplemented in frepple::CalendarPointer< T >::BucketPointer, and frepple::CalendarValue< T >::BucketValue.

Definition at line 437 of file calendar.cpp.

PyObject * frepple::Calendar::Bucket::getattro ( const Attribute attr) [virtual]

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

Reimplemented from frepple::utils::PythonExtensionBase.

Definition at line 823 of file calendar.cpp.

virtual bool frepple::Calendar::Bucket::getBool ( ) const [inline, virtual]
Calendar* frepple::Calendar::Bucket::getCalendar ( ) const [inline]

Return the calendar to whom the bucket belongs.

Definition at line 158 of file model.h.

Date frepple::Calendar::Bucket::getEnd ( ) const [inline]

Returns the end date of the bucket.

Definition at line 189 of file model.h.

string frepple::Calendar::Bucket::getName ( ) const [inline]

Returns the name of the bucket. If no name was ever explicitly specified with the setName() method, a default name is generated by converting the start date into a string.
To reduce the memory needs, this default string is computed with every call to the getName() method and never stored internally. Only explicitly specified names are kept in memory.

Definition at line 179 of file model.h.

int frepple::Calendar::Bucket::getPriority ( ) const [inline]

Returns the priority of this bucket, compared to other buckets effective at a certain time.
Lower numbers indicate a higher priority level.
The default value is 0.

Definition at line 205 of file model.h.

virtual size_t frepple::Calendar::Bucket::getSize ( ) const [inline, virtual]

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Reimplemented in frepple::CalendarPointer< T >::BucketPointer, and frepple::CalendarValue< T >::BucketValue.

Definition at line 234 of file model.h.

Date frepple::Calendar::Bucket::getStart ( ) const [inline]

Returns the start date of the bucket.

Definition at line 195 of file model.h.

virtual const MetaClass& frepple::Calendar::Bucket::getType ( ) const [inline, virtual]

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

Implements frepple::utils::Object.

Reimplemented in frepple::CalendarPointer< T >::BucketPointer, and frepple::CalendarValue< T >::BucketValue.

Definition at line 232 of file model.h.

void frepple::Calendar::Bucket::getValue ( ) const [inline]

This method is here only to keep the API of all calendar classes consistent.
Note that this isn't exactly a virtual method, since the return value is different for different calendar types.

Reimplemented in frepple::CalendarPointer< T >::BucketPointer, and frepple::CalendarValue< T >::BucketValue.

Definition at line 165 of file model.h.

int frepple::Calendar::Bucket::initialize ( ) [static]

Definition at line 58 of file calendar.cpp.

int frepple::Calendar::Bucket::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::utils::PythonExtensionBase.

Definition at line 854 of file calendar.cpp.

void frepple::Calendar::Bucket::setEnd ( const Date d) [inline]

Updates the end date of the bucket.

Definition at line 192 of file model.h.

void frepple::Calendar::Bucket::setName ( const string &  s) [inline]

Updates the name of a bucket.

Definition at line 186 of file model.h.

void frepple::Calendar::Bucket::setPriority ( int  f) [inline]

Updates the priority of this bucket, compared to other buckets effective at a certain time.
Lower numbers indicate a higher priority level.
The default value is 0.

Definition at line 212 of file model.h.

void frepple::Calendar::Bucket::setStart ( const Date d) [inline]

Updates the end date of the bucket.

Definition at line 198 of file model.h.

void frepple::Calendar::Bucket::setValue ( ) [inline]

This method is here only to keep the API of all calendar classes consistent.

Definition at line 170 of file model.h.

bool frepple::Calendar::Bucket::useDefaultName ( ) const [inline]

Returns true if the name of the bucket has not been explicitly specified.

Definition at line 183 of file model.h.

void frepple::Calendar::Bucket::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::utils::Object.

Reimplemented in frepple::CalendarPointer< T >::BucketPointer, and frepple::CalendarValue< T >::BucketValue.

Definition at line 428 of file calendar.cpp.

void frepple::Calendar::Bucket::writeHeader ( XMLOutput o,
const Keyword tag 
) const [protected]

Auxilary function to write out the start of the XML.

Definition at line 387 of file calendar.cpp.


Friends And Related Function Documentation

friend class BucketIterator [friend]

Definition at line 109 of file model.h.

friend class Calendar [friend]

Definition at line 108 of file model.h.

friend class EventIterator [friend]

Definition at line 110 of file model.h.


Member Data Documentation

Definition at line 236 of file model.h.


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

Documentation generated for frePPLe by  doxygen