Ocean
|
This class implements a very light application interface. More...
Public Types | |
typedef unsigned int | EventId |
Definition of an event id. More... | |
typedef std::vector< EventId > | EventIds |
Definition of a vector holding event ids. More... | |
typedef std::vector< std::string > | StringVector |
Definition of a vector holding strings. More... | |
typedef Callback< EventIds, const StringVector & > | ContentCallback |
Definition of a content add or remove callback function. More... | |
typedef Callback< void, EventId, bool, bool > | EventCallback |
Definition of a content event callback function. More... | |
Public Member Functions | |
EventIds | addContent (const StringVector &content) |
Tells the application to add content. More... | |
EventIds | removeContent (const StringVector &content) |
Tells the application to close all existing files. More... | |
void | contentAdded (const EventId eventId, const bool state) |
Event function for added content. More... | |
void | contentRemoved (const EventId eventId, const bool state) |
Event function for removed content. More... | |
void | setContentAddCallbackFunction (const ContentCallback &callback) |
Sets or replaces the add content callback function. More... | |
void | setContentRemoveCallbackFunction (const ContentCallback &callback) |
Sets or replaces the remove content callback function. More... | |
void | addEventCallbackFunction (const EventCallback &callback) |
Adds an event callback function. More... | |
void | removeEventCallbackFunction (const EventCallback &callback) |
Removes an event callback function. More... | |
Static Public Attributes | |
static const EventId | invalidEventId |
Definition of an invalid event id. More... | |
Protected Member Functions | |
virtual | ~ApplicationInterface () |
Destructs an application interface object. More... | |
Protected Member Functions inherited from Ocean::Singleton< ApplicationInterface > | |
Singleton ()=default | |
Default constructor. More... | |
Private Types | |
typedef Callbacks< EventCallback > | EventCallbacks |
Definition of an vector holding event callbacks. More... | |
Private Attributes | |
ContentCallback | contentAddCallback |
Content add callback. More... | |
ContentCallback | contentRemoveCallback |
Content remove callback. More... | |
EventCallbacks | contentEventCallbacks |
Event callbacks. More... | |
Lock | lock |
Interface lock. More... | |
Friends | |
class | Singleton< ApplicationInterface > |
Additional Inherited Members | |
Static Public Member Functions inherited from Ocean::Singleton< ApplicationInterface > | |
static ApplicationInterface & | get () |
Returns a reference to the unique object. More... | |
This class implements a very light application interface.
The interface can be used to access basic application functionalities.
Define the callback function of each feature your application supports.
This interface is implemented as a singleton.
typedef Callback<EventIds, const StringVector&> Ocean::ApplicationInterface::ContentCallback |
Definition of a content add or remove callback function.
The return parameter is the corresponding event id.
The first parameter holds the content to be added.
typedef Callback<void, EventId, bool, bool> Ocean::ApplicationInterface::EventCallback |
Definition of a content event callback function.
The first parameter hold the event id.
The second parameter defines whether the event has been loaded (true) or unloaded (false) The third parameter defined the event state.
|
private |
Definition of an vector holding event callbacks.
typedef unsigned int Ocean::ApplicationInterface::EventId |
Definition of an event id.
typedef std::vector<EventId> Ocean::ApplicationInterface::EventIds |
Definition of a vector holding event ids.
typedef std::vector<std::string> Ocean::ApplicationInterface::StringVector |
Definition of a vector holding strings.
|
protectedvirtual |
Destructs an application interface object.
EventIds Ocean::ApplicationInterface::addContent | ( | const StringVector & | content | ) |
Tells the application to add content.
content | Content to be loaded (may be e.g. urls of files) |
void Ocean::ApplicationInterface::addEventCallbackFunction | ( | const EventCallback & | callback | ) |
Adds an event callback function.
callback | Callback to be added |
void Ocean::ApplicationInterface::contentAdded | ( | const EventId | eventId, |
const bool | state | ||
) |
void Ocean::ApplicationInterface::contentRemoved | ( | const EventId | eventId, |
const bool | state | ||
) |
EventIds Ocean::ApplicationInterface::removeContent | ( | const StringVector & | content | ) |
Tells the application to close all existing files.
content | Content to be unloaded (may be e.g. urls of files), if this parameter is empty the entire content will be removed |
void Ocean::ApplicationInterface::removeEventCallbackFunction | ( | const EventCallback & | callback | ) |
Removes an event callback function.
callback | Callback to be removed |
void Ocean::ApplicationInterface::setContentAddCallbackFunction | ( | const ContentCallback & | callback | ) |
Sets or replaces the add content callback function.
callback | Callback function to be set |
void Ocean::ApplicationInterface::setContentRemoveCallbackFunction | ( | const ContentCallback & | callback | ) |
Sets or replaces the remove content callback function.
callback | Callback function to be set |
|
friend |
|
private |
Content add callback.
|
private |
Event callbacks.
|
private |
Content remove callback.
|
static |
Definition of an invalid event id.
|
private |
Interface lock.