Switchboard SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
Switchboard.hpp
1
//
2
// Switchboard.hpp
3
// SwitchboardSDK
4
//
5
// Copyright © 2026 Synervoz. All rights reserved.
6
//
7
8
#pragma once
9
10
#include "export.h"
11
#include "Result.hpp"
12
#include "Event.hpp"
13
14
#include <any>
15
#include <functional>
16
#include <map>
17
#include <string>
18
19
namespace
switchboard {
20
24
class
SWITCHBOARDSDK_EXPORT
Switchboard
{
25
public
:
26
using
ObjectID = std::string;
27
using
ObjectURI = std::string;
28
36
static
Result<ObjectURI>
initialize
(
const
SBAnyMap
& config);
37
43
static
Result<void>
deinitialize
();
44
54
static
Result<ObjectURI>
createEngine
(
const
SBAnyMap
& config);
55
65
static
Result<void>
destroyEngine
(
const
ObjectURI& engineURI);
66
76
static
Result<SBAny>
77
callAction
(
const
ObjectURI& objectURI,
const
std::string& actionName,
const
SBAnyMap
& params = {});
78
88
static
Result<void>
setValue
(
const
ObjectURI& objectURI,
const
std::string& key,
const
SBAny
& value);
89
98
static
Result<SBAny>
getValue
(
const
ObjectURI& objectURI,
const
std::string& key);
99
109
static
Result<unsigned int>
addEventListener
(
const
ObjectURI& objectURI,
const
std::string& eventName,
const
std::function<
void
(
const
Event
&)>& callback);
110
119
static
Result<void>
removeEventListener
(
const
ObjectURI& objectURI,
unsigned
int
listenerID);
120
121
private
:
122
class
Impl;
123
static
Impl* pImpl;
124
};
125
126
}
switchboard::Result
Represents the result of an operation that can either succeed or fail.
Definition
Result.hpp:39
switchboard::SBAny
A versatile container class that can hold values of various types.
Definition
SBAny.hpp:53
switchboard::SBAnyMap
Map class to store and retrieve values.
Definition
SBAny.hpp:281
switchboard::Switchboard
The main Switchboard SDK interface.
Definition
Switchboard.hpp:24
switchboard::Switchboard::deinitialize
static Result< void > deinitialize()
Deinitializes the Switchboard SDK.
switchboard::Switchboard::createEngine
static Result< ObjectURI > createEngine(const SBAnyMap &config)
Creates a new Switchboard engine.
switchboard::Switchboard::getValue
static Result< SBAny > getValue(const ObjectURI &objectURI, const std::string &key)
Gets a value of a property from a Switchboard object.
switchboard::Switchboard::initialize
static Result< ObjectURI > initialize(const SBAnyMap &config)
Initializes the Switchboard SDK.
switchboard::Switchboard::removeEventListener
static Result< void > removeEventListener(const ObjectURI &objectURI, unsigned int listenerID)
Removes an event listener from a Switchboard object.
switchboard::Switchboard::callAction
static Result< SBAny > callAction(const ObjectURI &objectURI, const std::string &actionName, const SBAnyMap ¶ms={})
Calls an action on a Switchboard object.
switchboard::Switchboard::addEventListener
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.
switchboard::Switchboard::destroyEngine
static Result< void > destroyEngine(const ObjectURI &engineURI)
Destroys a Switchboard engine.
switchboard::Switchboard::setValue
static Result< void > setValue(const ObjectURI &objectURI, const std::string &key, const SBAny &value)
Sets a value of a property on a Switchboard object.
switchboard::Event
Represents an event that can be emitted and listened to.
Definition
Event.hpp:23
SwitchboardSDK
include
switchboard
Switchboard.hpp
Generated by
1.17.0