32#ifndef _mtsManagerLocal_h
33#define _mtsManagerLocal_h
49class ManagerLocalComponent;
57 std::set<std::string> ValidComponentTags;
59 std::set<std::string> ValidInterfaceTags;
70 std::string ProcessName;
82 bool LogThreadFinishWaiting;
83 void* LogDispatchThread(
void * arg);
106 const std::string & componentName,
107 const std::string & interfaceName,
113 const std::string & componentName,
114 const std::string & interfaceName,
172 const std::string & constructorArgSerialized);
185 bool ConfigureJSON(
const std::string & filename);
186 bool ConfigureJSON(
const std::list<std::string> & filenames);
194 bool ConfigureJSON(
const Json::Value & configuration,
const cmnPath & configPath);
202 bool ConfigureComponentJSON(
const Json::Value & componentConfiguration,
const cmnPath & configPath);
207 bool ConfigureConnectionJSON(
const Json::Value & connectionConfiguration);
216 mtsComponent * CreateComponentDynamicallyJSON(
const std::string & sharedLibrary,
217 const std::string & className,
218 const std::string & constructorArgSerialized);
283 bool Connect(
const std::string & clientComponentName,
const std::string & clientInterfaceRequiredName,
284 const std::string & serverComponentName,
const std::string & serverInterfaceProvidedName);
308 bool Connect(
const std::string & clientProcessName,
const std::string & clientComponentName,
309 const std::string & clientInterfaceRequiredName,
310 const std::string & serverProcessName,
const std::string & serverComponentName,
311 const std::string & serverInterfaceProvidedName);
316 bool Disconnect(
const std::string & clientComponentName,
const std::string & clientInterfaceRequiredName,
317 const std::string & serverComponentName,
const std::string & serverInterfaceProvidedName);
319 bool Disconnect(
const std::string & clientProcessName,
const std::string & clientComponentName,
320 const std::string & clientInterfaceRequiredName,
321 const std::string & serverProcessName,
const std::string & serverComponentName,
322 const std::string & serverInterfaceProvidedName);
340 std::vector<std::string>& namesOfComponents)
const;
345 const std::string & componentName,
346 std::vector<std::string> & namesOfInterfacesRequired,
347 std::vector<std::string> & namesOfInterfacesProvided)
const;
350 std::vector<std::string> & namesOfInterfacesRequired,
351 std::vector<std::string> & namesOfInterfacesProvided)
const
352 {
return GetNamesOfInterfaces(
"", componentName, namesOfInterfacesRequired, namesOfInterfacesProvided); }
355 const std::string & componentName,
356 std::vector<mtsDescriptionInterfaceFullName> & descriptionsRequired,
357 std::vector<mtsDescriptionInterfaceFullName> & descriptionsProvided)
const;
360 std::vector<mtsDescriptionInterfaceFullName> & descriptionsRequired,
361 std::vector<mtsDescriptionInterfaceFullName> & descriptionsProvided)
const
369 const std::string & componentName,
const std::string & interfaceName)
const;
375 const std::string & componentName,
const std::string & interfaceName)
const;
403 const std::string & componentName,
404 const std::string & providedInterfaceName);
408 const std::string & componentName,
409 const std::string & providedInterfaceName);
413 const std::string & componentName,
414 const std::string & requiredInterfaceName);
418 const std::string & componentName,
419 const std::string & requiredInterfaceName);
423 const std::string & componentName,
424 const std::string & providedInterfaceName,
425 const std::string & commandName);
429 const std::string & componentName,
430 const std::string & providedInterfaceName,
431 const std::string & eventGeneratorName);
435 const std::string & componentName,
436 const std::string & requiredInterfaceName,
437 const std::string & functionName);
441 const std::string & componentName,
442 const std::string & requiredInterfaceName,
443 const std::string & eventHandlerName);
Base class for high level objects.
Definition cmnGenericObject.h:53
Search path to find a file. This class contains a list of directories used to locate a file.
Definition cmnPath.h:66
Definition mtsComponent.h:150
Definition mtsComponentState.h:34
Base class for data object in cisstMultiTask.
Definition mtsGenericObject.h:52
Definition mtsInterfaceCommon.h:888
Definition mtsInterfaceCommon.h:1007
Definition mtsManagerComponent.h:48
Definition mtsManagerComponentServices.h:52
Definition mtsManagerLocal.h:52
void GetDescriptionOfCommand(std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &commandName)
std::vector< std::string > GetNamesOfComponents(void) const
bool CreateManagerComponent(void)
Create internal manager component.
void GetNamesOfEventGenerators(std::vector< std::string > &namesOfEventGenerators, const std::string &componentName, const std::string &providedInterfaceName)
void SetMainThreadId(void)
Definition mtsManagerLocal.h:389
void GetNamesOfComponents(const std::string &processName, std::vector< std::string > &namesOfComponents) const
void AddValidInterfaceTag(const std::string &tag)
std::vector< mtsDescriptionComponent > GetDescriptionsOfComponents(const std::string &processName="") const
const std::string CISST_DEPRECATED GetName(void) const
Definition mtsManagerLocal.h:142
mtsInterfaceRequiredDescription GetInterfaceRequiredDescription(const std::string &processName, const std::string &componentName, const std::string &interfaceName) const
bool RemoveComponent(const std::string &componentName)
bool KillAllAndWait(double timeoutInSeconds)
const osaTimeServer & GetTimeServer(void) const
bool WaitForStateAll(mtsComponentState desiredState, double timeout=3.0 *cmn_minute) const
mtsComponent * 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. In this method,...
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)
Connect two remote interfaces.
void GetInterfaceProvidedDescription(const std::string &componentName, const std::string &interfaceName, mtsInterfaceProvidedDescription &interfaceProvidedDescription)
bool Disconnect(const ConnectionIDType connectionID)
mtsComponent CISST_DEPRECATED * GetDevice(const std::string &deviceName)
static void GetIPAddressList(std::vector< std::string > &ipAddresses)
bool RemoveComponent(mtsComponent *component)
Remove component from component manager.
bool Disconnect(const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
void StartAll(void)
Start all components. If a component is of type mtsTask, mtsTask::Start() is called internally.
void GetInterfaceRequiredDescription(const std::string &componentName, const std::string &interfaceName, mtsInterfaceRequiredDescription &interfaceRequiredDescription)
void GetNamesOfProcesses(std::vector< std::string > &namesOfProcesses) const
static std::vector< std::string > GetIPAddressList(void)
void GetNamesOfFunctions(std::vector< std::string > &namesOfFunctions, const std::string &componentName, const std::string &requiredInterfaceName)
const mtsManagerComponentServices * GetManagerComponentServices() const
void AddValidComponentTag(const std::string &tag)
void Cleanup(void)
Cleanup. Left in the public API for backwards compatibility. Client code should not call this method ...
void DestroyManagerComponent(void)
Destroy internal manager component.
void CreateAll(void)
Create all components. If a component is of type mtsTask, mtsTask::Create() is called internally.
bool GetDescriptionsOfInterfaces(const std::string &componentName, std::vector< mtsDescriptionInterfaceFullName > &descriptionsRequired, std::vector< mtsDescriptionInterfaceFullName > &descriptionsProvided) const
Definition mtsManagerLocal.h:359
void GetNamesOfComponents(std::vector< std::string > &namesOfComponents) const
static void DeleteInstance(void)
DeleteInstance. Since a local component manager is a singleton, and demand-created by the first calle...
const ManagerLocalComponent * GetLoggerServices() const
bool StartAllAndWait(double timeoutInSeconds)
std::string CISST_DEPRECATED GetIPAddress(void) const
Definition mtsManagerLocal.h:446
const std::set< std::string > & GetValidInterfaceTags(void) const
static bool GetLogForwardingState(void)
bool AddComponent(mtsComponent *component)
Add a component to the component manager.
virtual ~mtsManagerLocal()
static bool IsLogForwardingEnabled(void)
static void SetLogForwarding(bool activate)
bool FindComponent(const std::string &componentName) const
Check if a component exists by its name.
const std::string GetProcessName(void) const
Definition mtsManagerLocal.h:329
mtsInterfaceRequiredDescription GetInterfaceRequiredDescription(const std::string &componentName, const std::string &interfaceName) const
Definition mtsManagerLocal.h:376
bool IsValidInterfaceTag(const std::string &tag) const
bool CreateAllAndWait(double timeoutInSeconds)
void GetNamesOfCommands(std::vector< std::string > &namesOfCommands, const std::string &componentName, const std::string &providedInterfaceName)
mtsComponent * GetComponent(const std::string &componentName) const
Retrieve a component by name.
void SetMainThreadId(const osaThreadId &threadId)
Definition mtsManagerLocal.h:394
mtsComponent * CreateComponentDynamically(const std::string &className, const mtsGenericObject &constructorArg)
Create a component. Does not add it to the local component manager. In this method,...
void GetNamesOfEventHandlers(std::vector< std::string > &namesOfEventHandlers, const std::string &componentName, const std::string &requiredInterfaceName)
static bool CISST_DEPRECATED IsLogAllowed(void)
void GetDescriptionOfEventHandler(std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &eventHandlerName)
bool GetDescriptionsOfInterfaces(const std::string &processName, const std::string &componentName, std::vector< mtsDescriptionInterfaceFullName > &descriptionsRequired, std::vector< mtsDescriptionInterfaceFullName > &descriptionsProvided) const
mtsTask * GetComponentAsTask(const std::string &componentName) const
static void LogDispatcher(const char *str, int len)
bool GetNamesOfInterfaces(const std::string &processName, const std::string &componentName, std::vector< std::string > &namesOfInterfacesRequired, std::vector< std::string > &namesOfInterfacesProvided) const
mtsTask CISST_DEPRECATED * GetTask(const std::string &taskName)
static void GetLogForwardingState(bool &state)
std::vector< mtsDescriptionComponentClass > GetListOfComponentClasses(const std::string &processName="") const
bool Connect(const std::string &clientComponentName, const std::string &clientInterfaceRequiredName, const std::string &serverComponentName, const std::string &serverInterfaceProvidedName)
Connect two local interfaces.
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)
void GetDescriptionOfFunction(std::string &description, const std::string &componentName, const std::string &requiredInterfaceName, const std::string &functionName)
bool GetNamesOfInterfaces(const std::string &componentName, std::vector< std::string > &namesOfInterfacesRequired, std::vector< std::string > &namesOfInterfacesProvided) const
Definition mtsManagerLocal.h:349
static mtsManagerLocal * GetInstance(void)
size_t RemoveAllUserComponents(void)
Remove all user components from this local component manager.
mtsInterfaceProvidedDescription GetInterfaceProvidedDescription(const std::string &componentName, const std::string &interfaceName) const
Definition mtsManagerLocal.h:371
bool CISST_DEPRECATED AddTask(mtsTask *component)
void KillAll(void)
Stop all components. If a component is of type mtsTask, mtsTask::Kill() is called internally.
ManagerLocalComponent * LocalComponent
Definition mtsManagerLocal.h:102
mtsInterfaceProvidedDescription GetInterfaceProvidedDescription(const std::string &processName, const std::string &componentName, const std::string &interfaceName) const
void SetupSystemLogger(void)
bool IsValidComponentTag(const std::string &tag) const
osaThreadId GetMainThreadId(void) const
Definition mtsManagerLocal.h:397
std::vector< mtsDescriptionConnection > GetListOfConnections(void) const
const std::set< std::string > & GetValidComponentTags(void) const
void GetDescriptionOfEventGenerator(std::string &description, const std::string &componentName, const std::string &providedInterfaceName, const std::string &eventGeneratorName)
bool CISST_DEPRECATED AddDevice(mtsComponent *component)
Define a thread object.
Definition osaThread.h:168
ThreadId type.
Definition osaThread.h:77
Definition osaThreadSignal.h:41
Class for relative time.
Definition osaTimeServer.h:74
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
const int CMN_NO_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:325
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
#define CISST_DEPRECATED
Definition cmnPortability.h:314
Declaration of units and unit conversion methods.
const double cmn_minute
Definition cmnUnits.h:217
Declaration of mtsComponent.
Forward declarations and #define for cisstMultiTask.
unsigned int ConnectionIDType
Definition mtsForwardDeclarations.h:149
Declaration of osaThread.
CISST_EXPORT osaThreadId osaGetCurrentThreadId(void)