cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
mtsComponent Class Reference

#include <mtsComponent.h>

Inheritance diagram for mtsComponent:
cmnGenericObject mtsATINetFTQtWidget mtsCANBus mtsCMUSphinx4QtComponent mtsCollectorQtComponent mtsComponentWithManagement mtsIntuitiveDaVinciArmQtWidget mtsIntuitiveResearchKitArmQtWidget mtsIntuitiveResearchKitConsoleQtWidget mtsJR3ForceSensor mtsLoPoMoCo mtsMicronTrackerControllerQtComponent mtsMicronTrackerToolQtComponent mtsNDISerialControllerQtComponent mtsNDISerialToolQtComponent mtsOpenALPlayQtComponent mtsOpenALRecordQtComponent mtsOSGBody mtsOSGBodyUI mtsOSGPointer3D mtsPIDQtWidget mtsPuck mtsQtWidgetComponent mtsRobotIO1394QtWidget mtsRobotIO1394QtWidgetFactory mtsTask mtsTeleOperationQtWidget prmQtWidgetEventButtonsComponent sawNoteRecorderQtComponent svlFilterBase svlQtWidgetVidCapSrcImageProperties svlQtWidgetVideoEncoder svlStreamManager svlVideoCodecBase

Public Types

typedef mtsComponent ThisType
 

Public Member Functions

 mtsComponent (const std::string &deviceName)
 
virtual ~mtsComponent ()
 
const std::string & GetName (void) const
 
void GetName (std::string &placeHolder) const
 
void SetName (const std::string &componentName)
 
virtual void Configure (const std::string &filename="")
 
virtual void Create (void)
 
bool CreateAndWait (double timeoutInSeconds)
 
virtual void Start (void)
 
bool StartAndWait (double timeoutInSeconds)
 
virtual void Suspend (void)
 
virtual void Kill (void)
 
bool KillAndWait (double timeoutInSeconds)
 
virtual void Startup (void)
 
virtual void Cleanup (void)
 
mtsInterfaceProvidedAddInterfaceProvided (const std::string &interfaceProvidedName, mtsInterfaceQueueingPolicy queueingPolicy=MTS_COMPONENT_POLICY)
 
virtual mtsInterfaceProvidedAddInterfaceProvidedWithoutSystemEvents (const std::string &interfaceProvidedName, mtsInterfaceQueueingPolicy queueingPolicy=MTS_COMPONENT_POLICY, bool isProxy=false)
 
CISST_DEPRECATED
mtsInterfaceProvided
AddProvidedInterface (const std::string &interfaceProvidedName)
 
virtual mtsInterfaceOutputAddInterfaceOutput (const std::string &interfaceOutputName)
 
bool InterfaceExists (const std::string &interfaceName, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_VERBOSE) const
 
bool InterfaceProvidedOrOutputExists (const std::string &interfaceName, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_VERBOSE) const
 
bool InterfaceRequiredOrInputExists (const std::string &interfaceName, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_VERBOSE) const
 
mtsInterfaceProvidedGetInterfaceProvided (const std::string &interfaceProvidedName) const
 
mtsInterfaceOutputGetInterfaceOutput (const std::string &interfaceOutputName) const
 
size_t GetNumberOfInterfacesProvided (void) const
 
size_t GetNumberOfInterfacesOutput (void) const
 
bool RemoveInterfaceProvided (const std::string &interfaceProvidedName, const bool skipDisconnect=false)
 
mtsInterfaceRequiredAddInterfaceRequired (const std::string &interfaceRequiredName, mtsRequiredType isRequired=MTS_REQUIRED)
 
virtual mtsInterfaceRequiredAddInterfaceRequiredWithoutSystemEventHandlers (const std::string &interfaceRequiredName, mtsRequiredType isRequired=MTS_REQUIRED)
 
CISST_DEPRECATED
mtsInterfaceRequired
AddRequiredInterface (const std::string &requiredInterfaceName)
 
virtual mtsInterfaceInputAddInterfaceInput (const std::string &interfaceInputName)
 
