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

#include <model.h>

Inheritance diagram for frepple::Calendar::Bucket:

Public Member Functions

void endElement (XMLInput &, const Attribute &, const DataElement &)
 
virtual PyObject * getattro (const Attribute &)
 
virtual bool getBool () const
 
CalendargetCalendar () const
 
short getDays () const
 
Date getEnd () const
 
TimePeriod getEndTime () const
 
int getId () const
 
int getPriority () const
 
virtual size_t getSize () const
 
Date getStart () const
 
TimePeriod getStartTime () const
 
virtual const MetaClassgetType () const
 
virtual int setattro (const Attribute &, const PythonObject &)
 
void setDays (short p)
 
void setEnd (const Date d)
 
void setEndTime (TimePeriod t)
 
void setId (int ident=INT_MIN)
 
void setPriority (int f)
 
void setStart (const Date d)
 
void setStartTime (TimePeriod t)
 
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 
- Public Member Functions inherited from frepple::utils::Object
virtual void beginElement (XMLInput &, const Attribute &)
 
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)
 
virtual int compare (const PyObject *other) const
 
Py_ssize_t getReferenceCount () const
 
void initType (const MetaClass *t)
 
void initType (PyTypeObject *t)
 
virtual PyObject * iternext ()
 
 PythonExtensionBase ()
 
void resetReferenceCount ()
 
virtual PyObject * str () const
 
virtual ~PythonExtensionBase ()
 

Static Public Member Functions

static int initialize ()
 
- 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 MetaCategorymetadata
 

Protected Member Functions

 Bucket (Calendar *c, Date start, Date end, int ident=INT_MIN, int priority=0)
 
void writeHeader (XMLOutput *, const Keyword &) const
 
- Protected Member Functions inherited from frepple::utils::NonCopyable
 NonCopyable ()
 
 ~NonCopyable ()
 

Friends

class BucketIterator
 
class Calendar
 
class EventIterator
 

Additional Inherited Members

- 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

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 101 of file model.h.

Constructor & Destructor Documentation

frepple::Calendar::Bucket::Bucket ( Calendar c,
Date  start,
Date  end,
int  ident = INT_MIN,
int  priority = 0 
)
inlineprotected

Constructor.

Definition at line 177 of file model.h.

Member Function Documentation

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::CalendarDouble::BucketDouble.

Definition at line 497 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 920 of file calendar.cpp.

virtual bool frepple::Calendar::Bucket::getBool ( ) const
inlinevirtual

Convert the value of the bucket to a boolean value.

Reimplemented in frepple::CalendarDouble::BucketDouble.

Definition at line 278 of file model.h.

Calendar* frepple::Calendar::Bucket::getCalendar ( ) const
inline

Return the calendar to whom the bucket belongs.

Definition at line 195 of file model.h.

short frepple::Calendar::Bucket::getDays ( ) const
inline

Get the days on which the entry is valid.
The value is a bit pattern with bit 0 representing sunday, bit 1 monday, ... and bit 6 representing saturday.
The default value is 127.

Definition at line 238 of file model.h.

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

Returns the end date of the bucket.

Definition at line 208 of file model.h.

TimePeriod frepple::Calendar::Bucket::getEndTime ( ) const
inline

Return the time of the day when the entry becomes invalid.
The default value is 23h59m59s.

Definition at line 266 of file model.h.

int frepple::Calendar::Bucket::getId ( ) const
inline

Get the identifier.

Definition at line 198 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 224 of file model.h.

virtual size_t frepple::Calendar::Bucket::getSize ( ) const
inlinevirtual

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Reimplemented in frepple::CalendarDouble::BucketDouble.

Definition at line 290 of file model.h.

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

Returns the start date of the bucket.

Definition at line 214 of file model.h.

TimePeriod frepple::Calendar::Bucket::getStartTime ( ) const
inline

Return the time of the day when the entry becomes valid.
The default value is 0 or midnight.

Definition at line 252 of file model.h.

virtual const MetaClass& frepple::Calendar::Bucket::getType ( ) const
inlinevirtual

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

Implements frepple::utils::Object.

Reimplemented in frepple::CalendarDouble::BucketDouble.

Definition at line 289 of file model.h.

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

Definition at line 53 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 949 of file calendar.cpp.

void frepple::Calendar::Bucket::setDays ( short  p)
inline

Update the days on which the entry is valid.

Definition at line 241 of file model.h.

void frepple::Calendar::Bucket::setEnd ( const Date  d)

Updates the end date of the bucket.

Definition at line 235 of file calendar.cpp.

void frepple::Calendar::Bucket::setEndTime ( TimePeriod  t)
inline

Update the time of the day when the entry becomes invalid.

Definition at line 269 of file model.h.

void frepple::Calendar::Bucket::setId ( int  ident = INT_MIN)

Generate the identfier.
If a bucket with the given identifier already exists a unique number is generated instead. This is done by incrementing the value passed until it is unique.

Definition at line 510 of file calendar.cpp.

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 231 of file model.h.

void frepple::Calendar::Bucket::setStart ( const Date  d)

Updates the start date of the bucket.

Definition at line 246 of file calendar.cpp.

void frepple::Calendar::Bucket::setStartTime ( TimePeriod  t)
inline

Update the time of the day when the entry becomes valid.

Definition at line 255 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::CalendarDouble::BucketDouble.

Definition at line 483 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 462 of file calendar.cpp.

Friends And Related Function Documentation

friend class BucketIterator
friend

Definition at line 104 of file model.h.

friend class Calendar
friend

Definition at line 103 of file model.h.

friend class EventIterator
friend

Definition at line 105 of file model.h.

Member Data Documentation

const MetaCategory * frepple::Calendar::Bucket::metadata
static

Definition at line 291 of file model.h.


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