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

#include <mtsComponent.h>

Inheritance diagram for mtsComponent:
cmnGenericObject constraintControllerLite mtsCollectorFactoryQtWidget mtsComponentWithManagement mtsIntervalStatisticsQtWidgetComponent mtsMessageQtWidgetComponent mtsQtWidgetComponent mtsSystemQtWidgetComponent mtsTask prmEventButtonQtWidgetComponent prmForceCartesianGetQtWidgetComponent prmInputDataQtWidgetComponent prmPositionCartesianArrayGetQtWidget prmPositionCartesianGetQtWidgetFactory prmStateRobotQtWidgetComponent

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 AddTag (const std::string &tag)
const std::set< std::string > & GetTags (void) 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)
CISST_DEPRECATED mtsInterfaceProvidedAddProvidedInterface (const std::string &interfaceProvidedName)
virtual mtsInterfaceOutputAddInterfaceOutput (const std::string &interfaceOutputName)
std::vector< std::string > GetNamesOfInterfacesProvidedOrOutput (void) const
std::vector< std::string > GetNamesOfInterfacesProvided (void) const
std::vector< std::string > GetNamesOfInterfacesOutput (void) const
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)
mtsInterfaceRequiredAddInterfaceRequired (const std::string &interfaceRequiredName, mtsRequiredType isRequired=MTS_REQUIRED)
virtual mtsInterfaceRequiredAddInterfaceRequiredWithoutSystemEventHandlers (const std::string &interfaceRequiredName, mtsRequiredType isRequired=MTS_REQUIRED)
CISST_DEPRECATED mtsInterfaceRequiredAddRequiredInterface (const std::string &requiredInterfaceName)
virtual mtsInterfaceInputAddInterfaceInput (const std::string &interfaceInputName)
std::vector< std::string > GetNamesOfInterfacesRequiredOrInput (void) const
std::vector< std::string > GetNamesOfInterfacesRequired (void) const
std::vector< std::string > GetNamesOfInterfacesInput (void) const
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)
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 override
bool AreAllInterfacesRequiredConnected (const bool log=false)
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
virtual bool WaitForState (mtsComponentState desiredState, double timeout)
void ToStream (std::ostream &outputStream) const override
bool SetReplayMode (void)
bool SetReplayData (const std::string &stateTableName, const std::string &fileName)
bool SetReplayTime (const double time)
Public Member Functions inherited from cmnGenericObject
virtual ~cmnGenericObject (void)
virtual const cmnClassServicesBaseServices (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 CISST_THROW(std
virtual std::string ScalarDescription (const size_t CMN_UNUSED(index), const std::string &CMN_UNUSED(userDescription)) const

Protected Types

typedef cmnNamedMap< mtsInterfaceProvidedInterfacesProvidedMapType
typedef cmnNamedMap< mtsInterfaceOutputInterfacesOutputMapType
typedef cmnNamedMap< mtsInterfaceRequiredInterfacesRequiredMapType
typedef cmnNamedMap< mtsInterfaceInputInterfacesInputMapType
typedef cmnNamedMap< mtsStateTableStateTableMapType

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)
size_t ProcessMailBoxes (InterfacesProvidedMapType &interfaces)
size_t ProcessQueuedCommands (void)
size_t ProcessQueuedEvents (void)
mtsInterfaceRequiredEnableDynamicComponentManagement (void)
 Enable support for dynamic component management services.
bool AddInterfaceInternal (const bool useMangerComponentServices=false)
 Add internal interfaces.
virtual const mtsManagerComponentServicesGetManagerComponentServices (void) const
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)

Protected Attributes

std::string Name
mtsComponentState State
std::set< std::string > mTags
mtsInterfaceProvidedInterfaceProvidedToManager
bool UseSeparateLogFileFlag
cmnLogger::StreamBufTypeLoDMultiplexerStreambuf
std::ofstream * LogFile
InterfacesProvidedMapType InterfacesProvided
InterfacesOutputMapType InterfacesOutput
InterfacesRequiredMapType InterfacesRequired
InterfacesInputMapType InterfacesInput
StateTableMapType StateTables
mtsManagerComponentServicesManagerComponentServices
mtsFunctionWrite EventGeneratorChangeState
bool ReplayMode

