open-dis-cpp
MinefieldQueryPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityID.h>
5 #include <dis6/EntityType.h>
6 #include <dis6/Point.h>
7 #include <dis6/TwoByteChunk.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.2 Query a minefield for information about individual mines. Requires manual clean up to get the padding right. 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 MinefieldQueryPdu : public MinefieldFamilyPdu
23 {
24 protected:
27 
30 
32  unsigned char _requestID;
33 
35  unsigned char _numberOfPerimeterPoints;
36 
38  unsigned char _pad2;
39 
41  unsigned char _numberOfSensorTypes;
42 
44  unsigned int _dataFilter;
45 
48 
50  std::vector<Point> _requestedPerimeterPoints;
51 
53  std::vector<TwoByteChunk> _sensorTypes;
54 
55 
56  public:
58  virtual ~MinefieldQueryPdu();
59 
60  virtual void marshal(DataStream& dataStream) const;
61  virtual void unmarshal(DataStream& dataStream);
62 
63  EntityID& getMinefieldID();
64  const EntityID& getMinefieldID() const;
65  void setMinefieldID(const EntityID &pX);
66 
67  EntityID& getRequestingEntityID();
68  const EntityID& getRequestingEntityID() const;
69  void setRequestingEntityID(const EntityID &pX);
70 
71  unsigned char getRequestID() const;
72  void setRequestID(unsigned char pX);
73 
74  unsigned char getNumberOfPerimeterPoints() const;
75 
76  unsigned char getPad2() const;
77  void setPad2(unsigned char pX);
78 
79  unsigned char getNumberOfSensorTypes() const;
80 
81  unsigned int getDataFilter() const;
82  void setDataFilter(unsigned int pX);
83 
84  EntityType& getRequestedMineType();
85  const EntityType& getRequestedMineType() const;
86  void setRequestedMineType(const EntityType &pX);
87 
88  std::vector<Point>& getRequestedPerimeterPoints();
89  const std::vector<Point>& getRequestedPerimeterPoints() const;
90  void setRequestedPerimeterPoints(const std::vector<Point>& pX);
91 
92  std::vector<TwoByteChunk>& getSensorTypes();
93  const std::vector<TwoByteChunk>& getSensorTypes() const;
94  void setSensorTypes(const std::vector<TwoByteChunk>& pX);
95 
96 
97 virtual int getMarshalledSize() const;
98 
99  bool operator ==(const MinefieldQueryPdu& rhs) const;
100 };
101 }
102 
103 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
104 // Redistribution and use in source and binary forms, with or without
105 // modification, are permitted provided that the following conditions
106 // are met:
107 //
108 // * Redistributions of source code must retain the above copyright
109 // notice, this list of conditions and the following disclaimer.
110 // * Redistributions in binary form must reproduce the above copyright
111 // notice, this list of conditions and the following disclaimer
112 // in the documentation and/or other materials provided with the
113 // distribution.
114 // * Neither the names of the Naval Postgraduate School (NPS)
115 // Modeling Virtual Environments and Simulation (MOVES) Institute
116 // (http://www.nps.edu and http://www.MovesInstitute.org)
117 // nor the names of its contributors may be used to endorse or
118 // promote products derived from this software without specific
119 // prior written permission.
120 //
121 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
122 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
123 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
124 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
125 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
126 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
127 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
128 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
129 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
130 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
131 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
132 // POSSIBILITY OF SUCH DAMAGE.
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned char _numberOfPerimeterPoints
Number of perimeter points for the minefield.
Definition: MinefieldQueryPdu.h:35
EntityID _requestingEntityID
EID of entity making the request.
Definition: MinefieldQueryPdu.h:29
EntityID _minefieldID
Minefield ID.
Definition: MinefieldQueryPdu.h:26
unsigned int _dataFilter
data filter, 32 boolean fields
Definition: MinefieldQueryPdu.h:44
std::vector< TwoByteChunk > _sensorTypes
Sensor types, each 16 bits long.
Definition: MinefieldQueryPdu.h:53
Definition: EntityID.h:15
std::vector< Point > _requestedPerimeterPoints
perimeter points of request
Definition: MinefieldQueryPdu.h:50
Definition: EntityType.h:15
Definition: MinefieldFamilyPdu.h:16
unsigned char _numberOfSensorTypes
Number of sensor types.
Definition: MinefieldQueryPdu.h:41
unsigned char _requestID
request ID
Definition: MinefieldQueryPdu.h:32
EntityType _requestedMineType
Entity type of mine being requested.
Definition: MinefieldQueryPdu.h:47
unsigned char _pad2
Padding.
Definition: MinefieldQueryPdu.h:38
Definition: MinefieldQueryPdu.h:22