open-dis-cpp
GridAxisRecordRepresentation1.h
1 #pragma once
2 
3 #include <dis6/TwoByteChunk.h>
4 #include <vector>
5 #include <dis6/GridAxisRecord.h>
6 #include <dis6/utils/DataStream.h>
7 #include <dis6/opendis6_export.h>
8 
9 
10 namespace DIS
11 {
12 // 5.2.44: Grid data record, representation 1
13 
14 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
15 //
16 // @author DMcG, jkg
17 
18 class OPENDIS6_EXPORT GridAxisRecordRepresentation1 : public GridAxisRecord
19 {
20 protected:
22  float _fieldScale;
23 
25  float _fieldOffset;
26 
28  unsigned short _numberOfValues;
29 
31  std::vector<TwoByteChunk> _dataValues;
32 
33 
34  public:
37 
38  virtual void marshal(DataStream& dataStream) const;
39  virtual void unmarshal(DataStream& dataStream);
40 
41  float getFieldScale() const;
42  void setFieldScale(float pX);
43 
44  float getFieldOffset() const;
45  void setFieldOffset(float pX);
46 
47  unsigned short getNumberOfValues() const;
48 
49  std::vector<TwoByteChunk>& getDataValues();
50  const std::vector<TwoByteChunk>& getDataValues() const;
51  void setDataValues(const std::vector<TwoByteChunk>& pX);
52 
53 
54 virtual int getMarshalledSize() const;
55 
56  bool operator ==(const GridAxisRecordRepresentation1& rhs) const;
57 };
58 }
59 
60 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
61 // Redistribution and use in source and binary forms, with or without
62 // modification, are permitted provided that the following conditions
63 // are met:
64 //
65 // * Redistributions of source code must retain the above copyright
66 // notice, this list of conditions and the following disclaimer.
67 // * Redistributions in binary form must reproduce the above copyright
68 // notice, this list of conditions and the following disclaimer
69 // in the documentation and/or other materials provided with the
70 // distribution.
71 // * Neither the names of the Naval Postgraduate School (NPS)
72 // Modeling Virtual Environments and Simulation (MOVES) Institute
73 // (http://www.nps.edu and http://www.MovesInstitute.org)
74 // nor the names of its contributors may be used to endorse or
75 // promote products derived from this software without specific
76 // prior written permission.
77 //
78 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
79 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
80 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
81 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
82 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
83 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
84 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
85 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
86 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
87 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
88 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
89 // POSSIBILITY OF SUCH DAMAGE.
std::vector< TwoByteChunk > _dataValues
variable length list of data parameters ^^^this is wrong–need padding as well
Definition: GridAxisRecordRepresentation1.h:31
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
a class to support managing a network buffer.
Definition: DataStream.h:28
float _fieldOffset
constant offset used to scale grid data
Definition: GridAxisRecordRepresentation1.h:25
Definition: GridAxisRecord.h:15
Definition: GridAxisRecordRepresentation1.h:18
float _fieldScale
constant scale factor
Definition: GridAxisRecordRepresentation1.h:22
unsigned short _numberOfValues
Number of data values.
Definition: GridAxisRecordRepresentation1.h:28