MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrSystemDriver.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef lgrSystemDriver_H_
10 #define lgrSystemDriver_H_
11 
12 #include <lgrCore/lgrCore.h>
13 #include <lgrCmds/lgrCommand.h>
15 #include <lgrCore/lgrDriver.h>
16 #include <lgrUtil/lgrExceptions.h>
19 #include <lgrUtil/threadSafe.h>
20 
21 #include <vlutil/vlTime.h>
22 
23 #include <map>
24 #include <set>
25 #include <list>
26 #include <vector>
27 
28 namespace MAKLogger
29 {
30 
31  class DtLgrDynamicLibrary;
32  class DtLgrSystemCommandFactory;
33  class DtLogger;
34  class DtMessagePipeline;
35  class DtRuntimeCommandFactory;
36  class DtLgrProtocolRegistration;
38 
39  typedef std::list<std::shared_ptr<DtLgrDynamicLibrary> > DtLibraryList;
40 
45  {
46  public:
48 
49  enum NasmpMode
50  {
52  NasmpMode_Snnf
53  };
54 
55  enum NasmpFlag
56  {
57  NasmpFlag_Fast
58  };
59 
60  public:
62 
63 
64  virtual ~DtLgrSystemDriver();
65 
67  virtual void tick();
68 
72  void init(DtLgrProtocolRegistration*);
73 
75  virtual bool timeToShutdown() const;
76 
78  virtual void submitCommand(const DtCommand& command);
79 
81  DtCommandDispatcherSP dispatcher();
82 
87  DtMessagePipeline* requestPipeline(DtLgrCommandHandler*);
88 
94  bool releasePipeline();
95 
97  const DtLgrCommandHandler* pipelineOwner() const;
98 
100  const DtMessagePipeline* pipeline() const;
101 
103  DtMessagePipeline* pipeline();
104 
106  void setPipelineDriver(DtLgrDomainId domain);
107 
109  virtual bool wasListeningOnIdle() const;
110 
112  virtual bool isListeningOnIdle() const;
113 
117  void addDriver(DtLgrCommandType, DtLgrCommandHandlerSP driver);
118 
121  DtLgrCommandHandlerSP getCommandHandler(const DtLgrCommandType& type);
122 
125  bool removeDriver(DtLgrCommandType type);
126 
128  void setSimManager(DtLgrSimManager*);
129 
131  const DtLgrSimManager* simManager() const;
132 
133  DtLgrSimManager* simManager();
134 
136  virtual void loadPluginLibrary(const DtString& filename);
137 
139  void setNotifyLevel(int vlLevel,int lgrLevel);
140 
142  void setBasicGuiFlag(bool basic);
143 
145  void setGuiConfigFilename(DtString guiConfigFilename);
146 
148  void setPerformanceThreshold(double performanceThreshold);
149 
151  void issueTextCommand(const DtString& textCommand);
152 
154  void setEntityTracking(bool enableEntityTracking);
155 
157  bool entityTracking() const;
158 
162  void setExConnConfigFile(const DtString& exConnConfigFile);
163 
165  const DtString& exConnConfigFile() const;
166 
170  void setFomModuleList(const std::vector<DtString>& fomModuleList);
171 
173  const std::vector<DtString>& fomModuleList() const;
174 
177  void setAdditionalFomModules(const std::vector<DtString>& additionalFomModules);
178 
180  const std::vector<DtString>& additionalFomModules() const;
181 
183  void setFastJumpsWithoutDiff(bool enableFastJumpsWithoutDiff);
184 
186  bool fastJumpsWithoutDiff() const;
187 
189  void setPlaybackReadTimeLimit(double readTimeLimit);
190 
192  double playbackReadTimeLimit() const;
193 
195  void setNasmpMode (const DtString& nasmpMode);
196 
198  int notifyLevel() const;
199 
201  bool basicGuiFlag()const;
202 
204  DtString guiConfigFilename() const;
205 
207  DtString nasmpModeString() const;
208 
210  NasmpMode nasmpMode() const;
211 
213  bool nasmpFlag(NasmpFlag flag);
214 
216  void sendMessage(const DtString& message);
217 
219  DtRuntimeCommandFactory* runtimeCommandFactory();
220 
222  const DtLibraryList& libraries() const;
223 
225  DtLogger* logger();
227  const DtLogger* logger() const;
229 
231  DtThreadSafe<bool>* cancelLongOperationFlag();
232 
234  void startLongOperation(const DtString& name,bool interruptible);
235 
237  void updateLongOperation(const DtString& message,int progress);
238 
240  void finishLongOperation();
241 
243  void cancelLongOperation();
244 
246  bool isLongOperationCanceled() const;
247 
250  protected:
251  DtResponse shutdownCommand(const DtCommand& command);
252  DtResponse cancelShutdown(const DtCommand& command);
253  DtResponse createDriver(const DtCommand& command);
254  DtResponse loadPlugin(const DtCommand& command);
255  DtResponse setNotifyLevel(const DtCommand& command);
256  DtResponse setBasicGuiFlag(const DtCommand& command);
257  DtResponse setPlaybackReadTimeLimit(const DtCommand& command);
258  DtResponse setEntityTracking(const DtCommand& command);
259  DtResponse setFastJumpsWithoutDiff(const DtCommand& command);
260  DtResponse setNasmpMode(const DtCommand& command);
261  DtResponse deleteFile(const DtCommand& command);
262  DtResponse installOutputListener(const DtCommand& command);
264  DtResponse issueTextCommand(const DtCommand& command);
265  DtResponse helpCommand(const DtCommand& command);
266  DtResponse infoCommand(const DtCommand& command);
267  DtResponse setTempDir(const DtCommand& command);
268  DtResponse setDefaultTapeDirectory(const DtCommand& command);
269  DtResponse setGuiConfigFilename(const DtCommand& command);
270  DtResponse setPerformanceThreshold(const DtCommand& command);
271 
272 
273  protected:
274  //Type definitions
275  typedef DtU32 NasmpFlags;
276 
277  static const int NasmpModeMask = 0x0f;
278  static const int NasmpModeNone = 0x00;
279  static const int NasmpModeSnnf = 0x01;
280 
281  static const int NasmpFlagMask = 0xf0;
282  static const int NasmpFlagFast = 0x10;
283 
284  typedef DtResponse (DtLgrSystemDriver::*CommandHandler)(const DtCommand&);
285  typedef std::map<DtLgrCommandId,CommandHandler> DtCommandMap;
286  typedef std::map<DtLgrCommandType,DtLgrCommandHandlerSP> DtDriverMap;
288 
289  virtual void unloadLibraries();
290 
292  void registerCommandHandler(const DtCommandDefinition&,CommandHandler);
293 
295  virtual void tickDrivers();
296 
298  virtual void lockDrivers();
299 
301  virtual void unlockDrivers();
302 
304  virtual void processCommands();
305 
307  virtual DtString commandDescription( const DtString& commandName) const;
308 
311  void lookupCommandId(DtCommand& command);
312 
314  virtual void processCommand(const DtCommand& command);
315 
316  protected:
318  DtLogger* myParentLogger;
319  DtClock myTickClock;
320  DtRelativeTime myParentLoggerTickTime;
321  DtTime myTickOverhead;
322  bool myPerformanceWarning;
323  double myPerformanceThreshold;
324 
325  DtCommandMap myCommandMap;
328  DtDriverList myDriverList;
329  DtDriverMap myDriverMap;
330  DtCommandDispatcherSP myDispatcher;
331  DtMessagePipeline* myPipeline;
332  DtLgrCommandHandler* myPipelineOwner;
333 
334  DtLgrSimManager* mySimManager;
335 
336  DtRuntimeCommandFactory* myRuntimeCommandFactory;
337 
338  DtLibraryList myLibraries;
339 
341  bool myShutdownFlag;
342 
344  bool myBasicGuiFlag;
345 
347  DtString myGuiConfigFilename;
348 
350  DtString myNasmpMode;
351 
353  bool myEntityTracking;
354 
357  DtString myExConnConfigFile;
358 
361  std::vector<DtString> myFomModuleList;
362 
364  std::vector<DtString> myAdditionalFomModules;
365 
367  bool myFastJumpsWithoutDiff;
368 
369  DtMutex myCommandHandlerMutex;
370 
371  DtThreadSafe<bool> myCancelLongOperationFlag;
372 
373  NasmpFlags myNasmpFlags;
374  };
375 
376 }
377 
378 #endif
The logger command which contains the command type and its parameters.
Definition: lgrCommand.h:110
The command type structure.
Definition: lgrCommand.h:29
This class provides the base interface for DtLgrCommandHandler.
Definition: lgrDriver.h:35
#define DT_VIRTUAL_CTR(CLASS_NAME, ARG_TYPES_LIST)
Declare a Virtual Constructor Create using DT_VIRTUAL_CTR(CLASS_NAME,ARG_TYPES_LIST) Where CLASS_NAME...
Definition: virtualConstructor.h:34
NasmpFlag
Definition: lgrSystemDriver.h:55
Relative Time, an elapsed duration of time, no implied measurement, could be seconds/cycles or ticks ...
Definition: absoluteTime.h:28
Definition: lgrSystemDriver.h:51
Contains Logger exceptions.
unsigned char DtLgrDomainId
Definition: lgrCommand.h:23
The factory for creating logger system commands.
Definition: lgrSystemCommandFactory.h:26
Contains DT_VIRTUAL_CTR DT_VIRTUAL_CTR_DEFAULTS DT_VIRTUAL_COPY_ASSIGN DT_VIRTUAL_BASE_CTR DT_PURE_VI...
NasmpMode
Definition: lgrSystemDriver.h:49
Contains MAKLogger::Contains DtCommandDefinition and MAKLogger::DtRuntimeCommandFactory classes...
std::map< DtLgrCommandType, DtLgrCommandHandlerSP > DtDriverMap
Definition: lgrSystemDriver.h:286
Contains MAKLogger::DtScopedSequenceLock and MAKLogger::DtThreadSafe classes.
The factory for decoding text commands.
Definition: lgrRuntimeCommandFactory.h:67
std::shared_ptr< DtLgrCommandHandler > DtLgrCommandHandlerSP
Definition: lgrDriver.h:150
The definition of a command and it&#39;s parameters.
Definition: lgrRuntimeCommandFactory.h:40
Implements a protocol independent Simulation manager.
Definition: lgrSimManager.h:40
std::shared_ptr< DtCommandDispatcher > DtCommandDispatcherSP
Definition: lgrCommandDispatcher.h:101
Contains MAKLogger::DtLgrCommandType and MAKLogger::DtCommand classes.
DtLgrSystemCommandFactory Factory
Definition: lgrSystemDriver.h:47
a thread safe interface to a value.
Definition: threadSafe.h:101
#define DT_DLL_LGRCORE
Definition: lgrCore.h:19
A helper class for registering the necessary protocol specific information.
Definition: lgrProtocolRegistration.h:31
The message pipeline which takes messages from the input, passes them through the state and ultimatel...
Definition: messagePipeline.h:28
std::shared_ptr< const DtCommand > DtResponse
Definition: lgrCommand.h:175
DtLogger provides the core system structure and controls the execution model for the underlying objec...
Definition: logger.h:35
Contains MAKLogger::DtCommandDispatcher class.
Contains MAKLogger::DtLgrCommandHandler class.
std::set< DtLgrCommandHandlerSP > DtDriverList
Definition: lgrSystemDriver.h:287
short DtLgrCommandId
Definition: lgrCommand.h:25
std::map< DtLgrCommandId, CommandHandler > DtCommandMap
Definition: lgrSystemDriver.h:285
std::list< std::shared_ptr< DtLgrDynamicLibrary > > DtLibraryList
Definition: lgrSystemDriver.h:37
DtLgrSystemDrive defines the lowest level driver which controls the logger.
Definition: lgrSystemDriver.h:44
DtU32 NasmpFlags
Definition: lgrSystemDriver.h:275
Contains lgrCore library definitions.

Document ID: Generated on Tue Nov 17 15:25:07 EST 2026 from SVN revision 298446
Copyright © 2026 MAK Technologies. All Rights Reserved (www.mak.com)