Friends

class mtsManagerComponent
class mtsManagerLocal

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

◆ InterfacesInputMapType

◆ InterfacesOutputMapType

◆ InterfacesProvidedMapType

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.

◆ InterfacesRequiredMapType

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

◆ StateTableMapType

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

◆ ThisType

Constructor & Destructor Documentation

◆ mtsComponent() [1/3]

mtsComponent::mtsComponent ( void )
protected

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

◆ mtsComponent() [2/3]

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() [3/3]

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

Default constructor. Sets the name.

◆ ~mtsComponent()

virtual mtsComponent::~mtsComponent ( )
virtual

Default destructor. Does nothing.

Member Function Documentation

◆ AddInterfaceInput()

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

Add an input interface.

◆ AddInterfaceInputExisting()

mtsInterfaceInput * mtsComponent::AddInterfaceInputExisting ( const std::string & interfaceInputName,
mtsInterfaceInput * interfaceInput )
protected

◆ AddInterfaceInternal()

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)

◆ AddInterfaceOutput()

virtual mtsInterfaceOutput * mtsComponent::AddInterfaceOutput ( const std::string & interfaceOutputName)
virtual

Method to add an output interface to the component.

◆ AddInterfaceOutputExisting()

mtsInterfaceOutput * mtsComponent::AddInterfaceOutputExisting ( const std::string & interfaceOutputName,
mtsInterfaceOutput * interfaceOutput )
protected

◆ AddInterfaceProvided()

mtsInterfaceProvided * mtsComponent::AddInterfaceProvided ( const std::string & interfaceProvidedName,
mtsInterfaceQueueingPolicy queueingPolicy = MTS_COMPONENT_POLICY )

Method to add a provided interface to the component.

◆ AddInterfaceProvidedUsingMailbox()

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.

◆ AddInterfaceProvidedWithoutSystemEvents()

virtual mtsInterfaceProvided * mtsComponent::AddInterfaceProvidedWithoutSystemEvents ( const std::string & interfaceProvidedName,
mtsInterfaceQueueingPolicy queueingPolicy = MTS_COMPONENT_POLICY )
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.

◆ AddInterfaceRequired()

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.

◆ AddInterfaceRequiredExisting()

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.

◆ AddInterfaceRequiredUsingMailbox()

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.

◆ AddInterfaceRequiredWithoutSystemEventHandlers()

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

Reimplemented in mtsTask, and mtsTaskFromSignal.

◆ AddProvidedInterface()

CISST_DEPRECATED mtsInterfaceProvided * mtsComponent::AddProvidedInterface ( const std::string & interfaceProvidedName)
inline

◆ AddRequiredInterface()

CISST_DEPRECATED mtsInterfaceRequired * mtsComponent::AddRequiredInterface ( const std::string & requiredInterfaceName)
inline

◆ AddStateTable()

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).

◆ AddTag()

void mtsComponent::AddTag ( const std::string & tag)

Add a tag to the component.

◆ AreAllInterfacesRequiredConnected()

bool mtsComponent::AreAllInterfacesRequiredConnected ( const bool log = false)

Return true if all required interfaces are connected. This method will not log the results in cisstLog unless the flag 'log' is set to true.

◆ Cleanup()

◆ Configure()

◆ Create()

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.

◆ CreateAndWait()

bool mtsComponent::CreateAndWait ( double timeoutInSeconds)

Call the Create method followed by WaitForState

◆ EnableDynamicComponentManagement()

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

◆ GetInterfaceInput()

mtsInterfaceInput * mtsComponent::GetInterfaceInput ( const std::string & interfaceInputName) const

Get an input interface identified by its name

◆ GetInterfaceOutput()

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

Get an output interface identified by its name

◆ GetInterfaceProvided()

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

Get a provided interface identified by its name

◆ GetInterfaceProvidedFor()

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.

◆ GetInterfaceRequired()

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

