MAK Data Logger API Documentation for HLA
 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-2010 VT MAK
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 
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 
139 
140  DtMutex myMutex;
141 
143  typedef std::map<DtLgrCommandThread*, DtThread*> CommandThreadMap;
144 
147 
148  };
149 
150  typedef DtBoost::shared_ptr<DtLgrCommandHandler> DtLgrCommandHandlerSP;
151 
152 }
153 
154 #endif

Document ID: Generated on Wed Jun 5 18:45:18 EDT 2019 from SVN revision 198968
Copyright © 2019 VT MAK. All Rights Reserved (www.mak.com)