Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
SessionCommandService Class Reference

#include "steam/control/session-command-service.hpp"

Description

Actual implementation of the SessionCommand service within the Lumiera Session subsystem.

Creating an instance of this class automatically registers corresponding interface with the Lumiera Interface/Plugin system and creates a forwarding proxy within the application core to route calls through this interface.

This service is backed by implementation facilities embedded within the SteamDispatcher, exposed through the CommandDispatch interface. Additionally, it operates a CommandInstanceManager to allow the creation of local instances "opened" for argument binding. In fact, this is the standard "command cycle" and the intended usage pattern.

Warning
local command instances are not threadsafe
See also
DispatcherLoop

Definition at line 70 of file session-command-service.hpp.

Public Member Functions

 SessionCommandService (CommandDispatch &dispatcherLoopInterface)
 
Symbol cycle (Symbol cmdID, string const &invocationID) override
 start next command cycle and "open" a new anonymous command instance
 
void trigger (Symbol cmdID, Rec const &args) override
 
void bindArg (Symbol cmdID, Rec const &args) override
 
void invoke (Symbol cmdID) override
 
- Public Member Functions inherited from SessionCommand
virtual void trigger (Symbol cmdID, lib::diff::Rec const &args)=0
 bind the command's arguments and trigger command invocation immediately
 
virtual void bindArg (Symbol cmdID, lib::diff::Rec const &args)=0
 prepare command invocation: bind the command's arguments
 

Private Types

using ServiceInstanceHandle = lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_SessionCommand, 0), SessionCommand >
 

Private Attributes

CommandDispatchdispatcher_
 
CommandInstanceManager instanceManager_
 
ServiceInstanceHandle serviceInstance_
 

Additional Inherited Members

- Static Public Attributes inherited from SessionCommand
static lib::Depend< SessionCommandfacade
 static storage for the facade access front-end
 
- Protected Member Functions inherited from SessionCommand
virtual ~SessionCommand ()
 this is an interface
 
- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ SessionCommandService()

SessionCommandService ( CommandDispatch dispatcherLoopInterface)
Remarks
actual instance created from within SteamDispatcher

Definition at line 228 of file session-command-service.cpp.

Member Typedef Documentation

◆ ServiceInstanceHandle

Member Function Documentation

◆ cycle()

Symbol cycle ( Symbol  cmdID,
string const invocationID 
)
overridevirtual

start next command cycle and "open" a new anonymous command instance

Implements SessionCommand.

Definition at line 49 of file session-command-service.cpp.

References SessionCommandService::instanceManager_, and CommandInstanceManager::newInstance().

+ Here is the call graph for this function:

◆ trigger()

void trigger ( Symbol  cmdID,
Rec const argSeq 
)
override
Parameters
cmdIDeither the instanceID or the global cmdID
Exceptions
error::Invalidwhen no suitable command definition exists
error::Statewhen the command's arguments are not suitably bound
error::Logicwhen the instance is already dispatched
Note
this function automatically falls back on a global Command definition, in case the given ID is not known as a local command instance. This allows to use the SessionCommand service without explicit instantiation
Warning
this simplified command invocation scheme is intended for single-threaded use from the UI. It is not threadsafe.

Definition at line 68 of file session-command-service.cpp.

References Command::bindArg(), CommandInstanceManager::dispatch(), CommandInstanceManager::getInstance(), and SessionCommandService::instanceManager_.

+ Here is the call graph for this function:

◆ bindArg()

void bindArg ( Symbol  cmdID,
Rec const argSeq 
)
override
Parameters
cmdIDeither the instanceID or the global cmdID
Exceptions
error::Invalidwhen no suitable command definition exists
error::Logicwhen the instance is already dispatched
Note
this function automatically falls back on a global Command definition, in case the given ID is not known as a local command instance. This allows to use the SessionCommand service without explicit instantiation

Definition at line 86 of file session-command-service.cpp.

References Command::bindArg(), CommandInstanceManager::getInstance(), and SessionCommandService::instanceManager_.

+ Here is the call graph for this function:

◆ invoke()

void invoke ( Symbol  cmdID)
overridevirtual
Parameters
cmdIDeither the instanceID or the global cmdID
Exceptions
error::Invalidwhen no suitable command definition exists
error::Statewhen the command's arguments are not bound
error::Logicwhen the instance is already dispatched
Note
similar to bindArg, this function falls back on a global Command definition, in case the given ID is not known locally.

Implements SessionCommand.

Definition at line 102 of file session-command-service.cpp.

References CommandInstanceManager::dispatch(), and SessionCommandService::instanceManager_.

+ Here is the call graph for this function:

Member Data Documentation

◆ dispatcher_

CommandDispatch& dispatcher_
private

Definition at line 74 of file session-command-service.hpp.

◆ instanceManager_

◆ serviceInstance_

ServiceInstanceHandle serviceInstance_
private

Definition at line 83 of file session-command-service.hpp.

+ Inheritance diagram for SessionCommandService:
+ Collaboration diagram for SessionCommandService:

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