const mtsInterfaceProvidedGetInterfaceProvidedFor (const std::string &interfaceRequiredName)
 
mtsInterfaceRequiredGetInterfaceRequired (const std::string &interfaceRequiredName)
 
mtsInterfaceInputGetInterfaceInput (const std::string &interfaceInputName) const
 
size_t GetNumberOfInterfacesRequired (void) const
 
size_t GetNumberOfInterfacesInput (void) const
 
bool RemoveInterfaceRequired (const std::string &interfaceRequiredName, const bool skipDisconnect=false)
 
const mtsManagerComponentServicesGetManagerComponentServices (void) const
 
mtsManagerComponentServicesGetManagerComponentServices (void)
 
mtsStateTableGetStateTable (const std::string &stateTableName)
 
bool AddStateTable (mtsStateTable *existingStateTable, bool addInterfaceProvided=true)
 
void UseSeparateLogFileDefault (bool forwardToLogger=true)
 
void UseSeparateLogFileDefaultWithDate (bool forwardToLogger=true)
 
void UseSeparateLogFile (const std::string &filename, bool forwardToLogger=true)
 
cmnLogger::StreamBufTypeGetLogMultiplexer (void) const
 
bool IsRunning (void) const
 
bool CISST_DEPRECATED Running (void) const
 
bool IsStarted (void) const
 
bool IsTerminated (void) const
 
bool IsEndTask (void) const
 
const mtsComponentStateGetState (void) const
 
void GetState (mtsComponentState &state) const
 
void ToStream (std::ostream &outputStream) const
 
bool SetReplayMode (void)
 
bool SetReplayData (const std::string &stateTableName, const std::string &fileName)
 
bool SetReplayTime (const double time)
 
std::vector< std::string > GetNamesOfInterfacesProvidedOrOutput (void) const
 
std::vector< std::string > GetNamesOfInterfacesProvided (void) const
 
std::vector< std::string > GetNamesOfInterfacesOutput (void) const
 
std::vector< std::string > GetNamesOfInterfacesRequiredOrInput (void) const
 
std::vector< std::string > GetNamesOfInterfacesRequired (void) const
 
std::vector< std::string > GetNamesOfInterfacesInput (void) const
 
- Public Member Functions inherited from cmnGenericObject
virtual ~cmnGenericObject (void)
 
virtual const
cmnClassServicesBase
Services (void) const =0
 
bool ReconstructFrom (const cmnGenericObject &other)
 
std::string ToString (void) const
 
