C++ API Library Reference  4.3.2-74-ge1d4cca
Public Functions | List of all members
ICommandManager Class Referenceabstract

The ICommandManager interface provides methods to manage commands handlers on the I/O and UI threads, and to configure command filters. Instance members are thread-safe.

Public Functions

virtual void InjectCommand (Guid sessionId, String command, Typeless &parameters)=0
 
virtual void SetCommandFilter (CountedPtr< Util::ICommandFilter > const &pFilter)=0
 
Constructors and Destructors
virtual ~ICommandManager ()
 
Core Functions (most frequently used)
virtual CountedPtr< Util::ICommandFilterCommandFilter () const =0
 
virtual void AddIoHandler (String const &name, CommandHandler const &handler)=0
 
virtual void RemoveIoHandler (String const &name)=0
 
virtual void AddUiHandler (String const &name, CommandHandler const &handler)=0
 
virtual void RemoveUiHandler (String const &name)=0
 

Usage Description

virtual void AddIoHandler ( String const &  name,
CommandHandler const &  handler 
)
pure virtual

Registers a handler with StateManager for the specified command name. The handler will be executed on the I/O thread.

Note
You can only have one handler for any given command. If you register two separate handlers for the same command, only the last one will be stored.

Parameters
nameThe name of the command that will fire the handler. The name that you use here when registering the handler will act as the command ID. This is the name that must be used in the client-side code when sending the command.
handlerThe handler function that will be executed when the command is received.

Implemented in CommandManager.

virtual void AddUiHandler ( String const &  name,
CommandHandler const &  handler 
)
pure virtual

Registers a handler with StateManager for the specified command name. The handler will be executed on the UI thread.

Note
You can only have one handler for any given command. If you register two separate handlers for the same command, only the last one will be stored.

Parameters
nameThe name of the command that will fire the handler. The name that you use here when registering the handler will act as the command ID. This is the name that must be used in the client-side code when sending the command.
handlerThe handler function that will be executed when the command is received.

Implemented in CommandManager.

virtual CountedPtr<Util::ICommandFilter> CommandFilter ( ) const
pure virtual

Returns the command filter class currently used by the service; defaults to DefaultCommandFilter.

Implemented in CommandManager.

virtual void InjectCommand ( Guid  sessionId,
String  command,
Typeless &  parameters 
)
pure virtual

Simulates a command from a client. This method is typically used for testing purposes.

Parameters
sessionIdThe unique identifier of the session to which the command applies.
commandThe name of the command, as registered with StateManager.
parametersThe parameters that the client would have included in the command.

Implemented in CommandManager.

virtual void RemoveIoHandler ( String const &  name)
pure virtual

Removes the handler for the specified command name from the I/O thread.

Parameters
nameThe name of the command for which the handler should be removed. This must be the same name as was used when the handler was first added using AddIoHandler.

Implemented in CommandManager.

virtual void RemoveUiHandler ( String const &  name)
pure virtual

Removes the handler for the specified command name from the UI thread.

Parameters
nameThe name of the command for which the handler should be removed. This must be the same name as was used when the handler was first added using AddUiHandler.

Implemented in CommandManager.

virtual void SetCommandFilter ( CountedPtr< Util::ICommandFilter > const &  pFilter)
pure virtual

Sets the service-side command filter class. For an example of such a class, see DefaultCommandFilter.

Parameters
pFilterThe name of the class to be used for filtering the commands automatically sent by PureWeb for input events.

Implemented in CommandManager.