Get a required interface identified by its name

◆ GetLogMultiplexer()

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

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.

◆ GetManagerComponentServices()

virtual const mtsManagerComponentServices * mtsComponent::GetManagerComponentServices ( void ) const
protectedvirtual

Get pointer to manager component services, which extends the internal required interface to the Manager Component Client (MCS). Returns a const pointer; internal methods that need a non-const pointer can directly access ManagerComponentServices. This method checks if the internal interface is connected; if not, it returns services from mtsManagerLocal.

Reimplemented in mtsTask.

◆ GetName() [1/2]

void mtsComponent::GetName ( std::string & placeHolder) const

◆ GetName() [2/2]

const std::string & mtsComponent::GetName ( void ) const

Returns the name of the component.

◆ GetNamesOfInterfacesInput()

std::vector< std::string > mtsComponent::GetNamesOfInterfacesInput ( void ) const

◆ GetNamesOfInterfacesOutput()

std::vector< std::string > mtsComponent::GetNamesOfInterfacesOutput ( void ) const

◆ GetNamesOfInterfacesProvided()

std::vector< std::string > mtsComponent::GetNamesOfInterfacesProvided ( void ) const

◆ GetNamesOfInterfacesProvidedOrOutput()

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.

◆ GetNamesOfInterfacesRequired()

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

◆ GetNamesOfInterfacesRequiredOrInput()

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

Provide a list of existing required interfaces (by names)

◆ GetNumberOfInterfacesInput()

size_t mtsComponent::GetNumberOfInterfacesInput ( void ) const

Get the total number of input interfaces

◆ GetNumberOfInterfacesOutput()

size_t mtsComponent::GetNumberOfInterfacesOutput ( void ) const

Get the total number of output interfaces

◆ GetNumberOfInterfacesProvided()

size_t mtsComponent::GetNumberOfInterfacesProvided ( void ) const

Get the total number of provided interfaces

◆ GetNumberOfInterfacesRequired()

size_t mtsComponent::GetNumberOfInterfacesRequired ( void ) const

Get the total number of required interfaces

◆ GetState() [1/2]

void mtsComponent::GetState ( mtsComponentState & state) const

◆ GetState() [2/2]

const mtsComponentState & mtsComponent::GetState ( void ) const

Return task state.

◆ GetStateTable()

mtsStateTable * mtsComponent::GetStateTable ( const std::string & stateTableName)

Remove an input interface identified by its name

Return a pointer to state table with the given name.

◆ GetTags()

const std::set< std::string > & mtsComponent::GetTags ( void ) const

Return all tags.

◆ Initialize()

void mtsComponent::Initialize ( void )
protected

Initializer

◆ InterfaceExists()

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

◆ InterfaceInternalCommands_AddObserverList()

void mtsComponent::InterfaceInternalCommands_AddObserverList ( const mtsEventHandlerList & argin,
mtsEventHandlerList & argout )
protected

◆ InterfaceInternalCommands_GetEndUserInterface()

void mtsComponent::InterfaceInternalCommands_GetEndUserInterface ( const mtsEndUserInterfaceArg & argin,
mtsEndUserInterfaceArg & argout )
protected

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

◆ InterfaceInternalCommands_RemoveEndUserInterface()

void mtsComponent::InterfaceInternalCommands_RemoveEndUserInterface ( const mtsEndUserInterfaceArg & argin,
mtsEndUserInterfaceArg & argout )
protected

◆ InterfaceInternalCommands_RemoveObserverList()

void mtsComponent::InterfaceInternalCommands_RemoveObserverList ( const mtsEventHandlerList & argin,
mtsEventHandlerList & argout )
protected

◆ InterfaceProvidedOrOutputExists()

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

◆ InterfaceRequiredOrInputExists()

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

◆ IsEndTask()

bool mtsComponent::IsEndTask ( void ) const

Return true if task is marked for killing.

◆ IsRunning()

bool mtsComponent::IsRunning ( void ) const

Return true if task is active.

◆ IsStarted()

bool mtsComponent::IsStarted ( void ) const

