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

#include <mtsManagerLocal.h>

Inheritance diagram for mtsManagerLocal:
mtsManagerLocalInterface cmnGenericObject

Public Types

enum  ConfigurationType { LCM_CONFIG_STANDALONE, LCM_CONFIG_NETWORKED, LCM_CONFIG_NETWORKED_WITH_GCM }
 

Public Member Functions

mtsComponentCreateComponentDynamically (const std::string &className, const std::string &componentName, const std::string &constructorArgSerialized)
 Create a component. Does not add it to the local component manager. More...
 
bool AddComponent (mtsComponent *component)
 Add a component to this local component manager. More...
 
bool CISST_DEPRECATED AddTask (mtsTask *component)
 
bool CISST_DEPRECATED AddDevice (mtsComponent *component)
 
bool RemoveComponent (mtsComponent *component)
 Remove component from this local component manager. More...
 
bool RemoveComponent (const std::string &componentName)
 
mtsComponentGetComponent (const std::string &componentName) const
 Retrieve a component by name. More...
 
mtsTaskGetComponentAsTask (const std::string &componentName) const
 
mtsComponent CISST_DEPRECATEDGetDevice (const std::string &deviceName)
 
mtsTask CISST_DEPRECATEDGetTask (const std::string &taskName)
 
bool FindComponent (const std::string &componentName) const
 Check if a component exists by its name. More...
 
bool WaitForStateAll (mtsComponentState desiredState, double timeout=3.0 *cmn_minute) const
 
void CreateAll (void)
 Create all components. If a component is of type mtsTask, mtsTask::Create() is called internally. More...
 
bool CreateAllAndWait (double timeoutInSeconds)
 
void StartAll (void)
 Start all components. If a component is of type mtsTask, mtsTask::Start() is called internally. More...
 
bool StartAllAndWait (double timeoutInSeconds)
 
void KillAll (void)
 Stop all components. If a component is of type mtsTask, mtsTask::Kill() is called internally. More...
 
bool KillAllAndWait (double timeoutInSeconds)
 
void Cleanup (void)
 Cleanup. Since a local component manager is a singleton, the destructor will be called when the program exits but a library user is not capable of handling the timing. Thus, for safe termination, this method should be called before an application quits. More...
 
