MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrDataViewSet.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2024 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef lgrDataViewSet_H_
10 #define lgrDataViewSet_H_
11 
12 #include <lgrCore/lgrCore.h>
13 
14 #include <deque>
15 #include <map>
16 #include <vector>
18 #include <vlutil/vlSmartPointers.h>
19 
20 namespace MAKLogger
21 {
22  class DtPacket;
23 
25  typedef DtBoost::shared_ptr<DtLgrDataViewSet> DtLgrDataViewSetSP;
26 
31  {
32  public:
33 
35  class DataPoint
36  {
37  public:
38  DataPoint() : myTime(-1.0), myType(255), mySize(0) {}
39  DataPoint(unsigned char typeValue, double timeValue, unsigned short sizeValue)
40  : myTime(timeValue), myType(typeValue), mySize(sizeValue) {}
41  DataPoint(const DataPoint &other)
42  : myTime(other.myTime), myType(other.myType), mySize(other.mySize) {}
43  virtual ~DataPoint() {}
44 
45  public:
46  DataPoint &operator=(const DataPoint &other)
47  {if (&other == this) return *this; myTime = other.myTime; myType = other.myType; mySize = other.mySize; return *this;}
48  void setTime(double value) {myTime = value;}
49  double time() const {return myTime;}
50  unsigned long getWholeTime() const { return myTime;}
51  void setSize(short value) {mySize = value;}
52  unsigned short size() const {return mySize;}
53  void setType(char value) {myType = value;}
54  unsigned char type() const {return myType;}
55 
56  protected:
57  double myTime;
58  unsigned short mySize;
59  unsigned char myType;
60  };
61 
62  typedef std::deque<DataPoint> DataPointSet;
63  typedef std::map<unsigned long, size_t> DataPointIndexMap;
64 
65  public:
66 
69 
70 
71  virtual ~DtLgrDataViewSet();
72 
75  virtual void addPacketData(const DtPacket& packet);
76 
78  virtual void addDataPoint(double time, unsigned char type, unsigned short size);
79 
81  virtual void addDataPoint(DataPoint const& point);
82 
84  virtual void append(const DtLgrDataViewSet& secondSet);
85 
88  virtual void clearAllBeforeTime(double time);
89 
91  virtual void clearSet();
92 
94  DataPointSet::const_iterator begin() const;
95 
97  DataPointSet::const_iterator end() const;
98 
100  DataPoint const& first() const;
101 
103  bool getFirst(DataPoint& firstPoint) const;
104 
106  DataPoint const& last() const;
107 
109  bool getLast(DataPoint& last) const;
110 
112  size_t size() const;
113 
116  virtual size_t fillSetFromTime(DtLgrDataViewSet& dataSet, double startTime, double endTime);
117 
120  virtual size_t fillSetFromIndex(DtLgrDataViewSet& dataSet, size_t startIndex, double endTime);
121 
122  protected:
123 
125  virtual void indexPacketTime(size_t index, unsigned long packetTime);
126 
129  virtual void adjustTimeIndex( const DtLgrDataViewSet& newSet );
130 
131  protected:
132 
134  DataPointSet myPoints;
136  DataPoint myInvalidPoint;
138  DataPointIndexMap myTimeIndexMap;
139  };
140 }
141 
142 #endif
unsigned short mySize
Definition: lgrDataViewSet.h:58
void setType(char value)
Definition: lgrDataViewSet.h:53
DataPoint(unsigned char typeValue, double timeValue, unsigned short sizeValue)
Definition: lgrDataViewSet.h:39
void setSize(short value)
Definition: lgrDataViewSet.h:51
unsigned long getWholeTime() const
Definition: lgrDataViewSet.h:50
virtual ~DataPoint()
Definition: lgrDataViewSet.h:43
#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
unsigned char myType
Definition: lgrDataViewSet.h:59
Contains DT_VIRTUAL_CTR DT_VIRTUAL_CTR_DEFAULTS DT_VIRTUAL_COPY_ASSIGN DT_VIRTUAL_BASE_CTR DT_PURE_VI...
unsigned char type() const
Definition: lgrDataViewSet.h:54
std::map< unsigned long, size_t > DataPointIndexMap
Definition: lgrDataViewSet.h:63
std::deque< DataPoint > DataPointSet
Definition: lgrDataViewSet.h:62
double myTime
Definition: lgrDataViewSet.h:57
DtBoost::shared_ptr< DtLgrDataViewSet > DtLgrDataViewSetSP
Definition: lgrDataViewSet.h:24
unsigned short size() const
Definition: lgrDataViewSet.h:52
void setTime(double value)
Definition: lgrDataViewSet.h:48
A generic packed of typed binary data.
Definition: packet.h:41
DataPoint & operator=(const DataPoint &other)
Definition: lgrDataViewSet.h:46
double time() const
Definition: lgrDataViewSet.h:49
#define DT_DLL_LGRCORE
Definition: lgrCore.h:19
Data for a single data point.
Definition: lgrDataViewSet.h:35
DataPoint(const DataPoint &other)
Definition: lgrDataViewSet.h:41
DataPoint()
Definition: lgrDataViewSet.h:38
Collection of data values sorted by time used for data views.
Definition: lgrDataViewSet.h:30
Contains lgrCore library definitions.

Document ID: Generated on Fri May 31 15:45:35 EDT 2024 from SVN revision 266500
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)