cisst-saw
Loading...
Searching...
No Matches
mtsCommandWriteReturn Class Reference

#include <mtsCommandWriteReturn.h>

Inheritance diagram for mtsCommandWriteReturn:
mtsCommandBase mtsCommandQueuedWriteReturnBase< mtsCommandWriteReturn >

Public Types

typedef mtsCommandBase BaseType
typedef mtsCommandWriteReturn ThisType
typedef mtsCallableWriteReturnBase CallableType

Public Member Functions

 mtsCommandWriteReturn (void)
 mtsCommandWriteReturn (const std::string &name)
 mtsCommandWriteReturn (mtsCallableWriteReturnBase *callable, const std::string &name, const mtsGenericObject *argumentPrototype, const mtsGenericObject *resultPrototype)
virtual ~mtsCommandWriteReturn ()
virtual mtsExecutionResult Execute (const mtsGenericObject &argument, mtsGenericObject &result)
virtual mtsExecutionResult Execute (const mtsGenericObject &argument, mtsGenericObject &result, mtsCommandWriteBase *CMN_UNUSED(finishedEventHandler))
mtsCallableWriteReturnBaseGetCallable (void) const
size_t NumberOfArguments (void) const
bool Returns (void) const
const mtsGenericObjectGetArgumentPrototype (void) const
const mtsGenericObjectGetResultPrototype (void) const
void ToStream (std::ostream &outputStream) 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 Member Functions

void SetResultPrototype (const mtsGenericObject *resultPrototype)

Protected Attributes

mtsCallableWriteReturnBaseCallable
const mtsGenericObjectArgumentPrototype
const mtsGenericObjectResultPrototype
Protected Attributes inherited from mtsCommandBase
std::string Name
bool EnableFlag

Detailed Description

A templated version of command object with zero arguments for execute. The template argument is the class type whose method is contained in the command object. This command is based on a void method, i.e. it requires the class and method name as well as an instantiation of the class to get and actual pointer on the method.

Member Typedef Documentation

◆ BaseType

◆ CallableType

◆ ThisType

Constructor & Destructor Documentation

◆ mtsCommandWriteReturn() [1/3]

mtsCommandWriteReturn::mtsCommandWriteReturn ( void )

The constructor. Does nothing.

◆ mtsCommandWriteReturn() [2/3]

mtsCommandWriteReturn::mtsCommandWriteReturn ( const std::string & name)

◆ mtsCommandWriteReturn() [3/3]

mtsCommandWriteReturn::mtsCommandWriteReturn ( mtsCallableWriteReturnBase * callable,
const std::string & name,
const mtsGenericObject * argumentPrototype,
const mtsGenericObject * resultPrototype )

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.

◆ ~mtsCommandWriteReturn()

virtual mtsCommandWriteReturn::~mtsCommandWriteReturn ( )
virtual

The destructor. Does nothing

Member Function Documentation

◆ Execute() [1/2]

virtual mtsExecutionResult mtsCommandWriteReturn::Execute ( const mtsGenericObject & argument,
mtsGenericObject & result )
virtual

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

Reimplemented in mtsCommandQueuedWriteReturnBase< mtsCommandWriteReturn >.

◆ Execute() [2/2]

virtual mtsExecutionResult mtsCommandWriteReturn::Execute ( const mtsGenericObject & argument,
mtsGenericObject & result,
mtsCommandWriteBase * CMN_UNUSEDfinishedEventHandler )
inlinevirtual

Execute method that includes a pointer to a handler for the finished event. This is intended for derived classes (e.g., mtsCommandQueuedWriteReturn).

◆ GetArgumentPrototype()

const mtsGenericObject * mtsCommandWriteReturn::GetArgumentPrototype ( void ) const

Return a pointer on the argument prototype

◆ GetCallable()

mtsCallableWriteReturnBase * mtsCommandWriteReturn::GetCallable ( void ) const

Get a direct pointer to the callable object. This method is used for queued commands. The caller should still use the Execute method which will queue the command. When the command is de-queued, one needs access to the callable object to call the final method or function.

◆ GetResultPrototype()

const mtsGenericObject * mtsCommandWriteReturn::GetResultPrototype ( void ) const

Return a pointer on the result prototype

◆ NumberOfArguments()

size_t mtsCommandWriteReturn::NumberOfArguments ( void ) const
virtual

Returns number of arguments (parameters) expected by Execute method. Must be overloaded in derived classes.

Implements mtsCommandBase.

◆ Returns()

bool mtsCommandWriteReturn::Returns ( void ) const
virtual

Implements mtsCommandBase.

◆ SetResultPrototype()

void mtsCommandWriteReturn::SetResultPrototype ( const mtsGenericObject * resultPrototype)
protected

◆ ToStream()

void mtsCommandWriteReturn::ToStream ( std::ostream & outputStream) const
virtual

Implements mtsCommandBase.

Member Data Documentation

◆ ArgumentPrototype

const mtsGenericObject* mtsCommandWriteReturn::ArgumentPrototype
protected

◆ Callable

mtsCallableWriteReturnBase* mtsCommandWriteReturn::Callable
protected

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

◆ ResultPrototype

const mtsGenericObject* mtsCommandWriteReturn::ResultPrototype
protected

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