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

#include <mtsManagerGlobal.h>

Inheritance diagram for mtsManagerGlobal:
mtsManagerGlobalInterface cmnGenericObject

Classes

struct  CleanupElementType
 
struct  InterfaceMapType
 

Public Member Functions

 mtsManagerGlobal ()
 
 ~mtsManagerGlobal ()
 
void SetMCS (mtsManagerComponentServer *mcs)
 
bool AddProcess (const std::string &processName)
 Register process. More...
 
bool AddProcessObject (mtsManagerLocalInterface *localManagerObject, const bool isManagerProxyServer=false)
 
bool FindProcess (const std::string &processName) const
 Find process. More...
 
bool RemoveProcess (const std::string &processName, const bool networkDisconnect=false)
 Remove process. More...
 
bool AddComponent (const std::string &processName, const std::string &componentName)
 Register component. More...
 
bool FindComponent (const std::string &processName, const std::string &componentName) const
 Find component using process name and component name. More...
 
bool RemoveComponent (const std::string &processName, const std::string &componentName, const bool lock=true)
 Remove component. More...
 
bool AddInterfaceProvidedOrOutput (const std::string &processName, const std::string &componentName, const std::string &interfaceName)
 Register provided interface. Can be called at run-time. More...
 
bool AddInterfaceRequiredOrInput (const std::string &processName, const std::string &componentName, const std::string &interfaceName)
 Register required interface. Can be called at run-time. More...
 
bool FindInterfaceProvidedOrOutput (const std::string &processName, const std::string &componentName, const std::string &interfaceName) const
 Find provided interface using process name, component name, and interface name. More...
 
bool FindInterfaceRequiredOrInput (const std::string &processName, const std::string &componentName, const std::string &interfaceName) const
 Find required interface using process name, component name, and interface name. More...
 
bool RemoveInterfaceProvidedOrOutput (const std::string &processName, const std::string &componentName, const std::string &interfaceName, const bool lock=true)
 Remove provided interface. Can be called at run-time. More...
 
bool RemoveInterfaceRequiredOrInput (const std::string &processName, const std::string &componentName, const std::string &interfaceName, const bool lock=true)
 Remove required interface. Can be called at run-time. More...
 
ConnectionIDType Connect (const std::string &requestProcessName, const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceName)
 Connect two interfaces. More...
 
bool ConnectConfirm (const ConnectionIDType connectionID)
 Confirm that connection has been successfully established. More...
 
bool Disconnect (const ConnectionIDType connectionID)
 Disconnect two interfaces. More...
 
bool Disconnect (const mtsDescriptionConnection &connection)
 
bool Disconnect (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceName)
 Disconnect two interfaces. More...
 
bool InitiateConnect (const ConnectionIDType connectionID)
 Initiate connection process. More...
 
bool ConnectServerSideInterfaceRequest (const ConnectionIDType connectionID)
 Request the global component manager to connect interfaces at server side. More...
 
void GetListOfConnections (std::vector< mtsDescriptionConnection > &list) const
 
std::vector< std::string > GetIPAddress (void) const
 
void GetIPAddress (std::vector< std::string > &ipAddresses) const
 
void GetNamesOfProcesses (std::vector< std::string > &namesOfProcesses) const
 
void GetNamesOfComponents (const std::string &processName, std::vector< std::string > &namesOfComponents) const
 
void GetNamesOfInterfacesProvidedOrOutput (const std::string &processName, const std::string &componentName, std::vector< std::string > &namesOfInterfacesProvided) const
 
void GetNamesOfInterfacesRequiredOrInput (const std::string &processName, const std::string &componentName, std::vector< std::string > &namesOfInterfacesRequired) const
 
void GetNamesOfCommands (const std::string &processName, const std::string &componentName, const std::string &providedInterfaceName, std::vector< std::string > &namesOfCommands) const
 
void GetNamesOfEventGenerators (const std::string &processName, const std::string &componentName, const std::string &providedInterfaceName, std::vector< std::string > &namesOfEventGenerators) const
 
void GetNamesOfFunctions (const std::string &processName, const std::string &componentName, const std::string &requiredInterfaceName, std::vector< std::string > &namesOfFunctions) const
 
void GetNamesOfEventHandlers (const std::string &processName, const std::string &componentName, const std::string &requiredInterfaceName, std::vector< std::string > &namesOfEventHandlers) const
 
