#include <scripting_interface.hpp>
◆ ~ScriptContextInterface()
virtual kanzi::connect::ScriptContextInterface::~ScriptContextInterface |
( |
| ) |
|
|
inlinevirtual |
◆ createServiceSession()
virtual optional< int > kanzi::connect::ScriptContextInterface::createServiceSession |
( |
const string & | interfaceName, |
|
|
string | fullyQualifiedServiceName = string() ) |
|
inlinevirtual |
Creates a session to a service.
- Parameters
-
interfaceName | name of the interface to create session, E.g. "Input" |
fullyQualifiedServiceName | fully qualilified service name implementing the interface, E.g. "Connect.CoreService.Input". Optional. |
- Returns
- session identifier if session was succesfully created.
◆ getCommunicationInterface()
Retrieves the associated communication interface.
- Returns
- communication interface.
◆ initialize()
Initialize the context.
- Returns
- true on success.
◆ registerScriptContextExtensions()
virtual void kanzi::connect::ScriptContextInterface::registerScriptContextExtensions |
( |
| ) |
|
|
protectedpure virtual |
Extend the script context, relevant only for classes inheriting concrete implementations of API.
◆ registerService()
virtual void kanzi::connect::ScriptContextInterface::registerService |
( |
const string & | identifier, |
|
|
int | sessionId ) |
|
inlinevirtual |
Register a service to be used within a script.
Registering a service to script context allows accessing its methods, events and runtime-data on a script using notation [ServiceIdentifier]:[method|event|runtimedata-name], e.g. "System:demo.range".
- Parameters
-
identifier | An identifier of a service to be registered. |
sessionId | Session identifier on SimpleConnectedClientSharedPtr |
◆ releaseServiceSession()
virtual void kanzi::connect::ScriptContextInterface::releaseServiceSession |
( |
int | sessionId | ) |
|
|
inlinevirtual |
Releases a previously acquired service session.
- Parameters
-
sessionId | session identifier. |
◆ reset()
virtual void kanzi::connect::ScriptContextInterface::reset |
( |
| ) |
|
|
pure virtual |
Release resources and context.
◆ runOnce()
virtual bool kanzi::connect::ScriptContextInterface::runOnce |
( |
const string & | script, |
|
|
AbstractServiceSharedPtr | service ) |
|
inlinevirtual |
Run a script.
- Parameters
-
script | ECMAScript E5/E5.1 as a string. |
service | A service to host the script. |
- Returns
- true if there is more work to do and script should keep running on further iterations.
◆ runScript()
Execute a script.
- Parameters
-
description | Description of method arguments and return value. |
message | Arguments for the method. |
service | Attached service. |
- Returns
- Reply message according to method description or null pointer.
◆ unregisterService()
virtual void kanzi::connect::ScriptContextInterface::unregisterService |
( |
const string & | identifier | ) |
|
|
inlinevirtual |
Unregister a service.
- Parameters
-
identifier | An identifier of a service to be unregistered. |
The documentation for this class was generated from the following file:
- connect/interface/scripting_interface.hpp