virtual void ToStreamRaw (std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
 
virtual bool FromStreamRaw (std::istream &inputStream, const char delimiter= ' ')
 
virtual void SerializeRaw (std::ostream &outputStream) const
 
virtual void DeSerializeRaw (std::istream &inputStream)
 
virtual size_t ScalarNumber (void) const
 
virtual bool ScalarNumberIsFixed (void) const
 
virtual double Scalar (const size_t CMN_UNUSED(index)) const throw (std::out_of_range)
 
virtual std::string ScalarDescription (const size_t CMN_UNUSED(index), const std::string &CMN_UNUSED(userDescription)) const
 

Protected Types

typedef cmnNamedMap
< mtsStateTable
StateTableMapType
 

Protected Member Functions

 mtsComponent (void)
 
 mtsComponent (const mtsComponent &other)
 
void Initialize (void)
 
mtsInterfaceRequiredAddInterfaceRequiredExisting (const std::string &interfaceRequiredName, mtsInterfaceRequired *interfaceRequired)
 
mtsInterfaceRequiredAddInterfaceRequiredUsingMailbox (const std::string &interfaceRequiredName, mtsMailBox *mailBox, mtsRequiredType required)
 
mtsInterfaceProvidedAddInterfaceProvidedUsingMailbox (const std::string &interfaceProvidedName, mtsMailBox *mailBox)
 
mtsInterfaceInputAddInterfaceInputExisting (const std::string &interfaceInputName, mtsInterfaceInput *interfaceInput)
 
mtsInterfaceOutputAddInterfaceOutputExisting (const std::string &interfaceOutputName, mtsInterfaceOutput *interfaceOutput)
 
void KillSeparateLogFile (void)
 
virtual bool WaitForState (mtsComponentState desiredState, double timeout)
 
size_t ProcessMailBoxes (InterfacesProvidedMapType &interfaces)
 
size_t ProcessQueuedCommands (void)
 
size_t ProcessQueuedEvents (void)
 
mtsInterfaceRequiredEnableDynamicComponentManagement (void)
 Enable support for dynamic component management services. More...
 
bool AddInterfaceInternal (const bool useMangerComponentServices=false)
 Add internal interfaces. More...
 
void InterfaceInternalCommands_GetEndUserInterface (const mtsEndUserInterfaceArg &argin, mtsEndUserInterfaceArg &argout)
 
void InterfaceInternalCommands_AddObserverList (const mtsEventHandlerList &argin, mtsEventHandlerList &argout)
 
void InterfaceInternalCommands_RemoveEndUserInterface (const mtsEndUserInterfaceArg &argin, mtsEndUserInterfaceArg &argout)
 
void InterfaceInternalCommands_RemoveObserverList (const mtsEventHandlerList &argin, mtsEventHandlerList &argout)
 
void InterfaceInternalCommands_ComponentCreate (const mtsDescriptionComponent &componentDescription, bool &result)
 
void InterfaceInternalCommands_ComponentStartOther (const mtsComponentStatusControl &arg)
 

Protected Attributes

std::string Name
 
mtsComponentState State
 
mtsInterfaceProvidedInterfaceProvidedToManager
 
bool UseSeparateLogFileFlag
 
cmnLogger::StreamBufTypeLoDMultiplexerStreambuf
 
std::ofstream * LogFile
 
StateTableMapType StateTables
 
mtsManagerComponentServicesManagerComponentServices
 
mtsFunctionWrite EventGeneratorChangeState
 
bool ReplayMode
 

Friends

class mtsManagerLocal
 
class mtsComponentProxy
 
typedef cmnNamedMap
< mtsInterfaceProvided
InterfacesProvidedMapType
 
typedef cmnNamedMap
< mtsInterfaceOutput
InterfacesOutputMapType
 
InterfacesProvidedMapType InterfacesProvided
 
InterfacesOutputMapType InterfacesOutput
 
typedef cmnNamedMap
< mtsInterfaceRequired
InterfacesRequiredMapType
 
typedef cmnNamedMap
< mtsInterfaceInput
InterfacesInputMapType
 
InterfacesRequiredMapType InterfacesRequired
 
InterfacesInputMapType InterfacesInput
 

Detailed Description

mtsComponent should be used to write wrappers around existing devices or resources. This class allows to interact with existing devices as one would interact with a task (as in mtsTask and mtsTaskPeriodic). To do so, the component maintains a list of provided interfaces (of type mtsInterfaceProvided) which contains commands.

The main differences are that the base component class doesn't have a thread and is stateless. Since the component doesn't have any thread, the commands are not queued and the class doesn't add any thread safety mechanism. The component class doesn't maintain a state as it relies on the underlying device to do so. It is basically a pass-thru or wrapper.

Member Typedef Documentation

Map of provided and output interfaces. Used to store pointers on all provided interfaces. Separate lists of provided and output interfaces are maintained for efficiency.

Map of required interfaces. Used to store pointers on all required interfaces. Separate lists of required and input interfaces are maintained for efficiency.

Map of state tables, includes the default StateTable under the name "StateTable"

Constructor & Destructor Documentation

mtsComponent::mtsComponent ( void  )
protected

Default constructor. Protected to prevent creation of a component without a name.

mtsComponent::mtsComponent ( const mtsComponent other)
protected

Default copy constructor. Protected to prevent copy as it is not supported yet. It is not clear why one would use a copy constructor on a component anyway.

mtsComponent::mtsComponent ( const std::string &  deviceName)

Default constructor. Sets the name.

virtual mtsComponent::~mtsComponent ( )
virtual

Default destructor. Does nothing.

Member Function Documentation

virtual mtsInterfaceInput* mtsComponent::AddInterfaceInput ( const std::string &  interfaceInputName)
virtual

Add an input interface.

mtsInterfaceInput* mtsComponent::AddInterfaceInputExisting ( const std::string &  interfaceInputName,
mtsInterfaceInput interfaceInput 
)
protected
bool mtsComponent::AddInterfaceInternal ( const bool  useMangerComponentServices = false)
protected

Add internal interfaces.

Parameters
useMangerComponentServicesTrue to allow this component to use dynamic component control services through mts command pattern to control other components. If true, the internal required interface is added to this component (the internal provided interface is added by default)
virtual mtsInterfaceOutput* mtsComponent::AddInterfaceOutput ( const std::string &  interfaceOutputName)
virtual

Method to add an output interface to the component.

mtsInterfaceOutput* mtsComponent::AddInterfaceOutputExisting ( const std::string &  interfaceOutputName,
mtsInterfaceOutput interfaceOutput 
)
protected
mtsInterfaceProvided* mtsComponent::AddInterfaceProvided ( const std::string &  interfaceProvidedName,
mtsInterfaceQueueingPolicy  queueingPolicy = MTS_COMPONENT_POLICY 
)

Method to add a provided interface to the component.

mtsInterfaceProvided* mtsComponent::AddInterfaceProvidedUsingMailbox ( const std::string &  interfaceProvidedName,
mtsMailBox mailBox 
)
protected

Create and add a provided interface with an existing mailbox. If the creation or addition failed (name already exists), the caller must make sure he/she deletes the unused mailbox.

virtual mtsInterfaceProvided* mtsComponent::AddInterfaceProvidedWithoutSystemEvents ( const std::string &  interfaceProvidedName,
mtsInterfaceQueueingPolicy  queueingPolicy = MTS_COMPONENT_POLICY,
bool  isProxy = false 
)
virtual

Method to add a bare provided interface, i.e. without all the system events. This method should not be used by regular users as it might break things like blocking commands.

This method is virtual so that mtsTask can redefine it and create a provided interface that includes queues for thread safety.

Reimplemented in mtsTask, and mtsTaskFromSignal.

mtsInterfaceRequired* mtsComponent::AddInterfaceRequired ( const std::string &  interfaceRequiredName,
mtsRequiredType  isRequired = MTS_REQUIRED 
)

Remove an output interface identified by its name

Add a required interface. This interface will later on be connected to another task and use the provided interface of the other task. The required interface created also contains a list of event handlers to be used as observers.

mtsInterfaceRequired* mtsComponent::AddInterfaceRequiredExisting ( const std::string &  interfaceRequiredName,
mtsInterfaceRequired interfaceRequired 
)
protected

Add an already existing interface required to the interface, the user must pay attention to mailbox (or lack of) used to create the required interface. By default, mtsComponent uses a required interface without mailbox (i.e. doesn't queue), mtsTask uses an interface with a mailbox and mtsTaskFromSignal uses an interface with a mailbox with a post command queued command.

mtsInterfaceRequired* mtsComponent::AddInterfaceRequiredUsingMailbox ( const std::string &  interfaceRequiredName,
mtsMailBox mailBox,
mtsRequiredType  required 
)
protected

Create and add a required interface with an existing mailbox. If the creation or addition failed (name already exists), the caller must make sure he/she deletes the unused mailbox.

virtual mtsInterfaceRequired* mtsComponent::AddInterfaceRequiredWithoutSystemEventHandlers ( const std::string &  interfaceRequiredName,
mtsRequiredType  isRequired = MTS_REQUIRED 
)
virtual

Reimplemented in mtsTask, and mtsTaskFromSignal.

CISST_DEPRECATED mtsInterfaceProvided* mtsComponent::AddProvidedInterface ( const std::string &  interfaceProvidedName)
inline
CISST_DEPRECATED mtsInterfaceRequired* mtsComponent::AddRequiredInterface ( const std::string &  requiredInterfaceName)
inline
bool mtsComponent::AddStateTable ( mtsStateTable existingStateTable,
bool  addInterfaceProvided = true 
)

Add an existing state table to the list of known state tables in this task. This method will add a provided interface for the state table using the name "StateTable" + existingStateTable->GetName() unless the caller specifies that no interface should be created.

By default, all state tables added will advance at each call of the Run method. To avoid the automatic advance, use the method mtsStateTable::SetAutomaticAdvance(false).

virtual void mtsComponent::Cleanup ( void  )
inlinevirtual
virtual void mtsComponent::Configure ( const std::string &  filename = "")
virtual
virtual void mtsComponent::Create ( void  )
virtual

Virtual method to create the components, e.g. for tasks create the required threads. For other components, place initialization code.

Reimplemented in mtsTask.

bool mtsComponent::CreateAndWait ( double  timeoutInSeconds)

Call the Create method followed by WaitForState

mtsInterfaceRequired* mtsComponent::EnableDynamicComponentManagement ( void  )
protected

Enable support for dynamic component management services.

Returns
Pointer to internal required interface, if success. NULL otherwise.
Note
If user component needs dynamic component management services, this method should be called by user component's constructor
mtsInterfaceInput* mtsComponent::GetInterfaceInput ( const std::string &  interfaceInputName) const

Get an input interface identified by its name

mtsInterfaceOutput* mtsComponent::GetInterfaceOutput ( const std::string &  interfaceOutputName) const

Get an output interface identified by its name

mtsInterfaceProvided* mtsComponent::GetInterfaceProvided ( const std::string &  interfaceProvidedName) const

Get a provided interface identified by its name

const mtsInterfaceProvided* mtsComponent::GetInterfaceProvidedFor ( const std::string &  interfaceRequiredName)

Get a pointer on the provided interface that has been connected to a given required interface (defined by its name). This method will return a null pointer if the required interface has not been connected. See mtsTaskManager::Connect.

mtsInterfaceRequired* mtsComponent::GetInterfaceRequired ( const std::string &  interfaceRequiredName)

Get a required interface identified by its name

cmnLogger::StreamBufType* mtsComponent::GetLogMultiplexer ( void  ) const
virtual

Overload GetLodMultiplexer. This method is used for all class level log (i.e. CMN_LOG_CLASS) and allows to redirect the log to a separate file for each component when activated by UseSeparateLogFile or UseSeparateLogFileDefault.

Reimplemented from cmnGenericObject.

const mtsManagerComponentServices* mtsComponent::GetManagerComponentServices ( void  ) const
inline

Remove an input interface identified by its name

Get pointer to manager component services, which extends the internal required interface to the Manager Component Client (MCC). This is used by the IRE (Python wrapping)

mtsManagerComponentServices* mtsComponent::GetManagerComponentServices ( void  )
inline
const std::string& mtsComponent::GetName ( void  ) const

Returns the name of the component.

void mtsComponent::GetName ( std::string &  placeHolder) const
std::vector<std::string> mtsComponent::GetNamesOfInterfacesInput ( void  ) const
std::vector<std::string> mtsComponent::GetNamesOfInterfacesOutput ( void  ) const
std::vector<std::string> mtsComponent::GetNamesOfInterfacesProvided ( void  ) const
std::vector<std::string> mtsComponent::GetNamesOfInterfacesProvidedOrOutput ( void  ) const

Return the list of provided interfaces. This returns a list of names. To retrieve the actual interface, use GetInterfaceProvided with the provided interface name.

std::vector<std::string> mtsComponent::GetNamesOfInterfacesRequired ( void  ) const
std::vector<std::string> mtsComponent::GetNamesOfInterfacesRequiredOrInput ( void  ) const

Provide a list of existing required interfaces (by names)

size_t mtsComponent::GetNumberOfInterfacesInput ( void  ) const

Get the total number of input interfaces

size_t mtsComponent::GetNumberOfInterfacesOutput ( void  ) const

Get the total number of output interfaces

size_t mtsComponent::GetNumberOfInterfacesProvided ( void  ) const

Get the total number of provided interfaces

size_t mtsComponent::GetNumberOfInterfacesRequired ( void  ) const

Get the total number of required interfaces

const mtsComponentState& mtsComponent::GetState ( void  ) const

Return task state.

void mtsComponent::GetState ( mtsComponentState state) const
mtsStateTable* mtsComponent::GetStateTable ( const std::string &  stateTableName)

Return a pointer to state table with the given name.

void mtsComponent::Initialize ( void  )
protected

Initializer

bool mtsComponent::InterfaceExists ( const std::string &  interfaceName,
cmnLogLevel  lod = CMN_LOG_LEVEL_INIT_VERBOSE 
) const

Check if there is any interface with the given name

void mtsComponent::InterfaceInternalCommands_AddObserverList ( const mtsEventHandlerList argin,
mtsEventHandlerList argout 
)
protected
void mtsComponent::InterfaceInternalCommands_ComponentCreate ( const mtsDescriptionComponent componentDescription,
bool &  result 
)
protected
void mtsComponent::InterfaceInternalCommands_ComponentStartOther ( const mtsComponentStatusControl arg)
protected
void mtsComponent::InterfaceInternalCommands_GetEndUserInterface ( const mtsEndUserInterfaceArg argin,
mtsEndUserInterfaceArg argout 
)
protected

Internal commands to process command execution request coming from LCM (by invoking class methods)

void mtsComponent::InterfaceInternalCommands_RemoveEndUserInterface ( const mtsEndUserInterfaceArg argin,
mtsEndUserInterfaceArg argout 
)
protected
void mtsComponent::InterfaceInternalCommands_RemoveObserverList ( const mtsEventHandlerList argin,
mtsEventHandlerList argout 
)
protected
bool mtsComponent::InterfaceProvidedOrOutputExists ( const std::string &  interfaceName,
cmnLogLevel  lod = CMN_LOG_LEVEL_INIT_VERBOSE 
) const

Check if there is any interface provided or output with the given name

bool mtsComponent::InterfaceRequiredOrInputExists ( const std::string &  interfaceName,
cmnLogLevel  lod = CMN_LOG_LEVEL_INIT_VERBOSE 
) const

Check if there is any interface required or input with the given name

bool mtsComponent::IsEndTask ( void  ) const

Return true if task is marked for killing.

bool mtsComponent::IsRunning ( void  ) const

Return true if task is active.

bool mtsComponent::IsStarted ( void  ) const

Return true if task was started.

bool mtsComponent::IsTerminated ( void  ) const

Return true if task is terminated.

virtual void mtsComponent::Kill ( void  )
virtual

Virtual method to stop the computations and message processing. See Start.

Reimplemented in mtsTask, mtsTaskContinuous, mtsTaskFromCallback, mtsSensableHD, mtsNovintHDL, and mtsTaskFromSignal.

bool mtsComponent::KillAndWait ( double  timeoutInSeconds)

Call the Kill method followed by WaitForState

void mtsComponent::KillSeparateLogFile ( void  )
protected

Kill all separate log, if any. This method should be used in the destructor. Once it has been called, any call to log might crash.

size_t mtsComponent::ProcessMailBoxes ( InterfacesProvidedMapType interfaces)
protected

Process all messages in mailboxes. Returns number of commands processed.

size_t mtsComponent::ProcessQueuedCommands ( void  )
inlineprotected

Process all queued commands. Returns number of events processed. These are the commands provided by all interfaces of the task.

size_t mtsComponent::ProcessQueuedEvents ( void  )
protected

Process all queued events. Returns number of events processed. These are the commands queued following events currently observed via the required interfaces.

bool mtsComponent::RemoveInterfaceProvided ( const std::string &  interfaceProvidedName,
const bool  skipDisconnect = false 
)

Remove a provided interface identified by its name

bool mtsComponent::RemoveInterfaceRequired ( const std::string &  interfaceRequiredName,
const bool  skipDisconnect = false 
)

Remove a required interface identified by its name

bool CISST_DEPRECATED mtsComponent::Running ( void  ) const
inline
void mtsComponent::SetName ( const std::string &  componentName)

Set name. This method is useful to perform dynamic creation using the default constructor and then set the name.

bool mtsComponent::SetReplayData ( const std::string &  stateTableName,
const std::string &  fileName 
)
bool mtsComponent::SetReplayMode ( void  )

Method to set replay mode

bool mtsComponent::SetReplayTime ( const double  time)
virtual void mtsComponent::Start ( void  )
virtual

Virtual method called after components are connected to start the computations and message processing.

Reimplemented in mtsTaskContinuous, mtsSensableHD, mtsTaskFromCallback, mtsNovintHDL, svlStreamManager, and mtsCMUSphinx4QtComponent.

bool mtsComponent::StartAndWait ( double  timeoutInSeconds)

Call the Start method followed by WaitForState

virtual void mtsComponent::Startup ( void  )
inlinevirtual
virtual void mtsComponent::Suspend ( void  )
virtual

Virtual method to suspend the component (same as Stop).

Reimplemented in mtsTaskPeriodic, mtsTaskContinuous, mtsTaskFromCallback, and svlStreamManager.

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

Send a human readable description of the component.

Reimplemented from cmnGenericObject.

void mtsComponent::UseSeparateLogFile ( const std::string &  filename,
bool  forwardToLogger = true 
)

Tells this component to use its own file for log. By default the messages are also sent to cmnLogger but this can be changed setting forwardToLogger to false.

void mtsComponent::UseSeparateLogFileDefault ( bool  forwardToLogger = true)

Tells this component to use its own file for log. By default the messages are also sent to cmnLogger but this can be changed setting forwardToLogger to false. The default file name is based on the component's name, followed by '-log.txt'

void mtsComponent::UseSeparateLogFileDefaultWithDate ( bool  forwardToLogger = true)

Tells this component to use its own file for log. By default the messages are also sent to cmnLogger but this can be changed setting forwardToLogger to false. The default file name is based on the component's name, followed by the date and '-log.txt'

virtual bool mtsComponent::WaitForState ( mtsComponentState  desiredState,
double  timeout 
)
protectedvirtual

Helper function to wait on a state change, with specified timeout in seconds.

Reimplemented in mtsTask.

Friends And Related Function Documentation

friend class mtsComponentProxy
friend
friend class mtsManagerLocal
friend

Member Data Documentation

mtsFunctionWrite mtsComponent::EventGeneratorChangeState
protected

Event generator to inform the manager component client of the state change of this component

mtsInterfaceProvided* mtsComponent::InterfaceProvidedToManager
protected

Provided interface for component management.

InterfacesInputMapType mtsComponent::InterfacesInput
protected
InterfacesOutputMapType mtsComponent::InterfacesOutput
protected
InterfacesProvidedMapType mtsComponent::InterfacesProvided
protected
InterfacesRequiredMapType mtsComponent::InterfacesRequired
protected
cmnLogger::StreamBufType* mtsComponent::LoDMultiplexerStreambuf
protected

Pointers on multiplexer used by this component for logging purposes. By default the file "LogFile" is the only output stream but a user can add any stream using mtsComponent::GetLogMultiplexer combined with cmnLODMultiplexerStreambuf::AddChannel.

std::ofstream* mtsComponent::LogFile
protected

Default log file used for this component logging

mtsManagerComponentServices* mtsComponent::ManagerComponentServices
protected

Dynamic component management service provider

std::string mtsComponent::Name
protected

A string identifying the 'Name' of the component.

bool mtsComponent::ReplayMode
protected
mtsComponentState mtsComponent::State
protected

Component state.

StateTableMapType mtsComponent::StateTables
protected
bool mtsComponent::UseSeparateLogFileFlag
protected

Flag to keep track of separate log file use


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