Switchboard Extension SDK
Loading...
Searching...
No Matches
switchboard::Extension Class Referenceabstract

Interface for Switchboard SDK extensions. More...

#include <Extension.hpp>

Inheritance diagram for switchboard::Extension:
switchboard::SwitchboardObject switchboard::EventEmitter

Public Member Functions

 Extension ()
 Constructor for the Extension class.
virtual ~Extension ()=default
 Destructor.
virtual Result< void > initialize (const std::map< std::string, std::any > &config)
 Initializes the extension.
virtual Result< void > deinitialize ()
 Deinitializes the extension.
virtual std::string getName ()=0
 Gets the name of the extension.
virtual std::shared_ptr< NodeFactorygetNodeFactory ()=0
 Gets the NodeFactory object of the extension.
Public Member Functions inherited from switchboard::SwitchboardObject
 SwitchboardObject (const std::string &objectType)
 ~SwitchboardObject () override=default
 SwitchboardObject destructor.
virtual Result< void > setValue (const std::string &key, const std::any &value)
 Sets a value on the object.
virtual Result< std::any > getValue (const std::string &key)
 Gets a value from the object.
virtual Result< std::any > callAction (const std::string &actionName, const std::map< std::string, std::any > &params)
 Calls an action on the object.
Public Member Functions inherited from switchboard::EventEmitter
 EventEmitter ()
 Constructor for the EventEmitter class.
virtual ~EventEmitter ()
 Destructor for the EventEmitter class.
unsigned int addEventListener (const std::string &eventName, EventCallback callback)
 Adds a new event listener to the object.
bool removeEventListener (unsigned int listenerID)
 Removes an event listener from the object.

Additional Inherited Members

Protected Member Functions inherited from switchboard::EventEmitter
void emitEvent (const std::string &eventName, const EventData &data)
 Emits an event.

Detailed Description

Interface for Switchboard SDK extensions.

Constructor & Destructor Documentation

◆ Extension()

switchboard::Extension::Extension ( )
inline

Constructor for the Extension class.

The constructor initializes the SwitchboardObject with the type EXTENSION.

Member Function Documentation

◆ deinitialize()

virtual Result< void > switchboard::Extension::deinitialize ( )
inlinevirtual

Deinitializes the extension.

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

◆ getName()

virtual std::string switchboard::Extension::getName ( )
pure virtual

Gets the name of the extension.

Returns
std::string The name of the extension.

◆ getNodeFactory()

virtual std::shared_ptr< NodeFactory > switchboard::Extension::getNodeFactory ( )
pure virtual

Gets the NodeFactory object of the extension.

The NodeFactory object is used to create custom nodes.

Returns
std::shared_ptr<NodeFactory> The NodeFactory object of the extension.

◆ initialize()

virtual Result< void > switchboard::Extension::initialize ( const std::map< std::string, std::any > & config)
inlinevirtual

Initializes the extension.

Parameters
configConfiguration values for the extension.
Returns
A successful result if the extension was initialized successfully, an error result otherwise.

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