MAK Data Logger API Documentation for HLA
 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-2025 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 
27 namespace MAKLogger
28 {
29 
30  class DtLgrDynamicLibrary;
31  class DtLgrSystemCommandFactory;
32  class DtLogger;
33  class DtMessagePipeline;
34  class DtRuntimeCommandFactory;
35  class DtLgrProtocolRegistration;
37 
38  typedef std::list<std::shared_ptr<DtLgrDynamicLibrary> > DtLibraryList;
39 
44  {
45  public:
47 
48  enum NasmpMode
49  {
51  NasmpMode_Snnf
52  };
53 
54  enum NasmpFlag
55  {
56  NasmpFlag_Fast
57  };
58 
59  public:
61 
62 
63  virtual ~DtLgrSystemDriver();
64 
66  virtual void tick();
67 
71  void init(DtLgrProtocolRegistration*);
72 
74  virtual bool timeToShutdown() const;
75 
77  virtual void submitCommand(const DtCommand& command);
78 
80  DtCommandDispatcherSP dispatcher();
81 
86  DtMessagePipeline* requestPipeline(DtLgrCommandHandler*);
87 
93  bool releasePipeline();
94 
96  const DtLgrCommandHandler* pipelineOwner() const;
97 
99  const DtMessagePipeline* pipeline() const;
100 
102  DtMessagePipeline* pipeline();
103 
105  void setPipelineDriver(DtLgrDomainId domain);
106 
108  virtual bool wasListeningOnIdle() const;
109 
111  virtual bool isListeningOnIdle() const;
112 
116  void addDriver(DtLgrCommandType, DtLgrCommandHandlerSP driver);
117 
120  DtLgrCommandHandlerSP getCommandHandler(const DtLgrCommandType& type);
121 
124  bool removeDriver(DtLgrCommandType type);
125 
127  void setSimManager(DtLgrSimManager*);
128 
130  const DtLgrSimManager* simManager() const;
131 
132  DtLgrSimManager* simManager();
133 
135  virtual void loadPluginLibrary(const DtString& filename);
136 
138  void setNotifyLevel(int vlLevel,int lgrLevel);
139 
141  void setBasicGuiFlag(bool basic);
142 
144  void setGuiConfigFilename(DtString guiConfigFilename);
145 
147  void setPerformanceThreshold(double performanceThreshold);
148 
150  void issueTextCommand(const DtString& textCommand);
151 
153  void setEntityTracking(bool enableEntityTracking);
154 
156  bool entityTracking() const;
157 
159  void setFastJumpsWithoutDiff(bool enableFastJumpsWithoutDiff);
160 
162  bool fastJumpsWithoutDiff() const;
163 
165  void setPlaybackReadTimeLimit(double readTimeLimit);
166 
168  double playbackReadTimeLimit() const;
169 
171  void setNasmpMode (const DtString& nasmpMode);
172 
174  int notifyLevel() const;
175 
177  bool basicGuiFlag()const;
178 
180  DtString guiConfigFilename() const;
181 
183  DtString nasmpModeString() const;
184 
186  NasmpMode nasmpMode() const;
187 
189  bool nasmpFlag(NasmpFlag flag);
190 
192  void sendMessage(const DtString& message);
193 
195  DtRuntimeCommandFactory* runtimeCommandFactory();
196 
198  const DtLibraryList& libraries() const;
199 
201  DtLogger* logger();
203  const DtLogger* logger() const;
205 
207  DtThreadSafe<bool>* cancelLongOperationFlag();
208 
210  void startLongOperation(const DtString& name,bool interruptible);
211 
213  void updateLongOperation(const DtString& message,int progress);
214 
216  void finishLongOperation();
217 
219  void cancelLongOperation();
220 
222  bool isLongOperationCanceled() const;
223 
226  protected:
227  DtResponse shutdownCommand(const DtCommand& command);
228  DtResponse cancelShutdown(const DtCommand& command);
229  DtResponse createDriver(const DtCommand& command);
230  DtResponse loadPlugin(const DtCommand& command);
231  DtResponse setNotifyLevel(const DtCommand& command);
232  DtResponse setBasicGuiFlag(const DtCommand& command);
233  DtResponse setPlaybackReadTimeLimit(const DtCommand& command);
234  DtResponse setEntityTracking(const DtCommand& command);
235  DtResponse setFastJumpsWithoutDiff(const DtCommand& command);
236  DtResponse setNasmpMode(const DtCommand& command);
237  DtResponse deleteFile(const DtCommand& command);
238  DtResponse installOutputListener(const DtCommand& command);
240  DtResponse issueTextCommand(const DtCommand& command);
241  DtResponse helpCommand(const DtCommand& command);
242  DtResponse infoCommand(const DtCommand& command);
243  DtResponse setTempDir(const DtCommand& command);
244  DtResponse setDefaultTapeDirectory(const DtCommand& command);
245  DtResponse setGuiConfigFilename(const DtCommand& command);
246  DtResponse setPerformanceThreshold(const DtCommand& command);
247 
248 
249  protected:
250  //Type definitions
251  typedef DtU32 NasmpFlags;
252 
253  static const int NasmpModeMask = 0x0f;
254  static const int NasmpModeNone = 0x00;
255  static const int NasmpModeSnnf = 0x01;
256 
257  static const int NasmpFlagMask = 0xf0;
258  static const int NasmpFlagFast = 0x10;
259 
260  typedef DtResponse (DtLgrSystemDriver::*CommandHandler)(const DtCommand&);
261  typedef std::map<DtLgrCommandId,CommandHandler> DtCommandMap;
262  typedef std::map<DtLgrCommandType,DtLgrCommandHandlerSP> DtDriverMap;
264 
265  virtual void unloadLibraries();
266 
268  void registerCommandHandler(const DtCommandDefinition&,CommandHandler);
269 
271  virtual void tickDrivers();
272 
274  virtual void lockDrivers();
275 
277  virtual void unlockDrivers();
278 
280  virtual void processCommands();
281 
283  virtual DtString commandDescription( const DtString& commandName) const;
284 
287  void lookupCommandId(DtCommand& command);
288 
290  virtual void processCommand(const DtCommand& command);
291 
292  protected:
294  DtLogger* myParentLogger;
295  DtClock myTickClock;
296  DtRelativeTime myParentLoggerTickTime;
297  DtTime myTickOverhead;
298  bool myPerformanceWarning;
299  double myPerformanceThreshold;
300 
301  DtCommandMap myCommandMap;
304  DtDriverList myDriverList;
305  DtDriverMap myDriverMap;
306  DtCommandDispatcherSP myDispatcher;
307  DtMessagePipeline* myPipeline;
308  DtLgrCommandHandler* myPipelineOwner;
309 
310  DtLgrSimManager* mySimManager;
311 
312  DtRuntimeCommandFactory* myRuntimeCommandFactory;
313 
314  DtLibraryList myLibraries;
315 
317  bool myShutdownFlag;
318 
320  bool myBasicGuiFlag;
321 
323  DtString myGuiConfigFilename;
324 
326  DtString myNasmpMode;
327 
329  bool myEntityTracking;
330 
332  bool myFastJumpsWithoutDiff;
333 
334  DtMutex myCommandHandlerMutex;
335 
336  DtThreadSafe<bool> myCancelLongOperationFlag;
337 
338  NasmpFlags myNasmpFlags;
339  };
340 
341 }
342 
343 #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:54
Relative Time, an elapsed duration of time, no implied measurement, could be seconds/cycles or ticks ...
Definition: absoluteTime.h:28
Definition: lgrSystemDriver.h:50
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:48
Contains MAKLogger::Contains DtCommandDefinition and MAKLogger::DtRuntimeCommandFactory classes...
std::map< DtLgrCommandType, DtLgrCommandHandlerSP > DtDriverMap
Definition: lgrSystemDriver.h:262
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:46
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:263
short DtLgrCommandId
Definition: lgrCommand.h:25
std::map< DtLgrCommandId, CommandHandler > DtCommandMap
Definition: lgrSystemDriver.h:261
std::list< std::shared_ptr< DtLgrDynamicLibrary > > DtLibraryList
Definition: lgrSystemDriver.h:36
DtLgrSystemDrive defines the lowest level driver which controls the logger.
Definition: lgrSystemDriver.h:43
DtU32 NasmpFlags
Definition: lgrSystemDriver.h:251
Contains lgrCore library definitions.

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)