MAK Data Logger API Documentation for DIS
lgrEntityTracker.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 lgrEntityTracker_H_
10 #define lgrEntityTracker_H_
11 
12 #include "lgrCore.h"
13 #include "filePosition.h"
14 #include <virtualConstructor.h>
15 
16 #include <vector>
17 #include <map>
18 #include <set>
19 #include <vlutil/vlNetTypes.h>
20 #include <vlutil/vlString.h>
21 #include <vlpi/disEnums.h>
22 
23 namespace MAKLogger
24 {
25  class DtPacket;
26  class DtLgrBaseSimManager;
27 
31  {
32  public:
33  typedef int EntryHandle;
34  typedef std::set<DtLgrEntityTracker::EntryHandle> EntryHandleSet;
35 
36  public:
37 
39 
40 
41  virtual ~DtLgrEntityTracker();
42 
43  protected:
44 
46  DtLgrEntityTracker(const DtLgrEntityTracker&);
48  DtLgrEntityTracker& operator=(const DtLgrEntityTracker&);
49 
50  public:
52  virtual void parsePacket(const DtPacket& packet);
53 
56  virtual EntryHandle addEntry(double firstTime, double lastTime, const DtString& name,
57  const DtString& type, DtForceType force, DtLgrEntityTracker::EntryHandle handle = -1);
58 
63  virtual EntryHandle addTemporaryEntry(const DtString& name);
64 
67  virtual EntryHandle findEntry(const DtString& name) const;
68 
70  virtual void clearEntries();
71 
73  virtual int entityCount() const;
74 
76  virtual EntryHandle entityId(const DtPacket& packet) const;
77 
79  virtual DtString entityName(const DtPacket& packet) const;
80 
82  virtual DtString entityType(const DtPacket& packet) const;
83 
85  virtual DtForceType entityForce(const DtPacket& packet) const;
86 
88  virtual DtPacket* encodePacket() const;
89 
94  virtual void decodePacket(const DtPacket*);
95 
97  virtual double entityFirstTime(EntryHandle handle) const;
98 
100  virtual double entityLastTime(EntryHandle handle) const;
101 
103  virtual DtString entityName(EntryHandle handle) const;
104 
106  virtual DtString entityType(EntryHandle handle) const;
107 
109  virtual DtForceType entityForce(EntryHandle handle) const;
110 
112  virtual bool isPermanentEntry(EntryHandle handle) const;
113 
115  virtual void deserializeFromString(const DtString& data);
116 
118  virtual DtString serialize();
119 
124  virtual void simInitialize(DtLgrBaseSimManager* simMgr);
125 
127  virtual EntryHandle begin() const;
128 
130  virtual EntryHandle end() const;
131 
132 
133  typedef int TrackerUpdateId;
134  virtual DtLgrEntityTracker::TrackerUpdateId lastUpdateId() const;
135 
136  protected:
137 
140  {
141  bool temporary;
142 
143  double firstTime;
144  double lastTime;
145  DtForceType force;
146  DtString name;
147  DtString type;
148  };
149 
152  {
153  DtNetInt32 entrySize;
154 
155  DtNetFloat64 firstTime;
156  DtNetFloat64 lastTime;
157 
158  DtNetInt32 force;
159 
160  DtNetInt32 nameSize;
161  DtNetInt32 typeSize;
162  };
163 
166  {
167  struct NetTrackerEntryHeader header;
168  char name[1];
169  char type[1];
170  };
171 
174  {
175  DtNetU32 numEntries;
176  DtNetU32 unused;
177  };
178 
198 
199  typedef std::vector<TrackerEntry> TrackerEntryList;
201 
202  typedef std::map<DtString, EntryHandle> TrackerEntryIndex;
204 
206 
207  };
208 }
209 
210 #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)