This class represents a time bucket as a part of a calendar. More...
#include <model.h>
Public Member Functions | |
bool | checkValid (Date d) const |
void | endElement (XMLInput &, const Attribute &, const DataElement &) |
virtual bool | getBool () const |
Date | getEnd () const |
string | getName () const |
int | getPriority () const |
virtual size_t | getSize () const |
Date | getStart () const |
virtual const MetaClass & | getType () const |
void | getValue () const |
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 Attributes | |
static const MetaCategory * | metadata |
Protected Member Functions | |
Bucket (Date start, Date end, string name) | |
void | writeHeader (XMLOutput *) const |
Friends | |
class | BucketIterator |
class | Calendar |
class | EventIterator |
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.
Definition at line 105 of file model.h.
bool frepple::Calendar::Bucket::checkValid | ( | Date | d | ) | const [inline] |
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::CalendarValue< T >::BucketValue, and frepple::CalendarPointer< T >::BucketPointer.
Definition at line 319 of file calendar.cpp.
virtual bool frepple::Calendar::Bucket::getBool | ( | ) | const [inline, virtual] |
Convert the value of the bucket to a boolean value.
Reimplemented in frepple::CalendarValue< T >::BucketValue, frepple::CalendarPointer< T >::BucketPointer, frepple::CalendarValue< T >::BucketValue, and frepple::CalendarValue< T >::BucketValue.
Date frepple::Calendar::Bucket::getEnd | ( | ) | const [inline] |
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.
int frepple::Calendar::Bucket::getPriority | ( | ) | const [inline] |
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::CalendarValue< T >::BucketValue, and frepple::CalendarPointer< T >::BucketPointer.
Date frepple::Calendar::Bucket::getStart | ( | ) | const [inline] |
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::CalendarValue< T >::BucketValue, and frepple::CalendarPointer< T >::BucketPointer.
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::CalendarValue< T >::BucketValue, and frepple::CalendarPointer< T >::BucketPointer.
void frepple::Calendar::Bucket::setEnd | ( | const Date & | d | ) | [inline] |
void frepple::Calendar::Bucket::setName | ( | const string & | s | ) | [inline] |
void frepple::Calendar::Bucket::setPriority | ( | int | f | ) | [inline] |
void frepple::Calendar::Bucket::setStart | ( | const Date & | d | ) | [inline] |
void frepple::Calendar::Bucket::setValue | ( | ) | [inline] |
bool frepple::Calendar::Bucket::useDefaultName | ( | ) | const [inline] |
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::CalendarValue< T >::BucketValue, and frepple::CalendarPointer< T >::BucketPointer.
Definition at line 310 of file calendar.cpp.
void frepple::Calendar::Bucket::writeHeader | ( | XMLOutput * | o | ) | const [protected] |
Auxilary function to write out the start of the XML.
Definition at line 269 of file calendar.cpp.
friend class BucketIterator [friend] |
friend class EventIterator [friend] |
const MetaCategory * frepple::Calendar::Bucket::metadata [static] |