Ocean
Ocean::ApplicationInterface Class Reference

This class implements a very light application interface. More...

Inheritance diagram for Ocean::ApplicationInterface:

Public Types

typedef unsigned int EventId
 Definition of an event id. More...
 
typedef std::vector< EventIdEventIds
 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< EventCallbackEventCallbacks
 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 ApplicationInterfaceget ()
 Returns a reference to the unique object. More...
 

Detailed Description

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.

Member Typedef Documentation

◆ 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.

◆ 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.

◆ EventCallbacks

Definition of an vector holding event callbacks.

◆ EventId

Definition of an event id.

◆ EventIds

Definition of a vector holding event ids.

◆ StringVector

typedef std::vector<std::string> Ocean::ApplicationInterface::StringVector

Definition of a vector holding strings.

Constructor & Destructor Documentation

◆ ~ApplicationInterface()

virtual Ocean::ApplicationInterface::~ApplicationInterface ( )
protectedvirtual

Destructs an application interface object.

Member Function Documentation

◆ addContent()

EventIds Ocean::ApplicationInterface::addContent ( const StringVector content)

Tells the application to add content.

Parameters
contentContent to be loaded (may be e.g. urls of files)
Returns
Corresponding event ids, one for each file

◆ addEventCallbackFunction()

void Ocean::ApplicationInterface::addEventCallbackFunction ( const EventCallback callback)

Adds an event callback function.

Parameters
callbackCallback to be added

◆ contentAdded()

void Ocean::ApplicationInterface::contentAdded ( const EventId  eventId,
const bool  state 
)

Event function for added content.

Parameters
eventIdEvent id of the added content
stateState of the add event

◆ contentRemoved()

void Ocean::ApplicationInterface::contentRemoved ( const EventId  eventId,
const bool  state 
)

Event function for removed content.

Parameters
eventIdEvent id of the removed content
stateState of the remove event

◆ removeContent()

EventIds Ocean::ApplicationInterface::removeContent ( const StringVector content)

Tells the application to close all existing files.

Parameters
contentContent to be unloaded (may be e.g. urls of files), if this parameter is empty the entire content will be removed
Returns
Corresponding event ids, one for each file

◆ removeEventCallbackFunction()

void Ocean::ApplicationInterface::removeEventCallbackFunction ( const EventCallback callback)

Removes an event callback function.

Parameters
callbackCallback to be removed

◆ setContentAddCallbackFunction()

void Ocean::ApplicationInterface::setContentAddCallbackFunction ( const ContentCallback callback)

Sets or replaces the add content callback function.

Parameters
callbackCallback function to be set

◆ setContentRemoveCallbackFunction()

void Ocean::ApplicationInterface::setContentRemoveCallbackFunction ( const ContentCallback callback)

Sets or replaces the remove content callback function.

Parameters
callbackCallback function to be set

Friends And Related Function Documentation

◆ Singleton< ApplicationInterface >

friend class Singleton< ApplicationInterface >
friend

Field Documentation

◆ contentAddCallback

ContentCallback Ocean::ApplicationInterface::contentAddCallback
private

Content add callback.

◆ contentEventCallbacks

EventCallbacks Ocean::ApplicationInterface::contentEventCallbacks
private

Event callbacks.

◆ contentRemoveCallback

ContentCallback Ocean::ApplicationInterface::contentRemoveCallback
private

Content remove callback.

◆ invalidEventId

const EventId Ocean::ApplicationInterface::invalidEventId
static

Definition of an invalid event id.

◆ lock

Lock Ocean::ApplicationInterface::lock
private

Interface lock.


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