MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrDriver.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 lgrDriver_H_
10 #define lgrDriver_H_
11 
12 #include <lgrCore/lgrCore.h>
14 #include <lgrCmds/lgrCommand.h>
17 
18 #include <vlutil/vlSmartPointers.h>
19 #include <vlutil/vlMutex.h>
20 
21 #include <map>
22 
23 class DtThread;
24 
25 namespace MAKLogger
26 {
27 
28  class DtLgrSystemDriver;
29  class DtCommandInterface;
30  class DtRuntimeCommandFactory;
31  class DtLgrCommandThread;
32 
36  {
37  public:
38 
41  DtLgrCommandHandler(const DtString& name,DtRuntimeCommandFactory*
43 
45  virtual ~DtLgrCommandHandler();
46 
48  void lock();
49 
51  void unlock();
52 
54  virtual void tick() = 0;
55 
57  DtCommandDispatcherSP dispatcher();
58 
60  virtual const DtString& driverName() const;
61 
63  virtual const DtString& driverInfo();
64 
66  virtual void processCommand(const DtCommand& command);
67 
76  virtual bool releasePipeline() = 0;
77 
78 
82  virtual bool getPipeline() = 0;
83 
87  virtual bool hasPipeline() const = 0;
88 
90  virtual bool spawnThread(DtLgrCommandThread* commandThread);
91 
93  virtual void stopAllThreads();
94 
96  virtual void stopThread( DtLgrCommandThread* commandThread );
97 
98  protected:
99 
102  void addCommandHandler(const DtCommandDefinition& commandDef,
103  DtCommandFunctorSP commandFunctor);
104 
107  void removeCommandHandler(const DtCommandDefinition& commandDef);
108 
110  virtual void sendResponse(DtResponse response);
111 
113  virtual void queueResponse(DtResponse response);
114 
116  virtual void sendQueuedResponses();
117 
119  virtual void emptyResponseQueue();
120 
122  DtResponse finishThread(const DtCommand& command);
123 
124  protected:
125 
126  typedef DtLgrCommandHandler* (*DriverCreator)(DtCommandDispatcherSP);
127  typedef std::map<DtLgrCommandId,DtCommandFunctorSP> DtLgrCommandHandlerMap;
128  typedef std::map<DtString,DtLgrCommandId> DtLgrCommandNameMap;
129 
130  typedef std::list<DtResponse> DtResponseQueue;
131 
133 
137  DtString myName;
138  DtString myInfo;
139 
140  DtMutex myMutex;
141 
143  typedef std::map<DtLgrCommandThread*, DtThread*> CommandThreadMap;
144 
147 
148  };
149 
150  typedef std::shared_ptr<DtLgrCommandHandler> DtLgrCommandHandlerSP;
151 
152 }
153 
154 #endif
The logger command which contains the command type and its parameters.
Definition: lgrCommand.h:110
std::shared_ptr< DtCommandFunctor > DtCommandFunctorSP
Typedefs for shared pointer to the Functors.
Definition: lgrCommandFunctor.h:49
std::list< DtResponse > DtResponseQueue
Definition: lgrDriver.h:130
This class provides the base interface for DtLgrCommandHandler.
Definition: lgrDriver.h:35
DtRuntimeCommandFactory * myRuntimeCommandFactory
Definition: lgrDriver.h:132
std::map< DtString, DtLgrCommandId > DtLgrCommandNameMap
Definition: lgrDriver.h:128
DtMutex myMutex
Definition: lgrDriver.h:140
DtResponseQueue myResponseQueue
Definition: lgrDriver.h:136
DtString myName
Definition: lgrDriver.h:137
Contains MAKLogger::Contains DtCommandDefinition and MAKLogger::DtRuntimeCommandFactory 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
DtString myInfo
Definition: lgrDriver.h:138
std::shared_ptr< DtCommandDispatcher > DtCommandDispatcherSP
Definition: lgrCommandDispatcher.h:101
Contains MAKLogger::DtLgrCommandType and MAKLogger::DtCommand classes.
/brief Base class for defining command operations that run in a separate thread.
Definition: lgrCommandThread.h:26
std::map< DtLgrCommandThread *, DtThread * > CommandThreadMap
A set of running command threads.
Definition: lgrDriver.h:143
DtLgrCommandHandlerMap myCommandMap
Definition: lgrDriver.h:134
#define DT_DLL_LGRCORE
Definition: lgrCore.h:19
Contains MAKLogger::DtCommandFunctor, MAKLogger::DtResponseFunctor, MAKLogger::DtLgrCommandHandlerFun...
DtCommandDispatcherSP myDispatcher
Definition: lgrDriver.h:135
CommandThreadMap myRunningCommandThreads
Running command threads.
Definition: lgrDriver.h:146
std::map< DtLgrCommandId, DtCommandFunctorSP > DtLgrCommandHandlerMap
Definition: lgrDriver.h:127
std::shared_ptr< const DtCommand > DtResponse
Definition: lgrCommand.h:175
Contains MAKLogger::DtCommandDispatcher class.
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)