Switchboard SDK
Loading...
Searching...
No Matches
switchboard::Switchboard Class Reference

The main Switchboard SDK interface. More...

#include <Switchboard.hpp>

Public Types

using ObjectID = std::string
using ObjectURI = std::string

Static Public Member Functions

static Result< ObjectURI > initialize (const SBAnyMap &config)
 Initializes the Switchboard SDK.
static Result< void > deinitialize ()
 Deinitializes the Switchboard SDK.
static Result< ObjectURI > createEngine (const SBAnyMap &config)
 Creates a new Switchboard engine.
static Result< void > destroyEngine (const ObjectURI &engineURI)
 Destroys a Switchboard engine.
static Result< SBAnycallAction (const ObjectURI &objectURI, const std::string &actionName, const SBAnyMap &params={})
 Calls an action on a Switchboard object.
static Result< void > setValue (const ObjectURI &objectURI, const std::string &key, const SBAny &value)
 Sets a value of a property on a Switchboard object.
static Result< SBAnygetValue (const ObjectURI &objectURI, const std::string &key)
 Gets a value of a property from a Switchboard object.
static Result< unsigned int > addEventListener (const ObjectURI &objectURI, const std::string &eventName, const std::function< void(const Event &)> &callback)
 Adds a new event listener to a Switchboard object.
static Result< void > removeEventListener (const ObjectURI &objectURI, unsigned int listenerID)
 Removes an event listener from a Switchboard object.

Detailed Description

The main Switchboard SDK interface.

Member Function Documentation

◆ addEventListener()

Result< unsigned int > switchboard::Switchboard::addEventListener ( const ObjectURI & objectURI,
const std::string & eventName,
const std::function< void(const Event &)> & callback )
static

Adds a new event listener to a Switchboard object.

Parameters
objectURIThe URI of the object.
eventNameThe name of the event to listen to.
callbackThe callback function to call when the event is fired.
Returns
The ID of the listener.

◆ callAction()

Result< SBAny > switchboard::Switchboard::callAction ( const ObjectURI & objectURI,
const std::string & actionName,
const SBAnyMap & params = {} )
static

Calls an action on a Switchboard object.

Parameters
objectURIThe URI of the object.
actionNameThe name of the action.
paramsThe parameters of the action.
Returns
The result of the action.

◆ createEngine()

Result< ObjectURI > switchboard::Switchboard::createEngine ( const SBAnyMap & config)
static

Creates a new Switchboard engine.

This method calls "createEngine" action on the SDK Instance (object URI: "switchboard").

Parameters
configConfiguration map.
Returns
The URI of the created engine.

◆ deinitialize()

Result< void > switchboard::Switchboard::deinitialize ( )
static

Deinitializes the Switchboard SDK.

Returns
A successful result if the SDK was deinitialized successfully, an error result otherwise.

◆ destroyEngine()

Result< void > switchboard::Switchboard::destroyEngine ( const ObjectURI & engineURI)
static

Destroys a Switchboard engine.

This method calls "destroyEngine" action on the SDK Instance (object URI: "switchboard").

Parameters
engineURIThe URI of the engine object.
Returns
A successful result if the object was destroyed successfully, an error result otherwise.

◆ getValue()

Result< SBAny > switchboard::Switchboard::getValue ( const ObjectURI & objectURI,
const std::string & key )
static

Gets a value of a property from a Switchboard object.

Parameters
objectURIThe URI of the object.
keyThe name of the property.
Returns
The value.

◆ initialize()

Result< ObjectURI > switchboard::Switchboard::initialize ( const SBAnyMap & config)
static

Initializes the Switchboard SDK.

Parameters
configConfiguration map.
Returns
The URI of the initialized Switchboard SDK.

◆ removeEventListener()

Result< void > switchboard::Switchboard::removeEventListener ( const ObjectURI & objectURI,
unsigned int listenerID )
static

Removes an event listener from a Switchboard object.

Parameters
objectURIThe URI of the object.
listenerIDThe ID of the listener to remove.
Returns
A successful result if the listener was removed successfully, an error result otherwise.

◆ setValue()

Result< void > switchboard::Switchboard::setValue ( const ObjectURI & objectURI,
const std::string & key,
const SBAny & value )
static

Sets a value of a property on a Switchboard object.

Parameters
objectURIThe URI of the object.
keyThe name of the property.
valueThe value to set.
Returns
A successful result if the value was set successfully, an error result otherwise.

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