Lumiera  0.pre.03
»edit your freedom«
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 79 of file session-command-service.hpp.

Public Member Functions

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

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 (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ SessionCommandService()

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

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

References LUMIERA_INTERFACE_REF.

Member Function Documentation

◆ 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 77 of file session-command-service.cpp.

◆ 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 95 of file session-command-service.cpp.

◆ 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 111 of file session-command-service.cpp.

References CommandInstanceManager::dispatch().

+ Here is the call graph for this function:
+ Inheritance diagram for SessionCommandService:
+ Collaboration diagram for SessionCommandService:

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