void GetDescriptionOfCommand (const std::string &processName, const std::string &componentName, const std::string &providedInterfaceName, const std::string &commandName, std::string &description) const
 
void GetDescriptionOfEventGenerator (const std::string &processName, const std::string &componentName, const std::string &providedInterfaceName, const std::string &eventGeneratorName, std::string &description) const
 
void GetDescriptionOfFunction (const std::string &processName, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &functionName, std::string &description) const
 
void GetDescriptionOfEventHandler (const std::string &processName, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &eventHandlerName, std::string &description) const
 
mtsManagerLocalInterfaceGetProcessObject (const std::string &processName) const
 
bool StartServer (void)
 
bool StopServer (void)
 
bool SetInterfaceProvidedProxyAccessInfo (const ConnectionIDType connectionID, const std::string &endpointInfo)
 
bool GetInterfaceProvidedProxyAccessInfo (const ConnectionIDType connectionID, std::string &endpointInfo)
 
bool GetInterfaceProvidedProxyAccessInfo (const std::string &clientProcessName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceName, std::string &endpointInfo)
 Get access information of the provided interface proxy. More...
 
void CheckConnectConfirmTimeout (void)
 
- 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 ToStream (std::ostream &outputStream) 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 std::string GetName (void)
 
static bool IsProxyComponent (const std::string &componentName)
 
static const std::string GetComponentProxyName (const std::string &processName, const std::string &componentName)
 
static const std::string GetInterfaceUID (const std::string &processName, const std::string &componentName, const std::string &interfaceName)
 

Protected Types

typedef std::vector
< ConnectionIDType
ConnectionIDListType
 
typedef cmnNamedMap
< ConnectionIDListType
InterfaceMapElementType
 
typedef cmnNamedMap
< InterfaceMapType
ComponentMapType
 
typedef cmnNamedMap
< ComponentMapType
ProcessMapType
 
typedef std::map
< ConnectionIDType,
mtsConnection
ConnectionMapType
 
typedef std::map
< ConnectionIDType,
ConnectionIDType
DisconnectQueueType
 
typedef struct
mtsManagerGlobal::CleanupElementType 
CleanupElementType
 
typedef std::list
< CleanupElementType
CleanupElementListType
 
typedef cmnNamedMap
< CleanupElementListType
DisconnectedProcessCleanupMapType
 

Protected Member Functions

void * ThreadDisconnectProcess (void *arg)
 
void ShowInternalStructure (void)
 
void Cleanup (void)
 
ConnectionIDListTypeGetConnectionsOfInterfaceProvidedOrOutput (const std::string &serverProcessName, const std::string &serverComponentName, const std::string &interfaceName) const
 
ConnectionIDListTypeGetConnectionsOfInterfaceProvidedOrOutput (const std::string &serverProcessName, const std::string &serverComponentName, const std::string &interfaceName, InterfaceMapType **interfaceMap) const
 
ConnectionIDListTypeGetConnectionsOfInterfaceRequiredOrInput (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &interfaceName) const
 
ConnectionIDListTypeGetConnectionsOfInterfaceRequiredOrInput (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &interfaceName, InterfaceMapType **interfaceMap) const
 
bool AddConnectionToInterfaceProvidedOrOutput (const std::string &serverProcessName, const std::string &serverComponentName, const std::string &interfaceName, const ConnectionIDType connectionID)
 
bool AddConnectionToInterfaceRequiredOrInput (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &interfaceName, const ConnectionIDType connectionID)
 
bool RemoveConnectionOfInterfaceProvidedOrOutput (const std::string &serverProcessName, const std::string &serverComponentName, const std::string &interfaceName, const ConnectionIDType connectionID)
 
bool RemoveConnectionOfInterfaceRequiredOrInput (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &interfaceName, const ConnectionIDType connectionID)
 
bool CleanupDisconnectedProcess (const std::string &nameOfProcessDisconnected)
 
bool IsAlreadyConnected (const mtsDescriptionConnection &description) const
 
int GetNumberOfInterfaces (const std::string &processName, const std::string &componentName, const bool includeInternalInterface=true) const
 
ConnectionIDType GetConnectionID (const std::string &clientProcessName, const std::string &clientComponentName, const std::string &interfaceName) const
 
mtsConnectionGetConnectionInformation (const ConnectionIDType connectionID)
 
void DisconnectInternal (void)
 
void AddToDisconnectedProcessCleanup (const std::string &sourceProcessName, const std::string &targetProcessName, const std::string &targetComponentProxyName)
 

Protected Attributes

ProcessMapType ProcessMap
 
ConnectionMapType ConnectionMap
 
mtsManagerLocalLocalManager
 
mtsManagerLocalInterfaceLocalManagerConnected
 
osaMutex ProcessMapChange
 
osaMutex ConnectionMapChange
 
osaMutex ConnectionChange
 
osaMutex DisconnectedProcessCleanupMapChange
 
ConnectionIDType ConnectionID
 
mtsManagerProxyServer * ProxyServer
 
mtsManagerComponentServerManagerComponentServer
 
DisconnectQueueType QueueDisconnectWaiting
 
DisconnectQueueType QueueDisconnected
 
osaMutex QueueDisconnectWaitingChange
 
osaMutex QueueDisconnectedChange
 
osaThread ThreadDisconnect
 
osaThreadSignal ThreadDisconnectFinished
 
bool ThreadDisconnectRunning
 
DisconnectedProcessCleanupMapType DisconnectedProcessCleanupMap
 

Friends

class mtsManagerGlobalTest
 
class mtsManagerLocalTest
 

Member Typedef Documentation

To clean up disconnected process

Component map: a map of registered components in a process key=(component name), value=(interface map) value can be null if a component does not have any interface.

Typedef for connection map: key=(connected interface name), value=(list of connection ids) map name=(name of component that owns these interfaces.

Connection element map: a map of strings that defines a connection key=(connection id), value=(an instance of Connection) When a local component manager requests estbalishing a connection, an element is created and added. If a connection is not established before timeout, the element is removed. When a local component manager notifies that a connection is successfully established, the element is marked as connected.

Queues, mutexes, and internal thread for thread-safe disconnection

Typedef for interface map element: key=(interface name), value=(connection id list type)

Process map: a map of registered processes (i.e., local component managers) key=(process name), value=(component map) value can be null if a process does not have any component.

Constructor & Destructor Documentation

mtsManagerGlobal::mtsManagerGlobal ( )

Constructor and destructor

mtsManagerGlobal::~mtsManagerGlobal ( )

Member Function Documentation

bool mtsManagerGlobal::AddComponent ( const std::string &  processName,
const std::string &  componentName 
)
virtual

Register component.

Parameters
processNameName of process
componentNameName of component

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::AddConnectionToInterfaceProvidedOrOutput ( const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  interfaceName,
const ConnectionIDType  connectionID 
)
protected

Add new connection id to specified interface

bool mtsManagerGlobal::AddConnectionToInterfaceRequiredOrInput ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  interfaceName,
const ConnectionIDType  connectionID 
)
protected
bool mtsManagerGlobal::AddInterfaceProvidedOrOutput ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName 
)
virtual

Register provided interface. Can be called at run-time.

Parameters
processNameName of process
componentNameName of component
interfaceNameName of provided interface to be added

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::AddInterfaceRequiredOrInput ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName 
)
virtual

Register required interface. Can be called at run-time.

Parameters
processNameName of process
componentNameName of component
interfaceNameName of required interface to be added

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::AddProcess ( const std::string &  processName)
virtual

Register process.

Parameters
processNameName of process

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::AddProcessObject ( mtsManagerLocalInterface localManagerObject,
const bool  isManagerProxyServer = false 
)
void mtsManagerGlobal::AddToDisconnectedProcessCleanup ( const std::string &  sourceProcessName,
const std::string &  targetProcessName,
const std::string &  targetComponentProxyName 
)
protected

Maintains information to clean up disconnected processes

void mtsManagerGlobal::CheckConnectConfirmTimeout ( void  )

Check if there is any pending connection. All new connections should be confirmed by the LCM within timeout after the GCM issues a new connection id. Otherwise, the GCM actively disconnects the pending connection.

void mtsManagerGlobal::Cleanup ( void  )
protected

Reset internal data structures

bool mtsManagerGlobal::CleanupDisconnectedProcess ( const std::string &  nameOfProcessDisconnected)
protected

Remove component proxies and internal interfaces (InterfaceComponentRequiredForXXX) that were created because of the disconnected process

ConnectionIDType mtsManagerGlobal::Connect ( const std::string &  requestProcessName,
const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  clientInterfaceRequiredName,
const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName 
)
virtual

Connect two interfaces.

Parameters
requestProcessNameName of process that requests this connection
clientProcessNameName of client process
clientComponentNameName of client component
clientInterfaceRequiredNameName of client's required interface
serverProcessNameName of server process
serverComponentNameName of server component
serverInterfaceProvidedNameName of server's provided interface
Returns
Connect session id issued by the global component manager. Session id is used to clean up pending connections (which was requested but not yet established) after timeout. -1 if error occurs, zero or positive value if success

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::ConnectConfirm ( const ConnectionIDType  connectionID)
virtual

Confirm that connection has been successfully established.

Parameters
connectionIDConnection id
Returns
False if connection id is invalid, true otherwise

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::ConnectServerSideInterfaceRequest ( const ConnectionIDType  connectionID)
virtual

Request the global component manager to connect interfaces at server side.

Parameters
connectionIDConnection id issued by GCM
Returns
True if success, false otherwise

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::Disconnect ( const ConnectionIDType  connectionID)
virtual

Disconnect two interfaces.

Parameters
connectionIDConnection id
Returns
true if disconnection request for connection id is accepted, false otherwise

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::Disconnect ( const mtsDescriptionConnection connection)
bool mtsManagerGlobal::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 
)
virtual

Disconnect two 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
Returns
True if success, false otherwise

Implements mtsManagerGlobalInterface.

void mtsManagerGlobal::DisconnectInternal ( void  )
protected

Process disconnect waiting queue. This is periodically called by the internal processing thread. The connection id that is disconnected is dequeued from disconnect waiting queue and enqueued to disconnected queue.

bool mtsManagerGlobal::FindComponent ( const std::string &  processName,
const std::string &  componentName 
) const
virtual

Find component using process name and component name.

Parameters
processNameName of process
componentNameName of component

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::FindInterfaceProvidedOrOutput ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName 
) const
virtual

Find provided interface using process name, component name, and interface name.

Parameters
processNameName of process
componentNameName of component
interfaceNameName of provided interface

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::FindInterfaceRequiredOrInput ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName 
) const
virtual

Find required interface using process name, component name, and interface name.

Parameters
processNameName of process
componentNameName of component
interfaceNameName of required interface

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::FindProcess ( const std::string &  processName) const
virtual

Find process.

Parameters
processNameName of process

Implements mtsManagerGlobalInterface.

static const std::string mtsManagerGlobal::GetComponentProxyName ( const std::string &  processName,
const std::string &  componentName 
)
static

Generate unique name of a proxy component

ConnectionIDType mtsManagerGlobal::GetConnectionID ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  interfaceName 
) const
protected

Get connection id that the required interface specified involves in

mtsConnection* mtsManagerGlobal::GetConnectionInformation ( const ConnectionIDType  connectionID)
protected

Get connection information using connection id

ConnectionIDListType* mtsManagerGlobal::GetConnectionsOfInterfaceProvidedOrOutput ( const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  interfaceName 
) const
protected

Get connection information about provided interface specified

ConnectionIDListType* mtsManagerGlobal::GetConnectionsOfInterfaceProvidedOrOutput ( const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  interfaceName,
InterfaceMapType **  interfaceMap 
) const
protected
ConnectionIDListType* mtsManagerGlobal::GetConnectionsOfInterfaceRequiredOrInput ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  interfaceName 
) const
protected

Get connection information about required interface specified

ConnectionIDListType* mtsManagerGlobal::GetConnectionsOfInterfaceRequiredOrInput ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  interfaceName,
InterfaceMapType **  interfaceMap 
) const
protected
void mtsManagerGlobal::GetDescriptionOfCommand ( const std::string &  processName,
const std::string &  componentName,
const std::string &  providedInterfaceName,
const std::string &  commandName,
std::string &  description 
) const

Get description of a command in a provided interface

void mtsManagerGlobal::GetDescriptionOfEventGenerator ( const std::string &  processName,
const std::string &  componentName,
const std::string &  providedInterfaceName,
const std::string &  eventGeneratorName,
std::string &  description 
) const

Get description of an event generator in a provided interface

void mtsManagerGlobal::GetDescriptionOfEventHandler ( const std::string &  processName,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
const std::string &  eventHandlerName,
std::string &  description 
) const

Get description of a function in a required interface

void mtsManagerGlobal::GetDescriptionOfFunction ( const std::string &  processName,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
const std::string &  functionName,
std::string &  description 
) const

Get description of a function in a required interface

bool mtsManagerGlobal::GetInterfaceProvidedProxyAccessInfo ( const ConnectionIDType  connectionID,
std::string &  endpointInfo 
)
virtual

Get access information of interface proxy server

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::GetInterfaceProvidedProxyAccessInfo ( const std::string &  clientProcessName,
const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  serverInterfaceProvidedName,
std::string &  endpointInfo 
)
virtual

Get access information of the provided interface proxy.

Parameters
clientProcessNameName of client process
serverProcessNameName of server process
serverComponentNameName of server component
serverInterfaceProvidedNameName of server provided interface
endpointInfoaccess information of provided interface proxy

Implements mtsManagerGlobalInterface.

static const std::string mtsManagerGlobal::GetInterfaceUID ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName 
)
static

Generate unique representation of interface as string

std::vector<std::string> mtsManagerGlobal::GetIPAddress ( void  ) const

Return IP address of this machine.

void mtsManagerGlobal::GetIPAddress ( std::vector< std::string > &  ipAddresses) const
void mtsManagerGlobal::GetListOfConnections ( std::vector< mtsDescriptionConnection > &  list) const
virtual

Get a list of all active connections represented by a set of strings

Implements mtsManagerGlobalInterface.

static std::string mtsManagerGlobal::GetName ( void  )
inlinestatic

Return the name of the global component manager (for mtsProxyBaseCommon.h)

void mtsManagerGlobal::GetNamesOfCommands ( const std::string &  processName,
const std::string &  componentName,
const std::string &  providedInterfaceName,
std::vector< std::string > &  namesOfCommands 
) const

Get names of all commands in a provided interface

void mtsManagerGlobal::GetNamesOfComponents ( const std::string &  processName,
std::vector< std::string > &  namesOfComponents 
) const

Get names of all components in a process

void mtsManagerGlobal::GetNamesOfEventGenerators ( const std::string &  processName,
const std::string &  componentName,
const std::string &  providedInterfaceName,
std::vector< std::string > &  namesOfEventGenerators 
) const

Get names of all event generators in a provided interface

void mtsManagerGlobal::GetNamesOfEventHandlers ( const std::string &  processName,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
std::vector< std::string > &  namesOfEventHandlers 
) const

Get names of all event handlers in a required interface

void mtsManagerGlobal::GetNamesOfFunctions ( const std::string &  processName,
const std::string &  componentName,
const std::string &  requiredInterfaceName,
std::vector< std::string > &  namesOfFunctions 
) const

Get names of all functions in a required interface

void mtsManagerGlobal::GetNamesOfInterfacesProvidedOrOutput ( const std::string &  processName,
const std::string &  componentName,
std::vector< std::string > &  namesOfInterfacesProvided 
) const

Get names of all provided interfaces in a component

void mtsManagerGlobal::GetNamesOfInterfacesRequiredOrInput ( const std::string &  processName,
const std::string &  componentName,
std::vector< std::string > &  namesOfInterfacesRequired 
) const

Get names of all required interfaces in a component

void mtsManagerGlobal::GetNamesOfProcesses ( std::vector< std::string > &  namesOfProcesses) const

Get names of all processes

int mtsManagerGlobal::GetNumberOfInterfaces ( const std::string &  processName,
const std::string &  componentName,
const bool  includeInternalInterface = true 
) const
protected

Get total number of interfaces a component manages

mtsManagerLocalInterface* mtsManagerGlobal::GetProcessObject ( const std::string &  processName) const

Get a process object (local component manager object)

bool mtsManagerGlobal::InitiateConnect ( const ConnectionIDType  connectionID)
virtual

Initiate connection process.

Parameters
connectionIDConnection id issued by GCM's Connect().
Returns
True if success, false otherwise
Note
Let a client process initiate connection process. When mtsLocalManager::Connect() is called at the server side, the server process internally calls this method to let the client process initiate connection process.

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::IsAlreadyConnected ( const mtsDescriptionConnection description) const
protected

Check if two interfaces are connected

static bool mtsManagerGlobal::IsProxyComponent ( const std::string &  componentName)
static

Check if component is proxy based on its name

bool mtsManagerGlobal::RemoveComponent ( const std::string &  processName,
const std::string &  componentName,
const bool  lock = true 
)
virtual

Remove component.

Parameters
processNameName of process
componentNameName of component

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::RemoveConnectionOfInterfaceProvidedOrOutput ( const std::string &  serverProcessName,
const std::string &  serverComponentName,
const std::string &  interfaceName,
const ConnectionIDType  connectionID 
)
protected

Remove connection id from specified interface

bool mtsManagerGlobal::RemoveConnectionOfInterfaceRequiredOrInput ( const std::string &  clientProcessName,
const std::string &  clientComponentName,
const std::string &  interfaceName,
const ConnectionIDType  connectionID 
)
protected
bool mtsManagerGlobal::RemoveInterfaceProvidedOrOutput ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName,
const bool  lock = true 
)
virtual

Remove provided interface. Can be called at run-time.

Parameters
processNameName of process
componentNameName of component
interfaceNameName of provided interface to be removed

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::RemoveInterfaceRequiredOrInput ( const std::string &  processName,
const std::string &  componentName,
const std::string &  interfaceName,
const bool  lock = true 
)
virtual

Remove required interface. Can be called at run-time.

Parameters
processNameName of process
componentNameName of component
interfaceNameName of required interface to be removed

Implements mtsManagerGlobalInterface.

bool mtsManagerGlobal::RemoveProcess ( const std::string &  processName,
const bool  networkDisconnect = false 
)
virtual

Remove process.

Parameters
processNameName of process

Implements mtsManagerGlobalInterface.

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

Set access information of interface proxy server

Implements mtsManagerGlobalInterface.

void mtsManagerGlobal::SetMCS ( mtsManagerComponentServer mcs)
inline
void mtsManagerGlobal::ShowInternalStructure ( void  )
protected

Prints out ProcessMap in human readable format

bool mtsManagerGlobal::StartServer ( void  )

Start network proxy server. The server's listening port number is fetched from config.server file (default port: 10705)

bool mtsManagerGlobal::StopServer ( void  )

Stop network proxy server

void* mtsManagerGlobal::ThreadDisconnectProcess ( void *  arg)
protected

Friends And Related Function Documentation

friend class mtsManagerGlobalTest
friend
friend class mtsManagerLocalTest
friend

Member Data Documentation

osaMutex mtsManagerGlobal::ConnectionChange
protected
ConnectionIDType mtsManagerGlobal::ConnectionID
protected

Counter to issue a new connection ID

ConnectionMapType mtsManagerGlobal::ConnectionMap
protected
osaMutex mtsManagerGlobal::ConnectionMapChange
protected
DisconnectedProcessCleanupMapType mtsManagerGlobal::DisconnectedProcessCleanupMap
protected
osaMutex mtsManagerGlobal::DisconnectedProcessCleanupMapChange
protected
mtsManagerLocal* mtsManagerGlobal::LocalManager
protected

Instance of connected local component manager. Note that the global component manager communicates with the only one instance of mtsManagerLocalInterface regardless of connection type (standalone or network mode)

MJ: (8/20/10) To support a local connection between the global component manager and a local component manager on the same process, this assumption is slightly modified such that the GCM can have two different types of connection with LCM – local and remote. When the GCM executes commands, it checks if it has a local connection to the LCM on the same process and, if yes, it sends the command to the local LCM. If not, it delivers the command to a remote LCM same as before.

mtsManagerLocalInterface* mtsManagerGlobal::LocalManagerConnected
protected
mtsManagerComponentServer* mtsManagerGlobal::ManagerComponentServer
protected

For dynamic component composition feature

ProcessMapType mtsManagerGlobal::ProcessMap
protected
osaMutex mtsManagerGlobal::ProcessMapChange
protected

Mutex for thread-safe processing

mtsManagerProxyServer* mtsManagerGlobal::ProxyServer
protected

Network proxy server

DisconnectQueueType mtsManagerGlobal::QueueDisconnected
protected
osaMutex mtsManagerGlobal::QueueDisconnectedChange
protected
DisconnectQueueType mtsManagerGlobal::QueueDisconnectWaiting
protected
osaMutex mtsManagerGlobal::QueueDisconnectWaitingChange
protected
osaThread mtsManagerGlobal::ThreadDisconnect
protected
osaThreadSignal mtsManagerGlobal::ThreadDisconnectFinished
protected
bool mtsManagerGlobal::ThreadDisconnectRunning
protected

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