26 #ifndef _mtsInterfaceProvided_h
27 #define _mtsInterfaceProvided_h
100 friend class mtsComponentProxy;
120 enum {DEFAULT_MAIL_BOX_AND_ARGUMENT_QUEUES_SIZE = 64};
157 bool isProxy =
false);
178 void SetMailBoxSize(
size_t desiredSize);
197 void SetArgumentQueuesSize(
size_t desiredSize);
204 void SetMailBoxAndArgumentQueuesSize(
size_t desiredSize);
208 std::vector<std::string> GetNamesOfCommands(
void)
const;
209 std::vector<std::string> GetNamesOfCommandsVoid(
void)
const;
210 std::vector<std::string> GetNamesOfCommandsVoidReturn(
void)
const;
211 std::vector<std::string> GetNamesOfCommandsWrite(
void)
const;
212 std::vector<std::string> GetNamesOfCommandsWriteReturn(
void)
const;
213 std::vector<std::string> GetNamesOfCommandsRead(
void)
const;
214 std::vector<std::string> GetNamesOfCommandsQualifiedRead(
void)
const;
219 std::vector<std::string> GetNamesOfEventsVoid(
void)
const;
220 std::vector<std::string> GetNamesOfEventsWrite(
void)
const;
225 static bool IsSystemEventVoid(
const std::string & name);
229 mtsCommandVoid * GetCommandVoid(
const std::string & commandName)
const;
233 mtsCommandRead * GetCommandRead(
const std::string & commandName)
const;
253 template <
class __
classType>
255 __classType * classInstantiation,
256 const std::string & commandName,
270 const std::string & commandName,
277 template <
class __
classType,
class __resultType>
279 __classType * classInstantiation,
280 const std::string & commandName,
281 const __resultType & resultPrototype,
289 template <
class __
classType,
class __resultType>
291 __classType * classInstantiation,
292 const std::string & commandName,
313 template <
class __
classType,
class __argumentType>
315 __classType * classInstantiation,
316 const std::string & commandName,
317 const __argumentType & argumentPrototype,
323 template <
class __
classType,
class __argumentType>
325 __classType * classInstantiation,
326 const std::string & commandName,
328 return this->AddCommandWrite<__classType, __argumentType>(method, classInstantiation, commandName, __argumentType(),
335 template <
class __
classType,
class __argumentType,
class __resultType>
337 __classType * classInstantiation,
338 const std::string & commandName,
339 const __argumentType & argumentPrototype,
340 const __resultType & resultPrototype,
349 template <
class __
classType,
class __argumentType,
class __resultType>
351 __classType * classInstantiation,
352 const std::string & commandName,
372 template <
class __
classType,
class __argumentType>
374 __classType * classInstantiation,
375 const std::string & commandName,
376 const __argumentType & argumentPrototype) {
382 template <
class __
classType,
class __argumentType>
384 __classType * classInstantiation,
385 const std::string & commandName)
399 template <
class _elementType>
401 const _elementType & stateData,
const std::string & commandName);
408 template <
class _elementType>
410 const _elementType & stateData,
const std::string & commandName);
413 template <
class _elementType>
415 const _elementType & stateData,
416 const std::string & commandName,
420 template <
class __
classType,
class __argument1Type,
class __argument2Type>
422 __classType * classInstantiation,
423 const std::string & commandName,
424 const __argument1Type & argument1Prototype,
425 const __argument2Type & argument2Prototype) {
432 template <
class __
classType,
class __argument1Type,
class __argument2Type>
434 __classType * classInstantiation,
435 const std::string & commandName) {
444 template <
class __
classType,
class __argumentType,
class __filteredType>
446 void (__classType::*method)(
const __filteredType &),
447 __classType * classInstantiation,
const std::string & commandName,
448 const __argumentType & argumentPrototype,
449 const __filteredType & filteredPrototype,
451 std::string commandNameFilter(commandName +
"Filter");
453 (premethod, classInstantiation),
461 template <
class __
classType,
class __argumentType,
class __filteredType>
463 void (__classType::*method)(
const __filteredType &),
464 __classType * classInstantiation,
const std::string & commandName,
466 return this->AddCommandFilteredWrite(premethod, method, classInstantiation, commandName,
467 __argumentType(), __filteredType(),
479 bool AddEventVoid(
mtsFunctionVoid & eventTrigger,
const std::string & eventName);
481 template <
class __argumentType>
483 const __argumentType & argumentPrototype);
484 template <
class __argumentType>
485 bool AddEventWrite(
mtsFunctionWrite & eventTrigger,
const std::string & eventName,
486 const __argumentType & argumentPrototype);
491 bool AddEventWriteGeneric(
mtsFunctionWrite & eventTrigger,
const std::string & eventName,
503 bool AddObserver(
const std::string & eventName,
mtsCommandVoid * handler);
515 bool RemoveObserver(
const std::string & eventName,
mtsCommandVoid * handler);
529 std::vector<std::string> GetListOfUserNames(
void)
const;
532 int GetNumberOfEndUsers()
const;
540 void ToStream(std::ostream & outputStream)
const;
548 const std::string & userName,
550 size_t argumentQueuesSize);
553 const std::string & userName);
586 const std::string & userName);
589 template <
class _MapType,
class _QueuedType>
590 void CloneCommands(
const std::string &cmdType,
const _MapType &CommandMapIn, _MapType &CommandMapOut);
597 const std::string & methodName,
598 const std::string & commandName);
668 const std::string & name,
672 const std::string & name,
680 const std::string & name,
690 const std::string & name,
694 const std::string & name,
714 bool AddSystemEvents(
void);
724 template <
class _elementType>
726 const _elementType & stateData,
const std::string & commandName)
731 AccessorType * stateAccessor =
dynamic_cast<AccessorType *
>(stateTable.
GetAccessor(stateData));
732 if (!stateAccessor) {
740 commandName,
new FinalType(stateData));
744 template <
class _elementType>
746 const _elementType & stateData,
const std::string & commandName)
751 AccessorType * stateAccessor =
dynamic_cast<AccessorType *
>(stateTable.
GetAccessor(stateData));
752 if (!stateAccessor) {
758 commandName,
new FinalType(stateData));
761 template <
class _elementType>
763 const _elementType & stateData,
764 const std::string & commandName,
769 AccessorType * stateAccessor =
dynamic_cast<AccessorType *
>(stateTable.
GetAccessor(stateData));
770 if (!stateAccessor) {
775 (&AccessorType::SetCurrent, stateAccessor, commandName, FinalType(stateData)),
779 template <
class __argumentType>
781 const __argumentType & argumentPrototype) {
783 if (eventMulticastCommand) {
784 if (
AddEvent(eventName, eventMulticastCommand)) {
785 return eventMulticastCommand;
787 delete eventMulticastCommand;
789 << eventName <<
"\"" << std::endl;
793 << eventName <<
"\"" << std::endl;
798 template <
class __argumentType>
800 const __argumentType & argumentPrototype) {
804 eventTrigger.
Bind(command);
815 #endif // _mtsInterfaceProvided_h
cmnNamedMap< mtsCommandVoidReturn > CommandVoidReturnMapType
Definition: mtsInterfaceProvided.h:126
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Defines the state data table.
Defines a mailbox for communication between tasks.
mtsInterfaceQueueingPolicy
Definition: mtsForwardDeclarations.h:39
Definition: mtsParameterTypesOld.h:41
mtsCommandWriteBase * AddCommandFilteredWrite(void(__classType::*premethod)(const __argumentType &, __filteredType &) const, void(__classType::*method)(const __filteredType &), __classType *classInstantiation, const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:462
Definition: mtsSocketProxyClient.h:72
Definition: mtsCallableQualifiedReadBase.h:40
mtsCommandRead * AddCommandReadStateDelayed(const mtsStateTable &stateTable, const _elementType &stateData, const std::string &commandName)
Definition: mtsInterfaceProvided.h:745
Definition: mtsCommandVoid.h:44
CommandInternalMapType CommandsInternal
Definition: mtsInterfaceProvided.h:659
mtsMailBox * MailBox
Definition: mtsInterfaceProvided.h:611
bool EndUserInterface
Definition: mtsInterfaceProvided.h:639
size_t GetMailBoxSize(void) const
Definition: mtsInterfaceProvided.h:181
Portability across compilers and operating systems tools.
size_t MailBoxSize
Definition: mtsInterfaceProvided.h:618
mtsCommandWriteReturn * AddCommandWriteReturn(void(__classType::*method)(const __argumentType &, __resultType &), __classType *classInstantiation, const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:350
mtsCommandQueueingPolicy
Definition: mtsForwardDeclarations.h:44
Definition: mtsCallableVoidBase.h:39
cmnNamedMap< mtsCommandWriteReturn > CommandWriteReturnMapType
Definition: mtsInterfaceProvided.h:132
CommandVoidReturnMapType CommandsVoidReturn
Definition: mtsInterfaceProvided.h:652
CommandWriteMapType CommandsWrite
Definition: mtsInterfaceProvided.h:653
std::pair< size_t, ThisType * > InterfaceProvidedCreatedPairType
Definition: mtsInterfaceProvided.h:601
mtsCommandRead * AddCommandRead(void(__classType::*method)(__argumentType &) const, __classType *classInstantiation, const std::string &commandName, const __argumentType &argumentPrototype)
Definition: mtsInterfaceProvided.h:373
Defines a command with no argument.
mtsCommandWriteBase * AddEventWrite(const std::string &eventName, const __argumentType &argumentPrototype)
Definition: mtsInterfaceProvided.h:780
size_t ProcessMailBoxes(InterfacesProvidedMapType &interfaces)
mtsCommandQualifiedRead * AddCommandQualifiedRead(void(__classType::*method)(const __argument1Type &, __argument2Type &) const, __classType *classInstantiation, const std::string &commandName, const __argument1Type &argument1Prototype, const __argument2Type &argument2Prototype)
Definition: mtsInterfaceProvided.h:421
mtsCommandVoidReturn * AddCommandVoidReturn(void(__classType::*method)(__resultType &), __classType *classInstantiation, const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:290
Definition: mtsInterface.h:41
CommandWriteReturnMapType CommandsWriteReturn
Definition: mtsInterfaceProvided.h:654
mtsCommandRead * AddCommandReadState(const mtsStateTable &stateTable, const _elementType &stateData, const std::string &commandName)
Definition: mtsInterfaceProvided.h:725
mtsCommandWriteBase * AddCommandWriteState(const mtsStateTable &stateTable, const _elementType &stateData, const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:762
mtsCommandVoid * AddCommandVoid(void(*function)(void), const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:269
Definition: mtsFunctionVoid.h:36
mtsCommandVoid * AddCommandVoid(void(__classType::*method)(void), __classType *classInstantiation, const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:254
Definition: mtsComponentAddLatency.h:66
Base class for data object in cisstMultiTask.
Definition: mtsGenericObject.h:56
mtsInterfaceProvided ThisType
Definition: mtsInterfaceProvided.h:114
Definition: mtsCallableVoidReturnBase.h:39
cmnNamedMap< mtsCommandWriteBase > CommandWriteMapType
Definition: mtsInterfaceProvided.h:129
Defines a command with one argument sent to multiple interfaces.
cmnNamedMap< mtsMulticastCommandVoid > EventVoidMapType
Definition: mtsInterfaceProvided.h:141
Definition: mtsCallableWriteReturnMethod.h:40
Definition: mtsManagerLocal.h:89
Definition: mtsCommandRead.h:42
Declaration of Manager Component ClientThis class defines the manager component client which is manag...
Definition: mtsManagerComponentClient.h:41
EventVoidMapType EventVoidGenerators
Definition: mtsInterfaceProvided.h:657
mtsCommandWriteBase * AddCommandWrite(void(__classType::*method)(const __argumentType &), __classType *classInstantiation, const std::string &commandName, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:324
Defines a command with no argument.
Definition: mtsMulticastCommandVoid.h:46
Definition: mtsGenericObjectProxy.h:47
Definition: mtsCommandWriteBase.h:40
std::string UserName
Definition: mtsInterfaceProvided.h:642
Definition: mtsInterfaceCommon.h:928
mtsCommandVoidReturn * AddCommandVoidReturn(void(__classType::*method)(__resultType &), __classType *classInstantiation, const std::string &commandName, const __resultType &resultPrototype, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:278
Definition: mtsStateTable.h:169
Definition: mtsCallableQualifiedReadReturnVoidMethod.h:41
mtsCommandWriteReturn * AddCommandWriteReturn(void(__classType::*method)(const __argumentType &, __resultType &), __classType *classInstantiation, const std::string &commandName, const __argumentType &argumentPrototype, const __resultType &resultPrototype, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:336
mtsCallableVoidBase * PostCommandQueuedCallable
Definition: mtsInterfaceProvided.h:662
bool Bind(CommandType *command)
Definition: mtsStateTable.h:67
virtual void ToStream(std::ostream &outputStream) const
Forward declarations and #define for cisstMultiTask.
cmnNamedMap< mtsCommandVoid > CommandVoidMapType
Definition: mtsInterfaceProvided.h:123
Definition: mtsComponent.h:150
Defines a command with no argument.
Defines a command with no argument.
mtsCommandQualifiedRead * AddCommandQualifiedRead(void(__classType::*method)(const __argument1Type &, __argument2Type &) const, __classType *classInstantiation, const std::string &commandName)
Definition: mtsInterfaceProvided.h:433
Defines a command with no argument.
mtsInterface BaseType
Definition: mtsInterfaceProvided.h:117
Definition: mtsCallableReadMethod.h:41
Definition: mtsForwardDeclarations.h:115
size_t GetArgumentQueuesSize(void) const
Definition: mtsInterfaceProvided.h:200
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
CommandQualifiedReadMapType CommandsQualifiedRead
Definition: mtsInterfaceProvided.h:656
mtsCommandWriteBase * AddCommandFilteredWrite(void(__classType::*premethod)(const __argumentType &, __filteredType &) const, void(__classType::*method)(const __filteredType &), __classType *classInstantiation, const std::string &commandName, const __argumentType &argumentPrototype, const __filteredType &filteredPrototype, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:445
mtsCommandVoid * BlockingCommandReturnExecuted
Definition: mtsInterfaceProvided.h:628
Declaration of mtsInterface.
Definition: mtsCommandQualifiedRead.h:39
Definition: mtsMulticastCommandWriteBase.h:43
Defines a command with no argument.
size_t UserCounter
Definition: mtsInterfaceProvided.h:648
cmnNamedMap< mtsCommandRead > CommandReadMapType
Definition: mtsInterfaceProvided.h:135
bool IsProxy
Definition: mtsInterfaceProvided.h:606
Defines a command with no argument.
Definition: mtsInterfaceProvided.h:96
Definition: mtsCommandVoidReturn.h:47
std::list< InterfaceProvidedCreatedPairType > InterfaceProvidedCreatedListType
Definition: mtsInterfaceProvided.h:602
size_t ArgumentQueuesSize
Definition: mtsInterfaceProvided.h:621
Defines a command with one argument.
mtsStateTable::AccessorBase * GetAccessor(const _elementType &element) const
cmnNamedMap< mtsCommandBase > CommandInternalMapType
Definition: mtsInterfaceProvided.h:147
mtsCommandWriteBase * AddCommandWrite(void(__classType::*method)(const __argumentType &), __classType *classInstantiation, const std::string &commandName, const __argumentType &argumentPrototype, mtsCommandQueueingPolicy queueingPolicy=MTS_INTERFACE_COMMAND_POLICY)
Definition: mtsInterfaceProvided.h:314
InterfaceProvidedCreatedListType InterfacesProvidedCreated
Definition: mtsInterfaceProvided.h:603
Definition: mtsCallableReadReturnVoidMethod.h:41
#define CMN_LOG_CLASS_INIT_ERROR
Definition: cmnLogger.h:113
Definition: mtsCallableVoidFunction.h:35
EventWriteMapType EventWriteGenerators
Definition: mtsInterfaceProvided.h:658
mtsInterfaceQueueingPolicy QueueingPolicy
Definition: mtsInterfaceProvided.h:615
cmnNamedMap< mtsMulticastCommandWriteBase > EventWriteMapType
Definition: mtsInterfaceProvided.h:144
ThisType * OriginalInterface
Definition: mtsInterfaceProvided.h:632
Definition: mtsForwardDeclarations.h:44
Definition: mtsCallableVoidReturnMethod.h:40
Definition: mtsCallableWriteReturnBase.h:40
Definition: mtsCallableVoidMethod.h:45
bool AddEvent(const std::string &commandName, mtsMulticastCommandVoid *generator)
Definition: mtsStateIndex.h:51
Definition: mtsFunctionWrite.h:37
Definition: mtsCommandWriteReturn.h:47
Definition: mtsGenericObjectProxy.h:45
Definition: mtsCommandWrite.h:41
Defines a command with one argument.
mtsCommandRead * AddCommandRead(void(__classType::*method)(__argumentType &) const, __classType *classInstantiation, const std::string &commandName)
Definition: mtsInterfaceProvided.h:383
CommandReadMapType CommandsRead
Definition: mtsInterfaceProvided.h:655
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
Definition: mtsCallableQualifiedReadMethod.h:40
Definition: mtsMailBox.h:36
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition: cmnClassRegisterMacros.h:202
CommandVoidMapType CommandsVoid
Definition: mtsInterfaceProvided.h:651
cmnNamedMap< mtsCommandQualifiedRead > CommandQualifiedReadMapType
Definition: mtsInterfaceProvided.h:138
Defines a command with no argument.
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
Definition: mtsCallableReadBase.h:39
mtsCommandVoid * BlockingCommandExecuted
Definition: mtsInterfaceProvided.h:624
Definition: mtsSocketProxyServer.h:81