The main Switchboard SDK interface.
More...
#include <Switchboard.hpp>
|
using | ObjectID = std::string |
The main Switchboard SDK interface.
◆ addEventListener()
Result< unsigned int > switchboard::Switchboard::addEventListener |
( |
ObjectID | objectID, |
|
|
const std::string & | eventName, |
|
|
const std::function< void(const std::any &)> & | callback ) |
|
static |
Adds a new event listener to a Switchboard object.
- Parameters
-
objectID | The ID of the object. |
eventName | The name of the event to listen to. |
callback | The callback function to call when the event is fired. |
- Returns
- The ID of the listener.
◆ callAction()
Result< std::any > switchboard::Switchboard::callAction |
( |
ObjectID | objectID, |
|
|
const std::string & | actionName, |
|
|
const std::map< std::string, std::any > & | params = {} ) |
|
static |
Calls an action on a Switchboard object.
- Parameters
-
objectID | The ID of the object. |
actionName | The name of the action. |
params | The parameters of the action. |
- Returns
- The result of the action.
◆ createEngine()
Result< ObjectID > switchboard::Switchboard::createEngine |
( |
const Config & | config | ) |
|
|
static |
Creates a new Switchboard engine.
This method calls "createEngine" action on the SDK Instance (object ID: "switchboard").
- Parameters
-
- Returns
- The ID 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 |
( |
ObjectID | engineID | ) |
|
|
static |
Destroys a Switchboard engine.
This method calls "destroyEngine" action on the SDK Instance (object ID: "switchboard").
- Parameters
-
objectID | The ID of the engine object. |
- Returns
- A successful result if the object was destroyed successfully, an error result otherwise.
◆ getValue()
Result< std::any > switchboard::Switchboard::getValue |
( |
ObjectID | objectID, |
|
|
const std::string & | key ) |
|
static |
Gets a value of a property from a Switchboard object.
- Parameters
-
objectID | The ID of the object. |
key | The name of the property. |
- Returns
- The value.
◆ initialize()
Result< Switchboard::ObjectID > switchboard::Switchboard::initialize |
( |
const Config & | config | ) |
|
|
static |
◆ removeEventListener()
Result< void > switchboard::Switchboard::removeEventListener |
( |
ObjectID | objectID, |
|
|
unsigned int | listenerID ) |
|
static |
Removes an event listener from a Switchboard object.
- Parameters
-
objectID | The ID of the object. |
listenerID | The 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 |
( |
ObjectID | objectID, |
|
|
const std::string & | key, |
|
|
const std::any & | value ) |
|
static |
Sets a value of a property on a Switchboard object.
- Parameters
-
objectID | The ID of the object. |
key | The name of the property. |
value | The 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: