19#ifndef _mtsManagerComponentServices_h
20#define _mtsManagerComponentServices_h
47 void ToStream(std::ostream & outputStream)
const override;
74 } ServiceComponentManagement;
98 bool CheckAndWait(
const std::vector<std::string> &list,
const std::string &key,
double &timeoutInSec,
111 template <
class __
classType>
113 __classType * classInstantiation,
116 return (
EventReceivers.AddComponent.SetHandler(method, classInstantiation, queueingPolicy) != 0);
119 template <
class __
classType>
121 __classType * classInstantiation,
124 return (
EventReceivers.AddConnection.SetHandler(method, classInstantiation, queueingPolicy) != 0);
127 template <
class __
classType>
129 __classType * classInstantiation,
132 return (
EventReceivers.RemoveConnection.SetHandler(method, classInstantiation, queueingPolicy) != 0);
135 template <
class __
classType>
137 __classType * classInstantiation,
140 return (
EventReceivers.ChangeState.SetHandler(method, classInstantiation, queueingPolicy) != 0);
146 bool ComponentCreate(
const std::string & className,
const std::string & componentName)
const;
148 const std::string & componentName)
const;
152 const std::string& processName,
const std::string & className,
const mtsGenericObject & constructorArg)
const;
161 const std::string& processName,
const std::string & componentName,
const std::string & configString)
const;
163 bool Connect(
const std::string & clientComponentName,
const std::string & clientInterfaceName,
164 const std::string & serverComponentName,
const std::string & serverInterfaceName)
const;
165 bool Connect(
const std::string & clientProcessName,
166 const std::string & clientComponentName,
const std::string & clientInterfaceName,
167 const std::string & serverProcessName,
168 const std::string & serverComponentName,
const std::string & serverInterfaceName)
const;
172 const std::string & clientComponentName,
const std::string & clientInterfaceName,
173 const std::string & serverComponentName,
const std::string & serverInterfaceName)
const;
175 const std::string & clientProcessName,
176 const std::string & clientComponentName,
const std::string & clientInterfaceName,
177 const std::string & serverProcessName,
178 const std::string & serverComponentName,
const std::string & serverInterfaceName)
const;
182 bool ComponentStart(
const std::string & componentName,
const double delayInSecond)
const;
185 bool ComponentStart(
const std::string& processName,
const std::string & componentName,
186 const double delayInSecond)
const;
187 bool ComponentStart(
const std::string& processName,
const std::string & componentName)
const
191 bool ComponentStop(
const std::string & componentName,
const double delayInSecond)
const;
194 bool ComponentStop(
const std::string& processName,
const std::string & componentName,
195 const double delayInSecond)
const;
196 bool ComponentStop(
const std::string& processName,
const std::string & componentName)
const
199 bool ComponentResume(
const std::string & componentName,
const double delayInSecond = 0.0)
const;
200 bool ComponentResume(
const std::string& processName,
const std::string & componentName,
201 const double delayInSecond = 0.0)
const;
205 std::string
ComponentGetState(
const std::string & processName,
const std::string componentName)
const;
213 const std::string & componentName,
214 std::vector<std::string> & namesOfInterfacesRequired,
215 std::vector<std::string> & namesOfInterfacesProvided)
const;
218 const std::string & componentName,
219 std::vector<mtsDescriptionInterfaceFullName> & descriptionsRequired,
220 std::vector<mtsDescriptionInterfaceFullName> & descriptionsProvided)
const;
228 const std::string & componentName,
const std::string & interfaceName)
const;
244 const std::string & componentName,
const std::string & interfaceName)
const;
258 bool Load(
const std::string & fileName)
const;
260 bool Load(
const std::string & processName,
const std::string & fileName)
const;
265 bool WaitFor(
const std::string & processName,
double timeoutInSec = -1.0);
266 bool WaitFor(
const std::string & processName,
const std::string & componentName,
double timeoutInSec = -1.0);
267 bool WaitFor(
const std::string & processName,
const std::string & componentName,
const std::string & state,
268 double timeoutInSec = -1.0);
Base class for high level objects.
Definition cmnGenericObject.h:53
Definition mtsComponent.h:150
Definition mtsManagerComponentServices.h:36
void ToStream(std::ostream &outputStream) const override
~mtsComponentPointer()
Definition mtsManagerComponentServices.h:43
void DeSerializeRaw(std::istream &inputStream) override
mtsComponentPointer(mtsComponent *cptr)
Definition mtsManagerComponentServices.h:42
mtsComponentPointer()
Definition mtsManagerComponentServices.h:41
mtsComponent * GetPointer() const
Definition mtsManagerComponentServices.h:45
void SetPointer(mtsComponent *cptr)
Definition mtsManagerComponentServices.h:44
void SerializeRaw(std::ostream &outputStream) const override
Definition mtsParameterTypes.h:869
Definition mtsComponentState.h:34
Definition mtsParameterTypes.h:58
Definition mtsParameterTypes.h:624
Definition mtsParameterTypes.h:397
std::string ProcessName
Definition mtsParameterTypes.h:407
std::string InterfaceName
Definition mtsParameterTypes.h:413
std::string ComponentName
Definition mtsParameterTypes.h:410
Definition mtsEventReceiver.h:221
Definition mtsFunctionQualifiedRead.h:37
Definition mtsFunctionRead.h:37
Definition mtsFunctionWrite.h:37
Definition mtsFunctionWriteReturn.h:38
Base class for data object in cisstMultiTask.
Definition mtsGenericObject.h:52
mtsGenericObject(void)
Definition mtsGenericObject.h:77
Definition mtsInterfaceCommon.h:888
Definition mtsInterfaceCommon.h:1007
Definition mtsInterfaceRequired.h:83
const mtsInterfaceProvided * GetConnectedInterface(void) const
Definition mtsManagerComponentServices.h:52
mtsInterfaceProvidedDescription GetInterfaceProvidedDescription(const std::string &componentName, const std::string &interfaceName) const
Definition mtsManagerComponentServices.h:231
bool ComponentRemove(const mtsComponent *component) const
std::string ComponentGetState(const std::string componentName) const
mtsComponentState ComponentGetState(const mtsDescriptionComponent &component) const
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) const
std::vector< std::string > GetNamesOfComponents(const std::string &processName) const
bool ComponentResume(const std::string &componentName, const double delayInSecond=0.0) const
std::vector< std::string > GetNamesOfComponents(void) const
Definition mtsManagerComponentServices.h:209
bool ChangeStateEventHandler(void(__classType::*method)(const mtsComponentStateChange &), __classType *classInstantiation, mtsEventQueueingPolicy queueingPolicy=MTS_INTERFACE_EVENT_POLICY)
Definition mtsManagerComponentServices.h:136
mtsInterfaceProvidedDescription GetInterfaceProvidedDescription(const std::string &processName, const std::string &componentName, const std::string &interfaceName) const
bool Disconnect(const std::string &clientComponentName, const std::string &clientInterfaceName, const std::string &serverComponentName, const std::string &serverInterfaceName) const
bool Disconnect(ConnectionIDType connectionID) const
bool Load(const std::string &fileName) const
mtsInterfaceRequiredDescription GetInterfaceRequiredDescription(const mtsDescriptionInterfaceFullName &interfaceDescription) const
Definition mtsManagerComponentServices.h:251
bool AddConnectionEventHandler(void(__classType::*method)(const mtsDescriptionConnection &), __classType *classInstantiation, mtsEventQueueingPolicy queueingPolicy=MTS_INTERFACE_EVENT_POLICY)
Definition mtsManagerComponentServices.h:120
bool Connect(const std::string &clientProcessName, const std::string &clientComponentName, const std::string &clientInterfaceName, const std::string &serverProcessName, const std::string &serverComponentName, const std::string &serverInterfaceName) const
bool GetDescriptionsOfInterfaces(const std::string &processName, const std::string &componentName, std::vector< mtsDescriptionInterfaceFullName > &descriptionsRequired, std::vector< mtsDescriptionInterfaceFullName > &descriptionsProvided) const
bool ComponentResume(const std::string &processName, const std::string &componentName, const double delayInSecond=0.0) const
bool ComponentCreate(const std::string &className, const std::string &componentName) const
bool WaitFor(const std::string &processName, const std::string &componentName, const std::string &state, double timeoutInSec=-1.0)
mtsInterfaceRequired * InternalInterfaceRequired
Definition mtsManagerComponentServices.h:57
std::vector< mtsDescriptionComponent > GetDescriptionsOfComponents(const std::string &processName) const
bool ComponentStop(const std::string &componentName) const
Definition mtsManagerComponentServices.h:192
bool ComponentStart(const std::string &processName, const std::string &componentName, const double delayInSecond) const
mtsInterfaceRequiredDescription GetInterfaceRequiredDescription(const std::string &processName, const std::string &componentName, const std::string &interfaceName) const
bool ComponentConfigure(const std::string &componentName, const std::string &configString) const
bool ComponentStart(const std::string &processName, const std::string &componentName) const
Definition mtsManagerComponentServices.h:187
bool ComponentConfigure(const std::string &processName, const std::string &componentName, const std::string &configString) const
mtsInterfaceRequiredDescription GetInterfaceRequiredDescription(const std::string &componentName, const std::string &interfaceName) const
Definition mtsManagerComponentServices.h:246
bool Load(const std::string &processName, const std::string &fileName) const
bool ComponentStop(const std::string &processName, const std::string &componentName, const double delayInSecond) const
std::vector< mtsDescriptionConnection > GetListOfConnections(void) const
bool Disconnect(const mtsDescriptionConnection &connection) const
bool ComponentRemove(const std::string &componentName) const
std::vector< mtsDescriptionComponentClass > GetListOfComponentClasses(const std::string &processName="") const
bool ComponentStop(const std::string &componentName, const double delayInSecond) const
bool RemoveConnectionEventHandler(void(__classType::*method)(const mtsDescriptionConnection &), __classType *classInstantiation, mtsEventQueueingPolicy queueingPolicy=MTS_INTERFACE_EVENT_POLICY)
Definition mtsManagerComponentServices.h:128
bool ComponentStop(const std::string &processName, const std::string &componentName) const
Definition mtsManagerComponentServices.h:196
bool InitializeInterfaceInternalRequired(void)
std::string ComponentGetState(const std::string &processName, const std::string componentName) const
~mtsManagerComponentServices()
Definition mtsManagerComponentServices.h:102
bool ComponentCreate(const std::string &processName, const std::string &className, const mtsGenericObject &constructorArg) const
bool AddComponentEventHandler(void(__classType::*method)(const mtsDescriptionComponent &), __classType *classInstantiation, mtsEventQueueingPolicy queueingPolicy=MTS_INTERFACE_EVENT_POLICY)
Definition mtsManagerComponentServices.h:112
bool ComponentStart(const std::string &componentName) const
Definition mtsManagerComponentServices.h:183
bool Connect(const std::string &clientComponentName, const std::string &clientInterfaceName, const std::string &serverComponentName, const std::string &serverInterfaceName) const
struct mtsManagerComponentServices::EventStruct EventReceivers
std::vector< std::string > GetNamesOfProcesses(void) const
bool ComponentCreate(const std::string &className, const mtsGenericObject &constructorArg) const
bool WaitFor(const std::string &processName, double timeoutInSec=-1.0)
mtsComponent * ComponentGet(const std::string &componentName) const
bool CheckAndWait(const std::vector< std::string > &list, const std::string &key, double &timeoutInSec, mtsEventReceiverWrite &eventReceiver)
mtsManagerComponentServices(mtsInterfaceRequired *internalInterfaceRequired)
bool Connect(const mtsDescriptionConnection &connection) const
bool ComponentAdd(const mtsComponent *component) const
bool ComponentStart(const std::string &componentName, const double delayInSecond) const
bool GetNamesOfInterfaces(const std::string &processName, const std::string &componentName, std::vector< std::string > &namesOfInterfacesRequired, std::vector< std::string > &namesOfInterfacesProvided) const
bool WaitFor(const std::string &processName, const std::string &componentName, double timeoutInSec=-1.0)
mtsInterfaceProvidedDescription GetInterfaceProvidedDescription(const mtsDescriptionInterfaceFullName &interfaceDescription) const
Definition mtsManagerComponentServices.h:236
bool IsConnected(void) const
Definition mtsManagerComponentServices.h:106
bool ComponentCreate(const std::string &processName, const std::string &className, const std::string &componentName) const
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
const int CMN_NO_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:325
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition cmnClassRegisterMacros.h:113
const int CMN_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:328
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
Declaration of mtsEventReceiverBase, mtsEventReceiverVoid, and mtsEventReceiverWrite.
mtsEventQueueingPolicy
Definition mtsForwardDeclarations.h:48
@ MTS_INTERFACE_EVENT_POLICY
Definition mtsForwardDeclarations.h:48
unsigned int ConnectionIDType
Definition mtsForwardDeclarations.h:149
Defines the command interfaces.
Defines the command interfaces.
Defines the command interfaces.
Declaration of mtsInterfaceRequired.
Declaration of Base Class for Manager Components.
Definition mtsManagerComponentServices.h:90
mtsEventReceiverWrite AddComponent
Definition mtsManagerComponentServices.h:91
mtsEventReceiverWrite AddConnection
Definition mtsManagerComponentServices.h:92
mtsEventReceiverWrite ChangeState
Definition mtsManagerComponentServices.h:94
mtsEventReceiverWrite RemoveConnection
Definition mtsManagerComponentServices.h:93
Definition mtsManagerComponentServices.h:77
mtsFunctionQualifiedRead GetNamesOfInterfaces
Definition mtsManagerComponentServices.h:81
mtsFunctionQualifiedRead GetDescriptionsOfInterfaces
Definition mtsManagerComponentServices.h:82
mtsFunctionRead GetNamesOfProcesses
Definition mtsManagerComponentServices.h:78
mtsFunctionQualifiedRead GetInterfaceProvidedDescription
Definition mtsManagerComponentServices.h:85
mtsFunctionQualifiedRead GetListOfComponentClasses
Definition mtsManagerComponentServices.h:84
mtsFunctionQualifiedRead GetInterfaceRequiredDescription
Definition mtsManagerComponentServices.h:86
mtsFunctionRead GetListOfConnections
Definition mtsManagerComponentServices.h:83
mtsFunctionQualifiedRead GetNamesOfComponents
Definition mtsManagerComponentServices.h:79
mtsFunctionQualifiedRead GetDescriptionsOfComponents
Definition mtsManagerComponentServices.h:80
Definition mtsManagerComponentServices.h:61
mtsFunctionQualifiedRead GetState
Definition mtsManagerComponentServices.h:72
mtsFunctionWriteReturn Add
Definition mtsManagerComponentServices.h:63
mtsFunctionWrite Start
Definition mtsManagerComponentServices.h:69
mtsFunctionWriteReturn Disconnect
Definition mtsManagerComponentServices.h:68
mtsFunctionQualifiedRead LoadLibrary
Definition mtsManagerComponentServices.h:73
mtsFunctionWriteReturn Connect
Definition mtsManagerComponentServices.h:67
mtsFunctionQualifiedRead Get
Definition mtsManagerComponentServices.h:65
mtsFunctionWrite Stop
Definition mtsManagerComponentServices.h:70
mtsFunctionWrite Configure
Definition mtsManagerComponentServices.h:66
mtsFunctionWriteReturn Create
Definition mtsManagerComponentServices.h:62
mtsFunctionWriteReturn Remove
Definition mtsManagerComponentServices.h:64
mtsFunctionWrite Resume
Definition mtsManagerComponentServices.h:71