cisst-saw
Loading...
Searching...
No Matches
mtsCommandWrite< _classType, _argumentType > Class Template Reference

#include <mtsCommandWrite.h>

Inheritance diagram for mtsCommandWrite< _classType, _argumentType >:
mtsCommandWriteBase mtsCommandBase

Classes

class  ConditionalCast
class  ConditionalCast< true, dummy >

Public Types

typedef _argumentType ArgumentType
typedef mtsCommandWriteBase BaseType
typedef _classType ClassType
typedef mtsCommandWrite< ClassType, ArgumentTypeThisType
typedef void(_classType::*) ActionType(const ArgumentType &)
Public Types inherited from mtsCommandWriteBase
typedef mtsCommandBase BaseType

Public Member Functions

 mtsCommandWrite (ActionType action, ClassType *classInstantiation, const std::string &name, const ArgumentType &argumentPrototype)
virtual ~mtsCommandWrite ()
mtsExecutionResult Execute (const mtsGenericObject &argument, mtsBlockingType CMN_UNUSED(blocking))
mtsExecutionResult Execute (const ArgumentType &argument, mtsBlockingType CMN_UNUSED(blocking))
mtsExecutionResult Execute (const mtsGenericObject &argument, mtsBlockingType blocking, mtsCommandWriteBase *CMN_UNUSED(finishedEventHandler))
virtual void ToStream (std::ostream &outputStream) const
Public Member Functions inherited from mtsCommandWriteBase
 mtsCommandWriteBase (void)
 mtsCommandWriteBase (const std::string &name)
virtual ~mtsCommandWriteBase ()
virtual mtsExecutionResult Execute (const mtsGenericObject &argument, mtsBlockingType blocking)=0
size_t NumberOfArguments (void) const
bool Returns (void) const
virtual const mtsGenericObjectGetArgumentPrototype (void) const
const cmnClassServicesBaseGetArgumentClassServices (void) const
Public Member Functions inherited from mtsCommandBase
 mtsCommandBase (void)
 mtsCommandBase (const std::string &name)
virtual ~mtsCommandBase ()
virtual std::string ToString (void) const
void Enable (void)
void Disable (void)
bool IsEnabled (void) const
bool IsDisabled (void) const
const std::string & GetName (void) const

Protected Attributes

ActionType Action
ClassTypeClassInstantiation
Protected Attributes inherited from mtsCommandWriteBase
const mtsGenericObjectArgumentPrototype
Protected Attributes inherited from mtsCommandBase
std::string Name
bool EnableFlag

Additional Inherited Members

Protected Member Functions inherited from mtsCommandWriteBase
virtual void SetArgumentPrototype (const mtsGenericObject *argumentPrototype)

Detailed Description

template<class _classType, class _argumentType>
class mtsCommandWrite< _classType, _argumentType >

A templated version of command object with one argument for execute. The template argument is the interface type whose method is contained in the command object.

Member Typedef Documentation

◆ ActionType

template<class _classType, class _argumentType>
typedef void(_classType::*) mtsCommandWrite< _classType, _argumentType >::ActionType(const ArgumentType &)

Typedef for pointer to member function of the specific interface class.

◆ ArgumentType

template<class _classType, class _argumentType>
typedef _argumentType mtsCommandWrite< _classType, _argumentType >::ArgumentType

◆ BaseType

template<class _classType, class _argumentType>
typedef mtsCommandWriteBase mtsCommandWrite< _classType, _argumentType >::BaseType

◆ ClassType

template<class _classType, class _argumentType>
typedef _classType mtsCommandWrite< _classType, _argumentType >::ClassType

Typedef for the specific interface.

◆ ThisType

template<class _classType, class _argumentType>
typedef mtsCommandWrite<ClassType, ArgumentType> mtsCommandWrite< _classType, _argumentType >::ThisType

This type.

Constructor & Destructor Documentation

◆ mtsCommandWrite()

template<class _classType, class _argumentType>
mtsCommandWrite< _classType, _argumentType >::mtsCommandWrite ( ActionType action,
ClassType * classInstantiation,
const std::string & name,
const ArgumentType & argumentPrototype )
inline

The constructor.

Parameters
actionPointer to the member function that is to be called by the invoker of the command
classInstantiationPointer to the receiver of the command
nameA string to identify the command.

◆ ~mtsCommandWrite()

template<class _classType, class _argumentType>
virtual mtsCommandWrite< _classType, _argumentType >::~mtsCommandWrite ( )
inlinevirtual

The destructor. Does nothing

Member Function Documentation

◆ Execute() [1/3]

template<class _classType, class _argumentType>
mtsExecutionResult mtsCommandWrite< _classType, _argumentType >::Execute ( const ArgumentType & argument,
mtsBlockingType CMN_UNUSEDblocking )
inline

Direct execute can be used for mtsMulticastCommandWrite

◆ Execute() [2/3]

template<class _classType, class _argumentType>
mtsExecutionResult mtsCommandWrite< _classType, _argumentType >::Execute ( const mtsGenericObject & argument,
mtsBlockingType blocking,
mtsCommandWriteBase * CMN_UNUSEDfinishedEventHandler )
inlinevirtual

The execute method. Method may be implemented by derived classes to run the actual operation on the receiver

Parameters
argumentThe data passed to the operation method
blockingIndicates whether caller wishes to block until command finishes
finishedEventHandlerCommand object to invoke when blocking command is finished
Returns
the execution result (mtsExecutionResult)

Implements mtsCommandWriteBase.

◆ Execute() [3/3]

template<class _classType, class _argumentType>
mtsExecutionResult mtsCommandWrite< _classType, _argumentType >::Execute ( const mtsGenericObject & argument,
mtsBlockingType CMN_UNUSEDblocking )
inline

The execute method. Calling the execute method from the invoker applies the operation on the receiver.

Parameters
objThe data passed to the operation method

◆ ToStream()

template<class _classType, class _argumentType>
virtual void mtsCommandWrite< _classType, _argumentType >::ToStream ( std::ostream & outputStream) const
inlinevirtual

Implements mtsCommandBase.

Member Data Documentation

◆ Action

template<class _classType, class _argumentType>
ActionType mtsCommandWrite< _classType, _argumentType >::Action
protected

The pointer to member function of the receiver class that is to be invoked for a particular instance of the command

◆ ClassInstantiation

template<class _classType, class _argumentType>
ClassType* mtsCommandWrite< _classType, _argumentType >::ClassInstantiation
protected

Stores the receiver object of the command


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