open-dis-cpp
MinefieldDataPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityID.h>
5 #include <dis6/EntityType.h>
6 #include <dis6/TwoByteChunk.h>
7 #include <dis6/Vector3Float.h>
8 #include <vector>
9 #include <dis6/MinefieldFamilyPdu.h>
10 #include <dis6/utils/DataStream.h>
11 #include <dis6/opendis6_export.h>
12 
13 
14 namespace DIS
15 {
16 // Section 5.3.10.3 Information about individual mines within a minefield. This is very, very wrong. UNFINISHED
17 
18 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
19 //
20 // @author DMcG, jkg
21 
22 class OPENDIS6_EXPORT MinefieldDataPdu : public MinefieldFamilyPdu
23 {
24 protected:
27 
30 
32  unsigned short _minefieldSequenceNumbeer;
33 
35  unsigned char _requestID;
36 
38  unsigned char _pduSequenceNumber;
39 
41  unsigned char _numberOfPdus;
42 
44  unsigned char _numberOfMinesInThisPdu;
45 
47  unsigned char _numberOfSensorTypes;
48 
50  unsigned char _pad2;
51 
53  unsigned int _dataFilter;
54 
57 
59  std::vector<TwoByteChunk> _sensorTypes;
60 
62  unsigned char _pad3;
63 
65  std::vector<Vector3Float> _mineLocation;
66 
67 
68  public:
70  virtual ~MinefieldDataPdu();
71 
72  virtual void marshal(DataStream& dataStream) const;
73  virtual void unmarshal(DataStream& dataStream);
74 
75  EntityID& getMinefieldID();
76  const EntityID& getMinefieldID() const;
77  void setMinefieldID(const EntityID &pX);
78 
79  EntityID& getRequestingEntityID();
80  const EntityID& getRequestingEntityID() const;
81  void setRequestingEntityID(const EntityID &pX);
82 
83  unsigned short getMinefieldSequenceNumbeer() const;
84  void setMinefieldSequenceNumbeer(unsigned short pX);
85 
86  unsigned char getRequestID() const;
87  void setRequestID(unsigned char pX);
88 
89  unsigned char getPduSequenceNumber() const;
90  void setPduSequenceNumber(unsigned char pX);
91 
92  unsigned char getNumberOfPdus() const;
93  void setNumberOfPdus(unsigned char pX);
94 
95  unsigned char getNumberOfMinesInThisPdu() const;
96 
97  unsigned char getNumberOfSensorTypes() const;
98 
99  unsigned char getPad2() const;
100  void setPad2(unsigned char pX);
101 
102  unsigned int getDataFilter() const;
103  void setDataFilter(unsigned int pX);
104 
105  EntityType& getMineType();
106  const EntityType& getMineType() const;
107  void setMineType(const EntityType &pX);
108 
109  std::vector<TwoByteChunk>& getSensorTypes();
110  const std::vector<TwoByteChunk>& getSensorTypes() const;
111  void setSensorTypes(const std::vector<TwoByteChunk>& pX);
112 
113  unsigned char getPad3() const;
114  void setPad3(unsigned char pX);
115 
116  std::vector<Vector3Float>& getMineLocation();
117  const std::vector<Vector3Float>& getMineLocation() const;
118  void setMineLocation(const std::vector<Vector3Float>& pX);
119 
120 
121 virtual int getMarshalledSize() const;
122 
123  bool operator ==(const MinefieldDataPdu& rhs) const;
124 };
125 }
126 
127 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
128 // Redistribution and use in source and binary forms, with or without
129 // modification, are permitted provided that the following conditions
130 // are met:
131 //
132 // * Redistributions of source code must retain the above copyright
133 // notice, this list of conditions and the following disclaimer.
134 // * Redistributions in binary form must reproduce the above copyright
135 // notice, this list of conditions and the following disclaimer
136 // in the documentation and/or other materials provided with the
137 // distribution.
138 // * Neither the names of the Naval Postgraduate School (NPS)
139 // Modeling Virtual Environments and Simulation (MOVES) Institute
140 // (http://www.nps.edu and http://www.MovesInstitute.org)
141 // nor the names of its contributors may be used to endorse or
142 // promote products derived from this software without specific
143 // prior written permission.
144 //
145 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
146 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
147 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
148 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
149 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
150 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
151 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
152 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
153 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
154 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
155 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
156 // POSSIBILITY OF SUCH DAMAGE.
unsigned char _numberOfMinesInThisPdu
how many mines are in this PDU
Definition: MinefieldDataPdu.h:44
std::vector< Vector3Float > _mineLocation
Mine locations.
Definition: MinefieldDataPdu.h:65
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
EntityID _requestingEntityID
ID of entity making request.
Definition: MinefieldDataPdu.h:29
unsigned char _pduSequenceNumber
pdu sequence number
Definition: MinefieldDataPdu.h:38
EntityType _mineType
Mine type.
Definition: MinefieldDataPdu.h:56
unsigned char _pad2
padding
Definition: MinefieldDataPdu.h:50
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned char _pad3
Padding to get things 32-bit aligned.
Definition: MinefieldDataPdu.h:62
Definition: MinefieldDataPdu.h:22
std::vector< TwoByteChunk > _sensorTypes
Sensor types, each 16 bits long.
Definition: MinefieldDataPdu.h:59
unsigned char _requestID
request ID
Definition: MinefieldDataPdu.h:35
unsigned int _dataFilter
32 boolean fields
Definition: MinefieldDataPdu.h:53
Definition: EntityID.h:15
unsigned char _numberOfPdus
number of pdus in response
Definition: MinefieldDataPdu.h:41
Definition: EntityType.h:15
Definition: MinefieldFamilyPdu.h:16
unsigned char _numberOfSensorTypes
how many sensor type are in this PDU
Definition: MinefieldDataPdu.h:47
EntityID _minefieldID
Minefield ID.
Definition: MinefieldDataPdu.h:26
unsigned short _minefieldSequenceNumbeer
Minefield sequence number.
Definition: MinefieldDataPdu.h:32