cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsManagerComponentBase.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Anton Deguet, Min Yang Jung
7  Created on: 2010-08-29
8 
9  (C) Copyright 2010-2013 Johns Hopkins University (JHU), All Rights Reserved.
10 
11 --- begin cisst license - do not edit ---
12 
13 This software is provided "as is" under an open source license, with
14 no warranty. The complete license can be found in license.txt and
15 http://www.cisst.org/cisst/license.txt.
16 
17 --- end cisst license ---
18 */
19 
20 #ifndef _mtsManagerComponentBase_h
21 #define _mtsManagerComponentBase_h
22 
27 
28 // Always include last
30 
100 {
102 
103 public:
106  public:
108  const static std::string ManagerComponentServer;
109  const static std::string ManagerComponentClientSuffix;
110  };
111 
114  public:
115  // Internal interfaces for dynamic component services
116  const static std::string InterfaceInternalProvided;
117  const static std::string InterfaceInternalRequired;
118  const static std::string InterfaceComponentProvided;
119  const static std::string InterfaceComponentRequired;
120  const static std::string InterfaceLCMProvided;
121  const static std::string InterfaceLCMRequired;
122  const static std::string InterfaceGCMProvided;
123  const static std::string InterfaceGCMRequired;
124  // Interface for system-wide thread-safe logging
125  const static std::string InterfaceSystemLoggerProvided;
126  const static std::string InterfaceSystemLoggerRequired;
127  // Interfaces for sharing execution threads between tasks
128  const static std::string InterfaceExecIn;
129  const static std::string InterfaceExecOut;
130  };
131 
134  public:
135  // Dynamic component management
136  const static std::string ComponentCreate;
137  const static std::string ComponentConfigure;
138  const static std::string ComponentConnect;
139  const static std::string ComponentDisconnect;
140  const static std::string ComponentStart;
141  const static std::string ComponentStop;
142  const static std::string ComponentResume;
143  const static std::string ComponentGetState;
144  const static std::string LoadLibrary; // dynamic loading
145  // Logging
146  const static std::string PrintLog;
147  const static std::string SetLogForwarding;
148  const static std::string GetLogForwardingStateInternal;
149  const static std::string EnableLogForwarding;
150  const static std::string DisableLogForwarding;
151  const static std::string GetLogForwardingState;
152  const static std::string GetLogForwardingStates;
153  // Getters
154  const static std::string GetNamesOfProcesses;
155  const static std::string GetNamesOfComponents;
156  const static std::string GetNamesOfInterfaces;
157  const static std::string GetListOfConnections;
158  const static std::string GetListOfComponentClasses;
159  const static std::string GetInterfaceProvidedDescription;
160  const static std::string GetInterfaceRequiredDescription;
161  // Get absolute time for each process
162  const static std::string GetAbsoluteTimeInSeconds;
163  // Get absolute time differences between each process and GCM
164  const static std::string GetAbsoluteTimeDiffs;
165  // Establishing connections
166  const static std::string GetEndUserInterface;
167  const static std::string AddObserverList;
168  const static std::string RemoveEndUserInterface;
169  const static std::string RemoveObserverList;
170  };
171 
174  public:
175  // Events
176  const static std::string AddComponent;
177  const static std::string AddConnection;
178  const static std::string RemoveConnection;
179  const static std::string ChangeState;
180  const static std::string MCSReady;
181  const static std::string PrintLog;
182  };
183 
184  mtsManagerComponentBase(const std::string & componentName);
185  virtual ~mtsManagerComponentBase();
186 
187  static bool IsManagerComponent(const std::string & componentName);
188  static bool IsNameOfInternalInterface(const std::string & interfaceName);
189 
190  static bool IsManagerComponentServer(const std::string & componentName);
191  static bool IsManagerComponentClient(const std::string & componentName);
192 
193  static bool IsNameOfInterfaceGCMRequired(const std::string & interfaceName);
194  static bool IsNameOfInterfaceGCMProvided(const std::string & interfaceName);
195  static bool IsNameOfInterfaceLCMRequired(const std::string & interfaceName);
196  static bool IsNameOfInterfaceLCMProvided(const std::string & interfaceName);
197  static bool IsNameOfInterfaceComponentRequired(const std::string & interfaceName);
198  static bool IsNameOfInterfaceComponentProvided(const std::string & interfaceName);
199  static bool IsNameOfInterfaceInternalRequired(const std::string & interfaceName);
200  static bool IsNameOfInterfaceInternalProvided(const std::string & interfaceName);
201 
202  static const std::string GetNameOfManagerComponentServer(void);
203  static const std::string GetNameOfManagerComponentClientFor(const std::string & processName);
204  static const std::string GetNameOfInterfaceGCMRequiredFor(const std::string & processName);
205  static const std::string GetNameOfInterfaceGCMProvided(void);
206  static const std::string GetNameOfInterfaceLCMRequired(void);
207  static const std::string GetNameOfInterfaceLCMProvided(void);
208  static const std::string GetNameOfInterfaceComponentRequiredFor(const std::string & componentName);
209  static const std::string GetNameOfInterfaceComponentProvided(void);
210  static const std::string GetNameOfInterfaceInternalRequired(void);
211  static const std::string GetNameOfInterfaceInternalProvided(void);
212 
213  // mtsTask implementation
214  virtual void Startup(void) = 0;
215  virtual void Run(void);
216  virtual void Cleanup(void);
217 };
218 
220 
221 #endif // _mtsManagerComponentBase_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
static const std::string GetListOfConnections
Definition: mtsManagerComponentBase.h:157
static const std::string GetLogForwardingState
Definition: mtsManagerComponentBase.h:151
Declaration of mtsInterfaceRequired.
static const std::string AddComponent
Definition: mtsManagerComponentBase.h:176
static const std::string GetLogForwardingStateInternal
Definition: mtsManagerComponentBase.h:148
static const std::string RemoveObserverList
Definition: mtsManagerComponentBase.h:169
static const std::string InterfaceSystemLoggerProvided
Definition: mtsManagerComponentBase.h:125
static const std::string DisableLogForwarding
Definition: mtsManagerComponentBase.h:150
Defines a task with a Run method trigger by signals (any queued command or event).
static const std::string EnableLogForwarding
Definition: mtsManagerComponentBase.h:149
static const std::string GetInterfaceProvidedDescription
Definition: mtsManagerComponentBase.h:159
Definition: mtsManagerComponentBase.h:173
static const std::string InterfaceExecIn
Definition: mtsManagerComponentBase.h:128
static const std::string ManagerComponentClientSuffix
Definition: mtsManagerComponentBase.h:109
static const std::string ComponentResume
Definition: mtsManagerComponentBase.h:142
static const std::string InterfaceSystemLoggerRequired
Definition: mtsManagerComponentBase.h:126
static const std::string ComponentConfigure
Definition: mtsManagerComponentBase.h:137
static const std::string LoadLibrary
Definition: mtsManagerComponentBase.h:144
static const std::string GetAbsoluteTimeInSeconds
Definition: mtsManagerComponentBase.h:162
static const std::string GetNamesOfComponents
Definition: mtsManagerComponentBase.h:155
Definition: mtsManagerComponentBase.h:133
static const std::string GetAbsoluteTimeDiffs
Definition: mtsManagerComponentBase.h:164
static const std::string MCSReady
Definition: mtsManagerComponentBase.h:180
static const std::string InterfaceComponentProvided
Definition: mtsManagerComponentBase.h:118
static const std::string AddObserverList
Definition: mtsManagerComponentBase.h:167
static const std::string RemoveConnection
Definition: mtsManagerComponentBase.h:178
Definition: mtsTaskFromSignal.h:40
static const std::string InterfaceLCMRequired
Definition: mtsManagerComponentBase.h:121
static const std::string GetListOfComponentClasses
Definition: mtsManagerComponentBase.h:158
static const std::string ComponentConnect
Definition: mtsManagerComponentBase.h:138
static const std::string ComponentGetState
Definition: mtsManagerComponentBase.h:143
Definition: mtsManagerComponentBase.h:99
static const std::string ComponentStart
Definition: mtsManagerComponentBase.h:140
static const std::string InterfaceGCMProvided
Definition: mtsManagerComponentBase.h:122
static const std::string GetInterfaceRequiredDescription
Definition: mtsManagerComponentBase.h:160
static const std::string ComponentCreate
Definition: mtsManagerComponentBase.h:136
Definition: mtsManagerComponentBase.h:105
static const std::string InterfaceInternalProvided
Definition: mtsManagerComponentBase.h:116
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
static const std::string InterfaceComponentRequired
Definition: mtsManagerComponentBase.h:119
static const std::string GetNamesOfProcesses
Definition: mtsManagerComponentBase.h:154
static const std::string GetNamesOfInterfaces
Definition: mtsManagerComponentBase.h:156
static const std::string InterfaceGCMRequired
Definition: mtsManagerComponentBase.h:123
Declaration of mtsInterfaceProvided.
static const std::string AddConnection
Definition: mtsManagerComponentBase.h:177
static const std::string GetLogForwardingStates
Definition: mtsManagerComponentBase.h:152
static const std::string ChangeState
Definition: mtsManagerComponentBase.h:179
static const std::string InterfaceExecOut
Definition: mtsManagerComponentBase.h:129
Rules of exporting.
static const std::string InterfaceInternalRequired
Definition: mtsManagerComponentBase.h:117
static const std::string GetEndUserInterface
Definition: mtsManagerComponentBase.h:166
Definition: mtsManagerComponentBase.h:113
static const std::string SetLogForwarding
Definition: mtsManagerComponentBase.h:147
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
static const std::string PrintLog
Definition: mtsManagerComponentBase.h:146
static const std::string ComponentStop
Definition: mtsManagerComponentBase.h:141
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
CMN_DECLARE_SERVICES_INSTANTIATION(mtsManagerComponentBase)
static const std::string ComponentDisconnect
Definition: mtsManagerComponentBase.h:139
static const std::string RemoveEndUserInterface
Definition: mtsManagerComponentBase.h:168
static const std::string ManagerComponentServer
Definition: mtsManagerComponentBase.h:108
static const std::string PrintLog
Definition: mtsManagerComponentBase.h:181
static const std::string InterfaceLCMProvided
Definition: mtsManagerComponentBase.h:120