Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
SessionCommand Class Referenceabstract

#include "include/session-command-facade.h"

Description

Global access point to invoke commands and cause edit operations within the Session.

Any changes to the session are effected by prepared functors bound into a steam::control::Command registration. A command instance will first be outfitted with suitable parameters to define the target and to qualify and elaborate the action, before it can be actually triggered. Commands then go through a queue to be invoked one by one.

The service exposed through this facade offers dedicated support for the standard command cycle, as is typically performed from the UI. Such a usage cycle starts with "opening" a local anonymous clone copy from the global command definition, which is then used in further calls to be outfitted with actual arguments and finally to be handed over to the dispatcher for execution.

Warning
this standard command cycle is intended for single-threaded use from the UI. It is not threadsafe. To the contrary, all operations with globally registered commands are threadsafe.
Remarks
This is a layer separation facade interface. Clients should use the embedded facade factory, which yields a proxy to route any calls through the lumieraorg_SessionCommand interface
Exceptions
lumiera::error::Statewhen interface is not opened
Todo:
as of 2/2021 only the trigger operation is used; if no case for an elaborated command cycle with binding step and deferred invocation shows up, we may consider dropping the other operations
See also
Command system
SessionCommandFunction_test

Definition at line 87 of file session-command-facade.h.

Static Public Attributes

static lib::Depend< SessionCommandfacade
 static storage for the facade access front-end
 

Public Member Functions

virtual Symbol cycle (Symbol cmdID, string const &invocationID)=0
 start next command cycle and "open" a new anonymous command instance
 
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
 
virtual void invoke (Symbol cmdID)=0
 trigger invocation of a prepared command
 

Friends

class lib::DependencyFactory< SessionCommand >
 

Protected Member Functions

virtual ~SessionCommand ()
 this is an interface
 

Constructor & Destructor Documentation

◆ ~SessionCommand()

virtual ~SessionCommand ( )
inlineprotectedvirtual

this is an interface

Definition at line 106 of file session-command-facade.h.

Member Function Documentation

◆ cycle()

virtual Symbol cycle ( Symbol  cmdID,
string const invocationID 
)
pure virtual

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

Implemented in SessionCommandService.

◆ trigger()

virtual void trigger ( Symbol  cmdID,
lib::diff::Rec const args 
)
pure virtual

bind the command's arguments and trigger command invocation immediately

◆ bindArg()

virtual void bindArg ( Symbol  cmdID,
lib::diff::Rec const args 
)
pure virtual

prepare command invocation: bind the command's arguments

◆ invoke()

virtual void invoke ( Symbol  cmdID)
pure virtual

trigger invocation of a prepared command

Implemented in SessionCommandService.

Member Data Documentation

◆ facade

Friends And Related Symbol Documentation

◆ lib::DependencyFactory< SessionCommand >

+ Inheritance diagram for SessionCommand:
+ Collaboration diagram for SessionCommand:

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