bool Connect (const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
 Connect two local interfaces. More...
 
bool Connect (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName, const unsigned int retryCount=10)
 Connect two remote interfaces. More...
 
bool Disconnect (const ConnectionIDType connectionID)
 
bool Disconnect (const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
 
bool Disconnect (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
 
std::vector< std::string > GetNamesOfComponents (void) const
 
void GetNamesOfComponents (std::vector< std::string > &namesOfComponents) const
 
const osaTimeServerGetTimeServer (void) const
 
const std::string GetProcessName (const std::string &CMN_UNUSED(listenerID)="") const
 
ConfigurationType GetConfiguration (void) const
 
bool IsGCMActive (void) const
 
void SetMainThreadId (void)
 
void SetMainThreadId (const osaThreadId &threadId)
 
osaThreadId GetMainThreadId (void) const
 
void PushCurrentMainTask (mtsTaskContinuous *cur)
 
mtsTaskContinuousPopCurrentMainTask ()
 
mtsTaskContinuousGetCurrentMainTask (void) const
 
void GetNamesOfCommands (std::vector< std::string > &namesOfCommands, const std::string &componentName, const std::string &providedInterfaceName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetNamesOfEventGenerators (std::vector< std::string > &namesOfEventGenerators, const std::string &componentName, const std::string &providedInterfaceName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetNamesOfFunctions (std::vector< std::string > &namesOfFunctions, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetNamesOfEventHandlers (std::vector< std::string > &namesOfEventHandlers, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetDescriptionOfCommand (std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &commandName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetDescriptionOfEventGenerator (std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &eventGeneratorName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetDescriptionOfFunction (std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &functionName, const std::string &CMN_UNUSED(listenerID)="")
 
void GetDescriptionOfEventHandler (std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &eventHandlerName, const std::string &CMN_UNUSED(listenerID)="")
 
const std::string & GetIPAddress (void) const
 
const std::string GetName (void) const
 
bool SetInterfaceProvidedProxyAccessInfo (const ConnectionIDType connectionID, const std::string &endpointInfo)
 
bool GetGCMProcTimeSyncInfo (std::vector< std::string > &processNames, std::vector< double > &timeOffsets)
 
void ToStream (std::ostream &outputStream) const
 
void ToStreamDot (std::ostream &outputStream) const
 
- Public Member Functions inherited from mtsManagerLocalInterface
virtual const std::string GetProcessName (const std::string &listenerID="") const =0
 
virtual void GetNamesOfCommands (std::vector< std::string > &namesOfCommands, const std::string &componentName, const std::string &providedInterfaceName, const std::string &listenerID="")=0
 
virtual void GetNamesOfEventGenerators (std::vector< std::string > &namesOfEventGenerators, const std::string &componentName, const std::string &providedInterfaceName, const std::string &listenerID="")=0
 
virtual void GetNamesOfFunctions (std::vector< std::string > &namesOfFunctions, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &listenerID="")=0
 
virtual void GetNamesOfEventHandlers (std::vector< std::string > &namesOfEventHandlers, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &listenerID="")=0
 
virtual void GetDescriptionOfCommand (std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &commandName, const std::string &listenerID="")=0
 
virtual void GetDescriptionOfEventGenerator (std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &eventGeneratorName, const std::string &listenerID="")=0
 
virtual void GetDescriptionOfFunction (std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &functionName, const std::string &listenerID="")=0
 
virtual void GetDescriptionOfEventHandler (std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &eventHandlerName, const std::string &listenerID="")=0
 
- 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 cmnLogger::StreamBufTypeGetLogMultiplexer (void) const
 
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
 

Static Public Member Functions

static void LogDispatcher (const char *str, int len)
 
static void SetLogForwarding (bool activate)
 
static void GetLogForwardingState (bool &state)
 
static bool GetLogForwardingState (void)
 
static bool IsLogForwardingEnabled (void)
 
static bool IsLogAllowed (void)
 
static mtsManagerLocalGetInstance (void)
 
static mtsManagerLocalGetInstance (const std::string &globalComponentManagerIP, const std::string &thisProcessName="", const std::string &thisProcessIP="")
 Return singleton object of local component manager (networked mode) More...
 
static mtsManagerLocalGetInstance (mtsManagerGlobal &globalComponentManager)
 Return singleton object of local component manager (networked mode, as GCM) More...
 
static std::vector< std::string > GetIPAddressList (void)
 
static void GetIPAddressList (std::vector< std::string > &ipAddresses)
 

Static Public Attributes

static const std::string ProcessNameOfLCMDefault
 
static const std::string ProcessNameOfLCMWithGCM
 

Protected Member Functions

 mtsManagerLocal (void)
 
 mtsManagerLocal (const std::string &globalComponentManagerIP, const std::string &thisProcessName, const std::string &thisProcessIP)
 
 mtsManagerLocal (mtsManagerGlobal &globalComponentManager)
 
virtual ~mtsManagerLocal ()
 
void Initialize (void)
 
void InitializeLocal (void)
 
bool CreateManagerComponents (void)
 Create internal manager components automatically when LCM is initialized. More...
 
bool AddManagerComponent (const std::string &processName, const bool isServer=false)
 Add an internal manager component. More...
 
bool ConnectManagerComponentClientToServer (void)
 Connect manager component client to manager component server (connect InterfaceLCM.Required - InterfaceGCM.Provided) This will make the manager component server dynamically create a required interface which connects to InterfaceLCM's provided interface. More...
 
bool ConnectToManagerComponentClient (const std::string &componentName)
 Connect a local component which has internal interfaces to the manager component client (connect InterfaceInternal.Required - InterfaceComponent.Provided) More...
 
void SetIPAddress (void)
 Set IP address of this machine. More...
 
bool ConnectToGlobalComponentManager (void)
 Create Ice proxy for this LCM and connects to the GCM. More...
 
bool RegisterInterfaces (mtsComponent *component)
 Register all interfaces that a component owns to the global component manager. The GCM uses this information to connect interfaces that are in different processes. More...
 
bool RegisterInterfaces (const std::string &componentName)
 
ConnectionIDType ConnectSetup (const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
 
bool ConnectNotify (ConnectionIDType connectionId, const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
 
bool RemoveComponent (mtsComponent *component, const bool notifyGCM)
 
bool RemoveComponent (const std::string &componentName, const bool notifyGCM)
 
bool RemoveInterfaceProvided (const std::string &componentName, const std::string &interfaceProvidedName)
 
bool RemoveInterfaceRequired (const std::string &componentName, const std::string &interfaceRequiredName)
 
bool CreateComponentProxy (const std::string &componentProxyName, const std::string &listenerID="")
 Create component proxy. More...
 
bool RemoveComponentProxy (const std::string &componentProxyName, const std::string &listenerID="")
 Remove component proxy. More...
 
bool CreateInterfaceProvidedProxy (const std::string &serverComponentProxyName, const mtsInterfaceProvidedDescription &providedInterfaceDescription, const std::string &listenerID="")
 Create provided interface proxy. More...
 
bool CreateInterfaceRequiredProxy (const std::string &clientComponentProxyName, const mtsInterfaceRequiredDescription &requiredInterfaceDescription, const std::string &listenerID="")
 Create required interface proxy. More...
 
bool RemoveInterfaceProvidedProxy (const std::string &componentProxyName, const std::string &providedInterfaceProxyName, const std::string &listenerID="")
 
bool RemoveInterfaceRequiredProxy (const std::string &componentProxyName, const std::string &requiredInterfaceProxyName, const std::string &listenerID="")
 
bool ConnectServerSideInterface (const mtsDescriptionConnection &description, const std::string &listenerID="")
 
bool ConnectClientSideInterface (const mtsDescriptionConnection &description, const std::string &listenerID="")
 Connect two local interfaces at the client side. More...
 
bool GetInterfaceProvidedDescription (const std::string &serverComponentName, const std::string &providedInterfaceName, mtsInterfaceProvidedDescription &providedInterfaceDescription, const std::string &listenerID="")
 
bool GetInterfaceRequiredDescription (const std::string &componentName, const std::string &requiredInterfaceName, mtsInterfaceRequiredDescription &requiredInterfaceDescription, const std::string &listenerID="")
 
void SetGCMConnected (const bool connected)
 

Friends

class mtsManagerLocalTest
 
class mtsManagerGlobalTest
 
class mtsManagerGlobal
 
class mtsManagerProxyClient
 
class mtsManagerComponentClient
 
class mtsComponentProxy
 

Member Enumeration Documentation

Typedef for local component manager's configuration

Enumerator
LCM_CONFIG_STANDALONE 
LCM_CONFIG_NETWORKED 
LCM_CONFIG_NETWORKED_WITH_GCM 

Constructor & Destructor Documentation

mtsManagerLocal::mtsManagerLocal ( void  )
protected

Protected constructor (singleton)

mtsManagerLocal::mtsManagerLocal ( const std::string &  globalComponentManagerIP,
const std::string &  thisProcessName,
const std::string &  thisProcessIP 
)
protected
mtsManagerLocal::mtsManagerLocal ( mtsManagerGlobal globalComponentManager)
protected
virtual mtsManagerLocal::~mtsManagerLocal ( )
protectedvirtual

Destructor. Includes OS-specific cleanup.

Member Function Documentation

bool mtsManagerLocal::AddComponent ( mtsComponent component)

Add a component to this local component manager.

Parameters
componentComponent instance to be added
bool CISST_DEPRECATED mtsManagerLocal::AddDevice ( mtsComponent component)
bool mtsManagerLocal::AddManagerComponent ( const std::string &  processName,
const bool  isServer = false 
)
protected

Add an internal manager component.

Parameters
processNameName of this process (or this LCM)
isServerTrue to create manager component server, false to create manager component client. Note that this argument should be true only when LCM runs with GCM in the same process.
bool CISST_DEPRECATED mtsManagerLocal::AddTask ( mtsTask component)
void mtsManagerLocal::Cleanup ( void  )

Cleanup. Since a local component manager is a singleton, the destructor will be called when the program exits but a library user is not capable of handling the timing. Thus, for safe termination, this method should be called before an application quits.

bool mtsManagerLocal::Connect ( const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName 
)

Connect two local interfaces.

Parameters
clientComponentNameName of client component
clientInterfaceRequiredNameName of required interface
serverComponentNameName of server component
serverInterfaceProvidedNameName of provided interface
Returns
True if success, false otherwise
Note
If connection is established successfully, this information is reported to the global component manager (the local component manager does not keep any connection information).
bool mtsManagerLocal::Connect ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName,
const unsigned int  retryCount = 10 
)

Connect two remote interfaces.

Parameters
clientProcessNameName of client process
clientComponentNameName of client component
clientInterfaceRequiredNameName of required interface
serverProcessNameName of server process
serverComponentNameName of server component
serverInterfaceProvidedNameName of provided interface
retryCountNumber of times this connection is retried (default: 10)
Returns
True if success, false otherwise
Note
If connection is established successfully, this information is reported to the global component manager. Since connection between two interfaces should be established twice–once in the client process and once in the server process–there are two internal connection management methods: ConnectClientSideInterface() and ConnectServerSideInterface(). ConnectClientSideInterface() is always executed first and calls ConnectServerSideInterface() internally in a blocking way (i.e., it waits for ConnectServerSideInterface() to finish). Connection request can be made by any process – server process, client process, or even third process – and the result should be the same regardless the request process. If this method is called against two local interfaces, the other Connect() method is internally called instead.
bool mtsManagerLocal::ConnectClientSideInterface ( const mtsDescriptionConnection description,
const std::string &  listenerID = "" 
)
protectedvirtual

Connect two local interfaces at the client side.

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::ConnectManagerComponentClientToServer ( void  )
protected

Connect manager component client to manager component server (connect InterfaceLCM.Required - InterfaceGCM.Provided) This will make the manager component server dynamically create a required interface which connects to InterfaceLCM's provided interface.

bool mtsManagerLocal::ConnectNotify ( ConnectionIDType  connectionId,
const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName 
)
protected
bool mtsManagerLocal::ConnectServerSideInterface ( const mtsDescriptionConnection description,
const std::string &  listenerID = "" 
)
protectedvirtual

Connect two local interfaces at the server side

Implements mtsManagerLocalInterface.

ConnectionIDType mtsManagerLocal::ConnectSetup ( const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName 
)
protected
bool mtsManagerLocal::ConnectToGlobalComponentManager ( void  )
protected

Create Ice proxy for this LCM and connects to the GCM.

Returns
True if success, false otherwise
bool mtsManagerLocal::ConnectToManagerComponentClient ( const std::string &  componentName)
protected

Connect a local component which has internal interfaces to the manager component client (connect InterfaceInternal.Required - InterfaceComponent.Provided)

void mtsManagerLocal::CreateAll ( void  )

Create all components. If a component is of type mtsTask, mtsTask::Create() is called internally.

bool mtsManagerLocal::CreateAllAndWait ( double  timeoutInSeconds)

Call CreateAll method followed by WaitForStateAll.

mtsComponent* mtsManagerLocal::CreateComponentDynamically ( const std::string &  className,
const std::string &  componentName,
const std::string &  constructorArgSerialized 
)

Create a component. Does not add it to the local component manager.

bool mtsManagerLocal::CreateComponentProxy ( const std::string &  componentProxyName,
const std::string &  listenerID = "" 
)
protectedvirtual

Create component proxy.

Parameters
componentProxyNameName of component proxy
listenerIDNot used
Note
This should be called before an interface proxy is created.

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::CreateInterfaceProvidedProxy ( const std::string &  serverComponentProxyName,
const mtsInterfaceProvidedDescription providedInterfaceDescription,
const std::string &  listenerID = "" 
)
protectedvirtual

Create provided interface proxy.

Parameters
serverComponentProxyNameName of server component proxy
providedInterfaceDescriptionDescription of provided interface

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::CreateInterfaceRequiredProxy ( const std::string &  clientComponentProxyName,
const mtsInterfaceRequiredDescription requiredInterfaceDescription,
const std::string &  listenerID = "" 
)
protectedvirtual

Create required interface proxy.

Parameters
clientComponentProxyNameName of component proxy that has

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::CreateManagerComponents ( void  )
protected

Create internal manager components automatically when LCM is initialized.

bool mtsManagerLocal::Disconnect ( const ConnectionIDType  connectionID)

Disconnect two interfaces

bool mtsManagerLocal::Disconnect ( const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName 
)
bool mtsManagerLocal::Disconnect ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName 
)
bool mtsManagerLocal::FindComponent ( const std::string &  componentName) const

Check if a component exists by its name.

mtsComponent* mtsManagerLocal::GetComponent ( const std::string &  componentName) const

Retrieve a component by name.

mtsTask* mtsManagerLocal::GetComponentAsTask ( const std::string &  componentName) const
ConfigurationType mtsManagerLocal::GetConfiguration ( void  ) const
inline

Returns the current configuration of this local component manager

mtsTaskContinuous* mtsManagerLocal::GetCurrentMainTask ( void  ) const
inline

Get pointer to active task that has main thread (if none, returns 0)

void mtsManagerLocal::GetDescriptionOfCommand ( std::string &  description,
const std::string &  componentName,
const std::string &  providedInterfaceName,
const std::string &  commandName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get description of a command in a provided interface

void mtsManagerLocal::GetDescriptionOfEventGenerator ( std::string &  description,
const std::string &  componentName,
const std::string &  providedInterfaceName,
const std::string &  eventGeneratorName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get description of a event generator in a provided interface

void mtsManagerLocal::GetDescriptionOfEventHandler ( std::string &  description,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
const std::string &  eventHandlerName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get description of a function in a required interface

void mtsManagerLocal::GetDescriptionOfFunction ( std::string &  description,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
const std::string &  functionName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get description of a function in a required interface

mtsComponent CISST_DEPRECATED* mtsManagerLocal::GetDevice ( const std::string &  deviceName)
bool mtsManagerLocal::GetGCMProcTimeSyncInfo ( std::vector< std::string > &  processNames,
std::vector< double > &  timeOffsets 
)
static mtsManagerLocal* mtsManagerLocal::GetInstance ( void  )
static

Get a singleton object of local component manager.

Note
If this is called first, the local component manager is configured in standalone mode. If one of the other GetInstance methods (with arguments) is later called, the singleton object is reconfigured in networked mode if (CISST_MTS_HAS_ICE is defined) to support inter-process communication. During this reconfiguration process, a caller thread is blocked for thread-safe transition of all internal data.
static mtsManagerLocal* mtsManagerLocal::GetInstance ( const std::string &  globalComponentManagerIP,
const std::string &  thisProcessName = "",
const std::string &  thisProcessIP = "" 
)
static

Return singleton object of local component manager (networked mode)

Parameters
globalComponentManagerIPIp address of global component manager that this local component manager connects to
thisProcessNameName of this process. If not specified, set as ip address of this host by default
thisProcessIPIP address of this process. If not specified, set as the first ip address detected
Returns
Pointer to singleton object
static mtsManagerLocal* mtsManagerLocal::GetInstance ( mtsManagerGlobal globalComponentManager)
static

Return singleton object of local component manager (networked mode, as GCM)

Parameters
globalComponentManagerreference to global component manager (GCM)
bool mtsManagerLocal::GetInterfaceProvidedDescription ( const std::string &  serverComponentName,
const std::string &  providedInterfaceName,
mtsInterfaceProvidedDescription providedInterfaceDescription,
const std::string &  listenerID = "" 
)
protectedvirtual

Get information about provided interface

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::GetInterfaceRequiredDescription ( const std::string &  componentName,
const std::string &  requiredInterfaceName,
mtsInterfaceRequiredDescription requiredInterfaceDescription,
const std::string &  listenerID = "" 
)
protectedvirtual

Extract all the information on a required interface such as function objects and event handlers with arguments serialized

Implements mtsManagerLocalInterface.

const std::string& mtsManagerLocal::GetIPAddress ( void  ) const
inline

Return IP address of this process

static std::vector<std::string> mtsManagerLocal::GetIPAddressList ( void  )
static

Return a list of all IP addresses detected on this machine.

static void mtsManagerLocal::GetIPAddressList ( std::vector< std::string > &  ipAddresses)
static
static void mtsManagerLocal::GetLogForwardingState ( bool &  state)
static

Get whether system-wide logging is enabled or not

static bool mtsManagerLocal::GetLogForwardingState ( void  )
static
osaThreadId mtsManagerLocal::GetMainThreadId ( void  ) const
inline

Return main thread id.

const std::string mtsManagerLocal::GetName ( void  ) const
inline

Returns name of this local component manager (for mtsProxyBaseCommon.h)

void mtsManagerLocal::GetNamesOfCommands ( std::vector< std::string > &  namesOfCommands,
const std::string &  componentName,
const std::string &  providedInterfaceName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get names of all commands in a provided interface

std::vector<std::string> mtsManagerLocal::GetNamesOfComponents ( void  ) const

Enumerate all the names of components added

void mtsManagerLocal::GetNamesOfComponents ( std::vector< std::string > &  namesOfComponents) const
void mtsManagerLocal::GetNamesOfEventGenerators ( std::vector< std::string > &  namesOfEventGenerators,
const std::string &  componentName,
const std::string &  providedInterfaceName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get names of all event generators in a provided interface

void mtsManagerLocal::GetNamesOfEventHandlers ( std::vector< std::string > &  namesOfEventHandlers,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get names of all event handlers in a required interface

void mtsManagerLocal::GetNamesOfFunctions ( std::vector< std::string > &  namesOfFunctions,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
const std::string &  CMN_UNUSEDlistenerID = "" 
)

Get names of all functions in a required interface

const std::string mtsManagerLocal::GetProcessName ( const std::string &  CMN_UNUSEDlistenerID = "") const
inline

Returns name of this local component manager

mtsTask CISST_DEPRECATED* mtsManagerLocal::GetTask ( const std::string &  taskName)
const osaTimeServer& mtsManagerLocal::GetTimeServer ( void  ) const

Return a reference to the time server.

void mtsManagerLocal::Initialize ( void  )
protected

Initialization

void mtsManagerLocal::InitializeLocal ( void  )
protected
bool mtsManagerLocal::IsGCMActive ( void  ) const
inline

Check if connection to GCM is active

static bool mtsManagerLocal::IsLogAllowed ( void  )
static

Check if further logs are allowed

static bool mtsManagerLocal::IsLogForwardingEnabled ( void  )
static

Is system-wide thread-safe logging enabled?

void mtsManagerLocal::KillAll ( void  )

Stop all components. If a component is of type mtsTask, mtsTask::Kill() is called internally.

bool mtsManagerLocal::KillAllAndWait ( double  timeoutInSeconds)

Call KillAll method followed by WaitForStateAll.

static void mtsManagerLocal::LogDispatcher ( const char *  str,
int  len 
)
static

Callback function for system-wide thread-safe logging

mtsTaskContinuous* mtsManagerLocal::PopCurrentMainTask ( )

Restore previous active task that has main thread (called when task is exiting)

void mtsManagerLocal::PushCurrentMainTask ( mtsTaskContinuous cur)

Set active task that has main thread (called by mtsTaskContinuous::Start)

bool mtsManagerLocal::RegisterInterfaces ( mtsComponent component)
protected

Register all interfaces that a component owns to the global component manager. The GCM uses this information to connect interfaces that are in different processes.

Parameters
componentComponent object instance
componentNameName of component
bool mtsManagerLocal::RegisterInterfaces ( const std::string &  componentName)
protected
bool mtsManagerLocal::RemoveComponent ( mtsComponent component,
const bool  notifyGCM 
)
protected

Remove component from this local component manager

bool mtsManagerLocal::RemoveComponent ( const std::string &  componentName,
const bool  notifyGCM 
)
protected
bool mtsManagerLocal::RemoveComponent ( mtsComponent component)

Remove component from this local component manager.

bool mtsManagerLocal::RemoveComponent ( const std::string &  componentName)
bool mtsManagerLocal::RemoveComponentProxy ( const std::string &  componentProxyName,
const std::string &  listenerID = "" 
)
protectedvirtual

Remove component proxy.

Parameters
componentProxyNameName of component proxy
listenerIDNot used
Note
Note that all the interface proxies that the proxy manages is automatically removed when removing a component proxy.

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::RemoveInterfaceProvided ( const std::string &  componentName,
const std::string &  interfaceProvidedName 
)
protected

Remove provided interface

bool mtsManagerLocal::RemoveInterfaceProvidedProxy ( const std::string &  componentProxyName,
const std::string &  providedInterfaceProxyName,
const std::string &  listenerID = "" 
)
protectedvirtual

Remove provided interface proxy

Implements mtsManagerLocalInterface.

bool mtsManagerLocal::RemoveInterfaceRequired ( const std::string &  componentName,
const std::string &  interfaceRequiredName 
)
protected

Remove required interface

bool mtsManagerLocal::RemoveInterfaceRequiredProxy ( const std::string &  componentProxyName,
const std::string &  requiredInterfaceProxyName,
const std::string &  listenerID = "" 
)
protectedvirtual

Remove required interface proxy

Implements mtsManagerLocalInterface.

void mtsManagerLocal::SetGCMConnected ( const bool  connected)
inlineprotected

Change GCM connection state

bool mtsManagerLocal::SetInterfaceProvidedProxyAccessInfo ( const ConnectionIDType  connectionID,
const std::string &  endpointInfo 
)

Set endpoint access information

void mtsManagerLocal::SetIPAddress ( void  )
protected

Set IP address of this machine.

static void mtsManagerLocal::SetLogForwarding ( bool  activate)
static

Enable or disable system-wide thread-safe logging

void mtsManagerLocal::SetMainThreadId ( void  )
inline

Set main thread id based on the current thread. In most situations, it is not necessary to call this function because the main thread id is initialized in GetInstance.

void mtsManagerLocal::SetMainThreadId ( const osaThreadId threadId)
inline

Set main thread id based on the passed parameter. In most situations, it is not necessary to call this function because the main thread id is initialized in GetInstance.

void mtsManagerLocal::StartAll ( void  )

Start all components. If a component is of type mtsTask, mtsTask::Start() is called internally.

bool mtsManagerLocal::StartAllAndWait ( double  timeoutInSeconds)

Call StartAll method followed by WaitForStateAll.

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

For debugging. Dumps to stream the maps maintained by the manager.

Reimplemented from cmnGenericObject.

void mtsManagerLocal::ToStreamDot ( std::ostream &  outputStream) const

Create a dot file to be used by graphviz to generate a nice graph of connections between tasks/interfaces.

bool mtsManagerLocal::WaitForStateAll ( mtsComponentState  desiredState,
double  timeout = 3.0 *cmn_minute 
) const

Wait until all components reach a certain state. If all components have reach the given state within the time alloted, the method returns true.

Friends And Related Function Documentation

friend class mtsComponentProxy
friend
friend class mtsManagerComponentClient
friend
friend class mtsManagerGlobal
friend
friend class mtsManagerGlobalTest
friend
friend class mtsManagerLocalTest
friend
friend class mtsManagerProxyClient
friend

Member Data Documentation

mtsManagerComponentClient* mtsManagerLocal::Client
const std::string mtsManagerLocal::ProcessNameOfLCMDefault
static

Default name of local component manager

const std::string mtsManagerLocal::ProcessNameOfLCMWithGCM
static

Name of local component manager running with the global component manager

mtsManagerComponentServer* mtsManagerLocal::Server

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