Classes | Public Member Functions | Public Attributes | List of all members
CalendarItem Class Referenceabstract

#include <calendaritem.h>


struct  Point
struct  Time

Public Member Functions

 CalendarItem ()=default
 CalendarItem (const Point &point, const std::string &title)
bool init (utility::ErrorState &errorState) override
virtual bool active (SystemTimeStamp timeStamp) const =0
void setTitle (const std::string &title)
const std::string & getTitle () const
void setDescription (const std::string &description)
const std::string & getDescription () const
bool setPoint (const Point &point)
const PointgetPoint () const
bool setTime (const Time &time)
const TimegetTime () const
void setDuration (const Time &duration)
const TimegetDuration () const
- Public Member Functions inherited from Resource
 Resource ()
- Public Member Functions inherited from Object
 Object ()
virtual ~Object ()
virtual void onDestroy ()
 Object (Object &)=delete
Objectoperator= (const Object &)=delete
 Object (Object &&)=delete
Objectoperator= (Object &&)=delete

Public Attributes

std::string mTitle = ""
 Property: 'Title' item title. More...
Point mPoint
 Property; 'Point' point in time together with duration. More...
std::string mDescription = ""
 Property: 'Description' item description. More...
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)


Base class of all calendar items. Every item has a start time and duration. The title and description are optional. Calendar item resolution is minutes (by default).

Derived classes must override active(). That method defines if the item currently 'occurs' based on the given timestamp.

Inheritance diagram for CalendarItem:
Collaboration diagram for CalendarItem:

Constructor & Destructor Documentation

◆ CalendarItem() [1/2]

CalendarItem ( )

◆ CalendarItem() [2/2]

CalendarItem ( const Point point,
const std::string &  title 

Member Function Documentation

◆ active()

virtual bool active ( SystemTimeStamp  timeStamp) const
pure virtual

Returns if the current item is active based on the specified 'Time', 'Duration' and other properties of this item. Must be implemented in derived classes.

timeStamptime to validate, for example the current system time
if the current item is active.

Implemented in DailyCalendarItem, WeeklyCalendarItem, MonthlyCalendarItem, YearlyCalendarItem, and UniqueCalendarItem.

◆ getDescription()

const std::string& getDescription ( ) const
item description

◆ getDuration()

const Time& getDuration ( ) const
item duration (hours, minutes)

◆ getPoint()

const Point& getPoint ( ) const
item time and duration

◆ getTime()

const Time& getTime ( ) const
item time

◆ getTitle()

const std::string& getTitle ( ) const
item title

◆ init()

bool init ( utility::ErrorState errorState)

Initializes the calendar item, always call this in derived classes. Ensures the given time is valid.

If initialization succeeded.

Reimplemented from Object.

Reimplemented in DailyCalendarItem, WeeklyCalendarItem, MonthlyCalendarItem, YearlyCalendarItem, and UniqueCalendarItem.

◆ setDescription()

void setDescription ( const std::string &  description)

Updates item description

descriptionnew item description

◆ setDuration()

void setDuration ( const Time duration)

Updates item duration.

durationnew duration
if the duration is updated

◆ setPoint()

bool setPoint ( const Point point)

Updates item time and duration and ensures new settings are valid.

pointnew time and duration
if time and duration have been updated

◆ setTime()

bool setTime ( const Time time)

Updates time and ensures it is valid.

timenew time
if the time is updated

◆ setTitle()

void setTitle ( const std::string &  title)

Updates item title

titlenew item title

Member Data Documentation

◆ mDescription

std::string mDescription = ""

Property: 'Description' item description.

◆ mPoint

Point mPoint

Property; 'Point' point in time together with duration.

◆ mTitle

std::string mTitle = ""

Property: 'Title' item title.