22 #ifndef _mtsComponentAddLatency_h
23 #define _mtsComponentAddLatency_h
32 class mtsComponentAddLatencyDelayedRead;
33 class mtsComponentAddLatencyDelayedQualifiedRead;
34 class mtsComponentAddLatencyDelayedVoid;
35 class mtsComponentAddLatencyDelayedWrite;
91 void Configure(
const std::string & filename);
96 double SetLatency(
double latencyInSeconds);
106 template <
class _elementType>
108 const std::string & commandRequiredName,
110 const std::string & commandProvidedName =
"");
112 template <
class _element1Type,
class _element2Type>
114 const std::string & commandRequiredName,
116 const std::string & commandProvidedName =
"");
120 const std::string & commandRequiredName,
122 const std::string & commandProvidedName =
"");
124 template <
class _elementType>
126 const std::string & commandRequiredName,
128 const std::string & commandProvidedName =
"");
131 const std::string & eventRequiredName,
133 const std::string & eventProvidedName =
"");
135 template <
class _elementType>
137 const std::string & eventRequiredName,
139 const std::string & eventProvidedName =
"");
147 const std::string & commandRequiredName);
149 bool AddCommandQualifiedReadDelayedInternal(
const mtsGenericObject & qualifier,
152 const std::string & commandRequiredName,
154 const std::string & commandProvidedName);
158 const std::string & commandRequiredName,
160 const std::string & commandProvidedName);
164 const std::string & eventRequiredName,
166 const std::string & eventProvidedName =
"");
172 template <
class _elementType>
174 const std::string & commandRequiredName,
176 const std::string & commandProvidedName)
181 _elementType * data =
new _elementType;
185 commandProvidedName ==
""
186 ? commandRequiredName
187 : commandProvidedName);
189 this->AddCommandReadDelayedInternal(*data, interfaceRequired, commandRequiredName);
193 template <
class _element1Type,
class _element2Type>
195 const std::string & commandRequiredName,
197 const std::string & commandProvidedName)
199 _element1Type qualifier;
200 _element2Type placeHolder;
202 this->AddCommandQualifiedReadDelayedInternal(qualifier,
207 commandProvidedName ==
""
208 ? commandRequiredName
209 : commandProvidedName);
213 template <
class _elementType>
215 const std::string & commandRequiredName,
217 const std::string & commandProvidedName)
223 this->AddCommandWriteDelayedInternal(data,
227 commandProvidedName ==
""
228 ? commandRequiredName
229 : commandProvidedName);
233 template <
class _elementType>
235 const std::string & eventRequiredName,
237 const std::string & eventProvidedName)
243 this->AddEventWriteDelayedInternal(data,
247 eventProvidedName ==
""
249 : eventProvidedName);
256 #endif // _mtsComponentAddLatency_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
DelayedVoidList DelayedVoids
Definition: mtsComponentAddLatency.h:79
bool AddCommandWriteDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
Definition: mtsComponentAddLatency.h:214
double Latency
Definition: mtsComponentAddLatency.h:141
mtsCommandRead * AddCommandReadStateDelayed(const mtsStateTable &stateTable, const _elementType &stateData, const std::string &commandName)
Definition: mtsInterfaceProvided.h:745
DelayedQualifiedReadList DelayedQualifiedReads
Definition: mtsComponentAddLatency.h:76
Definition: mtsInterfaceRequired.h:85
bool AddCommandReadDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
Definition: mtsComponentAddLatency.h:173
DelayedWriteList DelayedWrites
Definition: mtsComponentAddLatency.h:82
std::list< mtsComponentAddLatencyDelayedVoid * > DelayedVoidList
Definition: mtsComponentAddLatency.h:78
Definition: mtsTaskPeriodic.h:38
std::list< mtsComponentAddLatencyDelayedQualifiedRead * > DelayedQualifiedReadList
Definition: mtsComponentAddLatency.h:75
Definition: mtsComponentAddLatency.h:66
Base class for data object in cisstMultiTask.
Definition: mtsGenericObject.h:56
const int CMN_DYNAMIC_CREATION_ONEARG
Definition: cmnClassRegisterMacros.h:333
virtual void Startup(void)
Definition: mtsComponent.h:262
DelayedReadList DelayedReads
Definition: mtsComponentAddLatency.h:73
mtsStateTable LatencyStateTable
Definition: mtsComponentAddLatency.h:142
virtual void Configure(const std::string &CMN_UNUSED(filename)="")
Definition: mtsTask.h:218
bool AddEventWriteDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &eventRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &eventProvidedName="")
Definition: mtsComponentAddLatency.h:234
Definition: mtsStateTable.h:67
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
void AddData(_elementType &element, const std::string &name="")
Definition: mtsStateTable.h:369
Definition: mtsInterfaceProvided.h:96
std::list< mtsComponentAddLatencyDelayedRead * > DelayedReadList
Definition: mtsComponentAddLatency.h:72
Declaration of mtsInterfaceProvided.
bool AddCommandQualifiedReadDelayed(mtsInterfaceRequired *interfaceRequired, const std::string &commandRequiredName, mtsInterfaceProvided *interfaceProvided, const std::string &commandProvidedName="")
Definition: mtsComponentAddLatency.h:194
Definition: mtsTaskPeriodic.h:80
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition: cmnClassRegisterMacros.h:202
virtual void Cleanup(void)
Definition: mtsComponent.h:267
std::list< mtsComponentAddLatencyDelayedWrite * > DelayedWriteList
Definition: mtsComponentAddLatency.h:81
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76