NAP
Public Member Functions | Public Attributes | List of all members
Calendar Class Reference

#include <calendar.h>

Public Member Functions

 Calendar (nap::Core &core)
 
virtual ~Calendar ()
 
virtual bool init (utility::ErrorState &errorState) override
 
CalendarInstancegetInstance () override
 
const CalendarInstancegetInstance () const override
 
- Public Member Functions inherited from ICalendar
 ICalendar (nap::Core &core)
 
- 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

CalendarItemList mItems
 Property: 'Items' default set of calendar items. More...
 
bool mAllowFailure = true
 Property: 'AllowLoadFailure' If initialization continues when loading a calendar from disk fails. In that case resource defaults are used. 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)
 
- Protected Attributes inherited from ICalendar
nap::CoremCore
 NAP core. More...
 

Description

Simple serializable calendar resource that manages a set of calendar items. Call getInstance() to inspect, create, load and save the calendar.

The instance is created on initialization and is constructed using the set of 'Items' defined by this resource. If a calendar with the same ID exists on disk (saved previously) it is loaded instead.

Use the nap::CalendarComponent to receive a notification when an event starts and ends. Note that this calendar is meant to be used with a 'limited' (1000x) set of events, as it doesn't make use of a database.

Inheritance diagram for Calendar:
[legend]
Collaboration diagram for Calendar:
[legend]

Constructor & Destructor Documentation

◆ Calendar()

Calendar ( nap::Core core)

◆ ~Calendar()

virtual ~Calendar ( )
virtual

Member Function Documentation

◆ getInstance() [1/2]

const CalendarInstance& getInstance ( ) const
overridevirtual
Returns
the calendar instance, only available after initialization

Implements ICalendar.

◆ getInstance() [2/2]

CalendarInstance& getInstance ( )
overridevirtual
Returns
the calendar instance, only available after initialization

Implements ICalendar.

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Creates and initializes the calendar instance

Returns
if initialization succeeded

Reimplemented from Object.

Member Data Documentation

◆ mAllowFailure

bool mAllowFailure = true

Property: 'AllowLoadFailure' If initialization continues when loading a calendar from disk fails. In that case resource defaults are used.

◆ mItems

Property: 'Items' default set of calendar items.