ERC CISST - cisst software

mtsInterfaceRequired Class Reference
[Multi Task Support]

#include <mtsInterfaceRequired.h>

Inheritance diagram for mtsInterfaceRequired:

Inheritance graph
[legend]
Collaboration diagram for mtsInterfaceRequired:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the required interface for a component (mtsComponent, mtsTask, ...). The required interface gets populated with pointers to command objects, which have four signatures:

Void: no parameters Read: one non-const parameter Write: one const parameter QualifiedRead: one non-const (read) and one const (write) parameter

The required interface may also have command object pointers for the following types of event handlers:

Void: no parameters Write: one const parameter

When the required interface of this component is connected to the provided interface of another component, the command object pointers are "bound" to command objects provided by the other component. Similarly, the event handlers are added as observers of events that are generated by the provided interface of the other component.

This implementation is simpler than the provided interface because we assume that a required interface is never connected to more than one provided interface, whereas a provided interface can be used by multiple required interfaces. While one can conceive of cases where it may be useful to have a required interface connect to multiple provided interfaces (e.g., running a robot simulation in parallel with a real robot), at this time it is not worth the trouble.

Definition at line 82 of file mtsInterfaceRequired.h.

Public Types

Public Member Functions

Protected Types

Protected Member Functions

Protected Attributes

Friends

Classes


Member Typedef Documentation

typedef cmnNamedMap<mtsCommandVoid> mtsInterfaceRequired::EventHandlerVoidMapType [protected]

Typedef for a map of event name and event handler (command object).

Definition at line 256 of file mtsInterfaceRequired.h.


Member Enumeration Documentation

anonymous enum

Default size for queues of events

Definition at line 103 of file mtsInterfaceRequired.h.


Constructor & Destructor Documentation

mtsInterfaceRequired::mtsInterfaceRequired ( void   )  [inline, protected]

Default constructor. Does nothing, should not be used.

Definition at line 98 of file mtsInterfaceRequired.h.

mtsInterfaceRequired::mtsInterfaceRequired ( const std::string &  interfaceName,
mtsMailBox mailBox,
mtsRequiredType  required = MTS_REQUIRED 
)

Constructor. Sets the name, device pointer, and mailbox for queued events.

Parameters:
interfaceName Name of required interface
mbox Mailbox to use for queued events (for tasks); set to 0 for devices (i.e. mtsComponent) while tasks (derived from mtsTask) create a mailbox and then provide the mailbox to the required interface.
isRequired Used to indicate if the component should function even if this interface is not connected to a provided interface.

virtual mtsInterfaceRequired::~mtsInterfaceRequired (  )  [virtual]

Default destructor.


Member Function Documentation

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctions ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctionsVoid ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctionsVoidReturn ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctionsWrite ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctionsWriteReturn ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctionsRead ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfFunctionsQualifiedRead ( void   )  const [virtual]

Get the names of commands required by this interface.

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfEventHandlersVoid ( void   )  const [virtual]

Get the names of event handlers that exist in this interface

virtual std::vector<std::string> mtsInterfaceRequired::GetNamesOfEventHandlersWrite ( void   )  const [virtual]

Get the names of event handlers that exist in this interface

virtual mtsCommandVoid* mtsInterfaceRequired::GetEventHandlerVoid ( const std::string &  eventName  )  const [virtual]

Find an event handler based on its name.

virtual mtsCommandWriteBase* mtsInterfaceRequired::GetEventHandlerWrite ( const std::string &  eventName  )  const [virtual]

Find an event handler based on its name.

size_t mtsInterfaceRequired::ProcessMailBoxes ( void   ) 

Process any queued events.

void mtsInterfaceRequired::ToStream ( std::ostream &  outputStream  )  const [virtual]

Send a human readable description of the interface.

Reimplemented from cmnGenericObject.

bool mtsInterfaceRequired::UseQueueBasedOnInterfacePolicy ( mtsEventQueueingPolicy  queueingPolicy,
const std::string &  methodName,
const std::string &  eventName 
) [protected]

Utility method to determine if an event handler should be queued or not based on the default policy for the interface and the user's requested policy. This method also generates a warning or error in the log if needed.

Referenced by AddEventHandlerWrite(), and AddEventHandlerWriteGeneric().


Member Data Documentation

mtsMailBox* mtsInterfaceRequired::MailBox [protected]

Mailbox (if supported).

Definition at line 95 of file mtsInterfaceRequired.h.

Referenced by AddEventHandlerWrite(), and AddEventHandlerWriteGeneric().

FunctionInfoMapType mtsInterfaceRequired::FunctionsVoid [protected]

Typedef for a map of name of zero argument command and name of command.

Definition at line 229 of file mtsInterfaceRequired.h.

FunctionInfoMapType mtsInterfaceRequired::FunctionsVoidReturn [protected]

Typedef for a map of name of zero argument command and name of command.

Definition at line 232 of file mtsInterfaceRequired.h.

FunctionInfoMapType mtsInterfaceRequired::FunctionsWrite [protected]

Typedef for a map of name of one argument command and name of command.

Definition at line 235 of file mtsInterfaceRequired.h.

FunctionInfoMapType mtsInterfaceRequired::FunctionsWriteReturn [protected]

Typedef for a map of name of one argument command and name of command.

Definition at line 238 of file mtsInterfaceRequired.h.

FunctionInfoMapType mtsInterfaceRequired::FunctionsRead [protected]

Typedef for a map of name of one argument command and name of command.

Definition at line 241 of file mtsInterfaceRequired.h.

FunctionInfoMapType mtsInterfaceRequired::FunctionsQualifiedRead [protected]

Typedef for a map of name of two argument command and name of command.

Definition at line 244 of file mtsInterfaceRequired.h.

EventReceiverVoidMapType mtsInterfaceRequired::EventReceiversVoid [protected]

Typedef for a receiver of void events

Definition at line 250 of file mtsInterfaceRequired.h.

EventReceiverWriteMapType mtsInterfaceRequired::EventReceiversWrite [protected]

Typedef for a receiver of write events

Definition at line 253 of file mtsInterfaceRequired.h.


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu