30 #ifndef _mtsManagerGlobal_h
31 #define _mtsManagerGlobal_h
53 friend class mtsManagerGlobalTest;
54 friend class mtsManagerLocalTest;
159 void * ThreadDisconnectProcess(
void * arg);
171 void ShowInternalStructure(
void);
181 const std::string & serverProcessName,
const std::string & serverComponentName,
182 const std::string & interfaceName)
const;
185 const std::string & serverProcessName,
const std::string & serverComponentName,
190 const std::string & clientProcessName,
const std::string & clientComponentName,
191 const std::string & interfaceName)
const;
194 const std::string & clientProcessName,
const std::string & clientComponentName,
198 bool AddConnectionToInterfaceProvidedOrOutput(
199 const std::string & serverProcessName,
const std::string & serverComponentName,
202 bool AddConnectionToInterfaceRequiredOrInput(
203 const std::string & clientProcessName,
const std::string & clientComponentName,
207 bool RemoveConnectionOfInterfaceProvidedOrOutput(
208 const std::string & serverProcessName,
const std::string & serverComponentName,
211 bool RemoveConnectionOfInterfaceRequiredOrInput(
212 const std::string & clientProcessName,
const std::string & clientComponentName,
217 bool CleanupDisconnectedProcess(
const std::string & nameOfProcessDisconnected);
223 int GetNumberOfInterfaces(
const std::string & processName,
const std::string & componentName,
const bool includeInternalInterface =
true)
const;
227 const std::string & clientComponentName,
const std::string & interfaceName)
const;
235 void DisconnectInternal(
void);
238 void AddToDisconnectedProcessCleanup(
const std::string & sourceProcessName,
239 const std::string & targetProcessName,
const std::string & targetComponentProxyName);
251 bool AddProcess(
const std::string & processName);
255 bool FindProcess(
const std::string & processName)
const;
257 bool RemoveProcess(
const std::string & processName,
const bool networkDisconnect =
false);
262 bool AddComponent(
const std::string & processName,
const std::string & componentName);
264 bool FindComponent(
const std::string & processName,
const std::string & componentName)
const;
266 bool RemoveComponent(
const std::string & processName,
const std::string & componentName,
const bool lock =
true);
271 bool AddInterfaceProvidedOrOutput(
const std::string & processName,
const std::string & componentName,
const std::string & interfaceName);
273 bool AddInterfaceRequiredOrInput(
const std::string & processName,
const std::string & componentName,
const std::string & interfaceName);
275 bool FindInterfaceProvidedOrOutput(
const std::string & processName,
const std::string & componentName,
const std::string & interfaceName)
const;
277 bool FindInterfaceRequiredOrInput(
const std::string & processName,
const std::string & componentName,
const std::string & interfaceName)
const;
279 bool RemoveInterfaceProvidedOrOutput(
const std::string & processName,
const std::string & componentName,
const std::string & interfaceName,
const bool lock =
true);
281 bool RemoveInterfaceRequiredOrInput(
const std::string & processName,
const std::string & componentName,
const std::string & interfaceName,
const bool lock =
true);
287 const std::string & clientProcessName,
const std::string & clientComponentName,
const std::string & clientInterfaceName,
288 const std::string & serverProcessName,
const std::string & serverComponentName,
const std::string & serverInterfaceName);
297 const std::string & clientProcessName,
const std::string & clientComponentName,
const std::string & clientInterfaceName,
298 const std::string & serverProcessName,
const std::string & serverComponentName,
const std::string & serverInterfaceName);
311 return "GlobalComponentManager";
315 std::vector<std::string> GetIPAddress(
void)
const;
316 void GetIPAddress(std::vector<std::string> & ipAddresses)
const;
319 void GetNamesOfProcesses(std::vector<std::string>& namesOfProcesses)
const;
322 void GetNamesOfComponents(
const std::string & processName,
323 std::vector<std::string>& namesOfComponents)
const;
326 void GetNamesOfInterfacesProvidedOrOutput(
const std::string & processName,
327 const std::string & componentName,
328 std::vector<std::string> & namesOfInterfacesProvided)
const;
331 void GetNamesOfInterfacesRequiredOrInput(
const std::string & processName,
332 const std::string & componentName,
333 std::vector<std::string> & namesOfInterfacesRequired)
const;
336 void GetNamesOfCommands(
const std::string & processName,
337 const std::string & componentName,
338 const std::string & providedInterfaceName,
339 std::vector<std::string>& namesOfCommands)
const;
342 void GetNamesOfEventGenerators(
const std::string & processName,
343 const std::string & componentName,
344 const std::string & providedInterfaceName,
345 std::vector<std::string>& namesOfEventGenerators)
const;
348 void GetNamesOfFunctions(
const std::string & processName,
349 const std::string & componentName,
350 const std::string & requiredInterfaceName,
351 std::vector<std::string>& namesOfFunctions)
const;
354 void GetNamesOfEventHandlers(
const std::string & processName,
355 const std::string & componentName,
356 const std::string & requiredInterfaceName,
357 std::vector<std::string>& namesOfEventHandlers)
const;
360 void GetDescriptionOfCommand(
const std::string & processName,
361 const std::string & componentName,
362 const std::string & providedInterfaceName,
363 const std::string & commandName,
364 std::string & description)
const;
367 void GetDescriptionOfEventGenerator(
const std::string & processName,
368 const std::string & componentName,
369 const std::string & providedInterfaceName,
370 const std::string & eventGeneratorName,
371 std::string & description)
const;
374 void GetDescriptionOfFunction(
const std::string & processName,
375 const std::string & componentName,
376 const std::string & requiredInterfaceName,
377 const std::string & functionName,
378 std::string & description)
const;
381 void GetDescriptionOfEventHandler(
const std::string & processName,
382 const std::string & componentName,
383 const std::string & requiredInterfaceName,
384 const std::string & eventHandlerName,
385 std::string & description)
const;
388 static bool IsProxyComponent(
const std::string & componentName);
391 static const std::string GetComponentProxyName(
const std::string & processName,
const std::string & componentName);
397 static const std::string GetInterfaceUID(
398 const std::string & processName,
const std::string & componentName,
const std::string & interfaceName);
405 bool StartServer(
void);
408 bool StopServer(
void);
417 const std::string & serverProcessName,
const std::string & serverComponentName,
418 const std::string & serverInterfaceName, std::string & endpointInfo);
423 void CheckConnectConfirmTimeout(
void);
428 #endif // _mtsManagerGlobal_h
virtual bool ConnectConfirm(const ConnectionIDType connectionID)=0
Confirm that connection has been successfully established.
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
osaMutex ConnectionChange
Definition: mtsManagerGlobal.h:136
Definition: mtsConnection.h:35
virtual bool AddComponent(const std::string &processName, const std::string &componentName)=0
Register component.
bool ThreadDisconnectRunning
Definition: mtsManagerGlobal.h:158
osaMutex QueueDisconnectWaitingChange
Definition: mtsManagerGlobal.h:153
Define a Mutex object.
Definition: osaMutex.h:48
virtual bool Disconnect(const ConnectionIDType connectionID)=0
Disconnect two interfaces.
virtual bool RemoveComponent(const std::string &processName, const std::string &componentName, const bool lock=true)=0
Remove component.
void SetMCS(mtsManagerComponentServer *mcs)
Definition: mtsManagerGlobal.h:246
virtual bool RemoveInterfaceProvidedOrOutput(const std::string &processName, const std::string &componentName, const std::string &interfaceName, const bool lock=true)=0
Remove provided interface. Can be called at run-time.
ProcessMapType ProcessMap
Definition: mtsManagerGlobal.h:106
Definition: mtsManagerGlobalInterface.h:43
mtsManagerLocalInterface * LocalManagerConnected
Definition: mtsManagerGlobal.h:131
virtual bool AddProcess(const std::string &processName)=0
Register process.
Declaration of cmnNamedMap.
osaThread ThreadDisconnect
Definition: mtsManagerGlobal.h:156
std::map< ConnectionIDType, ConnectionIDType > DisconnectQueueType
Definition: mtsManagerGlobal.h:149
Defines connection between two interfaces.
mtsManagerProxyServer * ProxyServer
Definition: mtsManagerGlobal.h:143
unsigned int ConnectionIDType
Definition: mtsForwardDeclarations.h:150
mtsManagerLocal * LocalManager
Definition: mtsManagerGlobal.h:130
cmnNamedMap< ConnectionIDListType > InterfaceMapElementType
Definition: mtsManagerGlobal.h:87
cmnNamedMap< InterfaceMapType > ComponentMapType
Definition: mtsManagerGlobal.h:100
Class register definitions and log macros.
Declaration of osaThread.
Define a thread object.
Definition: osaThread.h:164
ConnectionIDType ConnectionID
Definition: mtsManagerGlobal.h:140
Definition: mtsManagerLocal.h:89
Declaration of mtsManagerGlobalInterfaceThis class declares an interface used by local component mana...
virtual bool AddInterfaceRequiredOrInput(const std::string &processName, const std::string &componentName, const std::string &interfaceName)=0
Register required interface. Can be called at run-time.
virtual bool InitiateConnect(const ConnectionIDType connectionID)=0
Initiate connection process.
virtual bool FindInterfaceProvidedOrOutput(const std::string &processName, const std::string &componentName, const std::string &interfaceName) const =0
Find provided interface using process name, component name, and interface name.
std::map< ConnectionIDType, mtsConnection > ConnectionMapType
Definition: mtsManagerGlobal.h:115
Definition: mtsParameterTypes.h:533
DisconnectedProcessCleanupMapType DisconnectedProcessCleanupMap
Definition: mtsManagerGlobal.h:168
osaMutex ProcessMapChange
Definition: mtsManagerGlobal.h:134
Forward declarations and #define for cisstMultiTask.
static std::string GetName(void)
Definition: mtsManagerGlobal.h:310
mtsManagerComponentServer * ManagerComponentServer
Definition: mtsManagerGlobal.h:146
virtual bool RemoveProcess(const std::string &processName, const bool networkDisconnect)=0
Remove process.
osaMutex DisconnectedProcessCleanupMapChange
Definition: mtsManagerGlobal.h:137
std::list< CleanupElementType > CleanupElementListType
Definition: mtsManagerGlobal.h:166
virtual bool FindComponent(const std::string &processName, const std::string &componentName) const =0
Find component using process name and component name.
ConnectionMapType ConnectionMap
Definition: mtsManagerGlobal.h:116
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
osaMutex QueueDisconnectedChange
Definition: mtsManagerGlobal.h:154
InterfaceMapElementType InterfaceRequiredOrInputMap
Definition: mtsManagerGlobal.h:94
std::string ComponentProxyName
Definition: mtsManagerGlobal.h:164
Definition of mtsManagerLocalInterfaceThis class defines an interface used by the global component ma...
cmnNamedMap< ComponentMapType > ProcessMapType
Definition: mtsManagerGlobal.h:105
cmnNamedMap< CleanupElementListType > DisconnectedProcessCleanupMapType
Definition: mtsManagerGlobal.h:167
Definition: mtsManagerComponentServer.h:45
virtual bool FindProcess(const std::string &processName) const =0
Find process.
Definition: mtsManagerGlobal.h:90
Definition: mtsManagerGlobal.h:162
osaMutex ConnectionMapChange
Definition: mtsManagerGlobal.h:135
std::string ProcessName
Definition: mtsManagerGlobal.h:163
Declaration of osaGetTime.
virtual bool FindInterfaceRequiredOrInput(const std::string &processName, const std::string &componentName, const std::string &interfaceName) const =0
Find required interface using process name, component name, and interface name.
virtual bool ConnectServerSideInterfaceRequest(const ConnectionIDType connectionID)=0
Request the global component manager to connect interfaces at server side.
Definition: osaThreadSignal.h:40
DisconnectQueueType QueueDisconnectWaiting
Definition: mtsManagerGlobal.h:150
virtual void GetListOfConnections(std::vector< mtsDescriptionConnection > &list) const =0
InterfaceMapElementType InterfaceProvidedOrOutputMap
Definition: mtsManagerGlobal.h:93
virtual bool SetInterfaceProvidedProxyAccessInfo(const ConnectionIDType connectionID, const std::string &endpointInfo)=0
Set access information of the provided interface proxy.
std::vector< ConnectionIDType > ConnectionIDListType
Definition: mtsManagerGlobal.h:82
DisconnectQueueType QueueDisconnected
Definition: mtsManagerGlobal.h:151
Definition: mtsManagerGlobal.h:51
virtual ConnectionIDType 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)=0
Connect two interfaces.
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
osaThreadSignal ThreadDisconnectFinished
Definition: mtsManagerGlobal.h:157
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition: cmnClassRegisterMacros.h:202
virtual bool GetInterfaceProvidedProxyAccessInfo(const ConnectionIDType connectionID, std::string &endpointInfo)=0
Get access information of the provided interface proxy.
virtual bool AddInterfaceProvidedOrOutput(const std::string &processName, const std::string &componentName, const std::string &interfaceName)=0
Register provided interface. Can be called at run-time.
Definition: mtsManagerLocalInterface.h:54
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
virtual bool RemoveInterfaceRequiredOrInput(const std::string &processName, const std::string &componentName, const std::string &interfaceName, const bool lock=true)=0
Remove required interface. Can be called at run-time.