MAK Data Logger API Documentation for HLA
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.h"
13 #include "lgrCommand.h"
14 #include "lgrCommandFunctor.h"
15 #include "lgrCommandDispatcher.h"
17 #include <vlutil/vlSmartPointers.h>
18 #include <vlutil/vlMutex.h>
19 
20 #include <map>
21 
22 namespace MAKLogger
23 {
24 
25  class DtLgrSystemDriver;
26  class DtCommandInterface;
27  class DtRuntimeCommandFactory;
28 
32  {
33  public:
34 
39 
41  virtual ~DtLgrCommandHandler();
42 
44  void lock();
45 
47  void unlock();
48 
50  virtual void tick() = 0;
51 
53  DtCommandDispatcherSP dispatcher();
54 
56  virtual const DtString& driverName() const;
57 
59  virtual const DtString& driverInfo();
60 
62  virtual void processCommand(const DtCommand& command);
63 
72  virtual bool releasePipeline() = 0;
73 
74 
78  virtual bool getPipeline() = 0;
79 
83  virtual bool hasPipeline() const = 0;
84 
85  protected:
86 
87  typedef DtLgrCommandHandler* (*DriverCreator)(DtCommandDispatcherSP);
88 
91  void addCommandHandler(const DtCommandDefinition& commandDef,
92  DtCommandFunctorSP commandFunctor);
93 
96  void removeCommandHandler(const DtCommandDefinition& commandDef);
97 
99  virtual void sendResponse(DtResponse response);
100 
102  virtual void queueResponse(DtResponse response);
103 
105  virtual void sendQueuedResponses();
106 
108  virtual void emptyResponseQueue();
109 
110  typedef std::map<DtLgrCommandId,DtCommandFunctorSP> DtLgrCommandHandlerMap;
111  typedef std::map<DtString,DtLgrCommandId> DtLgrCommandNameMap;
112 
113  typedef std::list<DtResponse> DtResponseQueue;
114 
116 
122 
123  DtMutex myMutex;
124  };
125 
126  typedef DtBoost::shared_ptr<DtLgrCommandHandler> DtLgrCommandHandlerSP;
127 
128 }
129 
130 #endif

Document ID: Generated on Thu Apr 10 18:53:01 EDT 2014 from SVN revision 138105
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)