20#ifndef _mtsComponentAddLatency_h
21#define _mtsComponentAddLatency_h
30class mtsComponentAddLatencyDelayedRead;
31class mtsComponentAddLatencyDelayedQualifiedRead;
32class mtsComponentAddLatencyDelayedVoid;
33class mtsComponentAddLatencyDelayedWrite;
89 void Configure(
const std::string & filename)
override;
91 void Run(
void)
override;
104 template <
class _elementType>
106 const std::string & commandRequiredName,
108 const std::string & commandProvidedName =
"");
110 template <
class _element1Type,
class _element2Type>
112 const std::string & commandRequiredName,
114 const std::string & commandProvidedName =
"");
118 const std::string & commandRequiredName,
120 const std::string & commandProvidedName =
"");
122 template <
class _elementType>
124 const std::string & commandRequiredName,
126 const std::string & commandProvidedName =
"");
129 const std::string & eventRequiredName,
131 const std::string & eventProvidedName =
"");
133 template <
class _elementType>
135 const std::string & eventRequiredName,
137 const std::string & eventProvidedName =
"");
145 const std::string & commandRequiredName);
147 bool AddCommandQualifiedReadDelayedInternal(
const mtsGenericObject & qualifier,
150 const std::string & commandRequiredName,
152 const std::string & commandProvidedName);
156 const std::string & commandRequiredName,
158 const std::string & commandProvidedName);
162 const std::string & eventRequiredName,
164 const std::string & eventProvidedName =
"");
170template <
class _elementType>
172 const std::string & commandRequiredName,
174 const std::string & commandProvidedName)
179 _elementType * data =
new _elementType;
183 commandProvidedName ==
""
184 ? commandRequiredName
185 : commandProvidedName);
187 this->AddCommandReadDelayedInternal(*data, interfaceRequired, commandRequiredName);
191template <
class _element1Type,
class _element2Type>
193 const std::string & commandRequiredName,
195 const std::string & commandProvidedName)
197 _element1Type qualifier;
198 _element2Type placeHolder;
200 this->AddCommandQualifiedReadDelayedInternal(qualifier,
205 commandProvidedName ==
""
206 ? commandRequiredName
207 : commandProvidedName);
211template <
class _elementType>
213 const std::string & commandRequiredName,
215 const std::string & commandProvidedName)
221 this->AddCommandWriteDelayedInternal(data,
225 commandProvidedName ==
""
226 ? commandRequiredName
227 : commandProvidedName);
231template <
class _elementType>
233 const std::string & eventRequiredName,
235 const std::string & eventProvidedName)
241 this->AddEventWriteDelayedInternal(data,
245 eventProvidedName ==
""
247 : eventProvidedName);
Definition mtsComponentAddLatency.h:65
std::list< mtsComponentAddLatencyDelayedQualifiedRead * > DelayedQualifiedReadList
Definition mtsComponentAddLatency.h:73
std::list< mtsComponentAddLatencyDelayedWrite * > DelayedWriteList
Definition mtsComponentAddLatency.h:79
bool AddCommandVoidDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
void Cleanup(void) override
void Configure(const std::string &filename) override
virtual ~mtsComponentAddLatency()
double Latency
Definition mtsComponentAddLatency.h:139
mtsStateTable LatencyStateTable
Definition mtsComponentAddLatency.h:140
bool AddEventWriteDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &eventRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &eventProvidedName="")
Definition mtsComponentAddLatency.h:232
void Startup(void) override
std::list< mtsComponentAddLatencyDelayedRead * > DelayedReadList
Definition mtsComponentAddLatency.h:70
mtsComponentAddLatency(const mtsTaskPeriodicConstructorArg &arg)
mtsComponentAddLatency(const std::string &componentName, double periodInSeconds)
DelayedVoidList DelayedVoids
Definition mtsComponentAddLatency.h:77
std::list< mtsComponentAddLatencyDelayedVoid * > DelayedVoidList
Definition mtsComponentAddLatency.h:76
double SetLatency(double latencyInSeconds)
bool AddCommandWriteDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
Definition mtsComponentAddLatency.h:212
DelayedQualifiedReadList DelayedQualifiedReads
Definition mtsComponentAddLatency.h:74
bool AddCommandReadDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
Definition mtsComponentAddLatency.h:171
bool AddCommandQualifiedReadDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
Definition mtsComponentAddLatency.h:192
bool AddEventVoidDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &eventRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &eventProvidedName="")
DelayedWriteList DelayedWrites
Definition mtsComponentAddLatency.h:80
DelayedReadList DelayedReads
Definition mtsComponentAddLatency.h:71
Base class for data object in cisstMultiTask.
Definition mtsGenericObject.h:52
Definition mtsInterfaceProvided.h:98
mtsCommandRead * AddCommandReadStateDelayed(const mtsStateTable &stateTable, const _elementType &stateData, const std::string &commandName)
Definition mtsInterfaceProvided.h:874
Definition mtsInterfaceRequired.h:83
Definition mtsStateTable.h:67
void AddData(_elementType &element, const std::string &name="")
Definition mtsStateTable.h:373
Definition mtsParameterTypes.h:1622
mtsTaskPeriodic(const std::string &name, double periodicityInSeconds, bool isHardRealTime=false, unsigned int sizeStateTable=256, bool newThread=true)
const int CMN_DYNAMIC_CREATION_ONEARG
Definition cmnClassRegisterMacros.h:330
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
Declaration of mtsInterfaceProvided.