Return true if task was started.

◆ IsTerminated()

bool mtsComponent::IsTerminated ( void ) const

Return true if task is terminated.

◆ Kill()

virtual void mtsComponent::Kill ( void )
virtual

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

Reimplemented in mtsTask, mtsTaskContinuous, mtsTaskFromCallback, and mtsTaskFromSignal.

◆ KillAndWait()

bool mtsComponent::KillAndWait ( double timeoutInSeconds)

Call the Kill method followed by WaitForState

◆ KillSeparateLogFile()

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.

◆ ProcessMailBoxes()

size_t mtsComponent::ProcessMailBoxes ( InterfacesProvidedMapType & interfaces)
protected

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

◆ ProcessQueuedCommands()

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.

◆ ProcessQueuedEvents()

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.

◆ RemoveInterfaceProvided()

bool mtsComponent::RemoveInterfaceProvided ( const std::string & interfaceProvidedName)

Remove a provided interface identified by its name

◆ RemoveInterfaceRequired()

bool mtsComponent::RemoveInterfaceRequired ( const std::string & interfaceRequiredName)

Remove a required interface identified by its name

◆ Running()

bool CISST_DEPRECATED mtsComponent::Running ( void ) const
inline

◆ SetName()

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.

◆ SetReplayData()

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

◆ SetReplayMode()

bool mtsComponent::SetReplayMode ( void )

Method to set replay mode

◆ SetReplayTime()

bool mtsComponent::SetReplayTime ( const double time)

◆ Start()

virtual void mtsComponent::Start ( void )
virtual

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

Reimplemented in mtsTaskContinuous, and mtsTaskFromCallback.

◆ StartAndWait()

bool mtsComponent::StartAndWait ( double timeoutInSeconds)

Call the Start method followed by WaitForState

◆ Startup()

◆ Suspend()

virtual void mtsComponent::Suspend ( void )
virtual

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

Reimplemented in mtsTaskContinuous, mtsTaskFromCallback, and mtsTaskPeriodic.

◆ ToStream()

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

Send a human readable description of the component.

Reimplemented from cmnGenericObject.

◆ UseSeparateLogFile()

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.

◆ UseSeparateLogFileDefault()

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'

◆ UseSeparateLogFileDefaultWithDate()

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'

◆ WaitForState()

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

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

Reimplemented in mtsTask.

◆ mtsManagerComponent

friend class mtsManagerComponent
friend

◆ mtsManagerLocal

friend class mtsManagerLocal
friend

Member Data Documentation

◆ EventGeneratorChangeState

mtsFunctionWrite mtsComponent::EventGeneratorChangeState
protected

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

◆ InterfaceProvidedToManager

mtsInterfaceProvided* mtsComponent::InterfaceProvidedToManager
protected

Provided interface for component management.

◆ InterfacesInput

InterfacesInputMapType mtsComponent::InterfacesInput
protected

◆ InterfacesOutput

InterfacesOutputMapType mtsComponent::InterfacesOutput
protected

◆ InterfacesProvided

InterfacesProvidedMapType mtsComponent::InterfacesProvided
protected

◆ InterfacesRequired

InterfacesRequiredMapType mtsComponent::InterfacesRequired
protected

◆ LoDMultiplexerStreambuf

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.

◆ LogFile

std::ofstream* mtsComponent::LogFile
protected

Default log file used for this component logging

◆ ManagerComponentServices

mtsManagerComponentServices* mtsComponent::ManagerComponentServices
protected

Dynamic component management service provider

◆ mTags

std::set<std::string> mtsComponent::mTags
protected

Component tags.

◆ Name

std::string mtsComponent::Name
protected

A string identifying the 'Name' of the component.

◆ ReplayMode

bool mtsComponent::ReplayMode
protected

◆ State

mtsComponentState mtsComponent::State
protected

Component state.

◆ StateTables

StateTableMapType mtsComponent::StateTables
protected

◆ UseSeparateLogFileFlag

bool mtsComponent::UseSeparateLogFileFlag
protected

Flag to keep track of separate log file use


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