open-dis-cpp
AttributePdu.h
1 #pragma once
2 
3 #include <dis7/SimulationAddress.h>
4 #include <dis7/EntityInformationFamilyPdu.h>
5 #include <dis7/utils/DataStream.h>
6 #include <dis7/opendis7_export.h>
7 
8 
9 namespace DIS
10 {
11 // Information about individual attributes for a particular entity, other object, or event may be communicated using an Attribute PDU. The Attribute PDU shall not be used to exchange data available in any other PDU except where explicitly mentioned in the PDU issuance instructions within this standard. See 5.3.6 for the information requirements and issuance and receipt rules for this PDU. Section 7.2.6. INCOMPLETE
12 
13 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
14 //
15 // @author DMcG, jkg
16 
17 class OPENDIS7_EXPORT AttributePdu : public EntityInformationFamilyPdu
18 {
19 protected:
22 
24  int _padding1;
25 
27  short _padding2;
28 
30  unsigned char _attributeRecordPduType;
31 
34 
37 
39  unsigned char _actionCode;
40 
42  char _padding3;
43 
45  unsigned short _numberAttributeRecordSet;
46 
47 
48  public:
49  AttributePdu();
50  virtual ~AttributePdu();
51 
52  virtual void marshal(DataStream& dataStream) const;
53  virtual void unmarshal(DataStream& dataStream);
54 
55  SimulationAddress& getOriginatingSimulationAddress();
56  const SimulationAddress& getOriginatingSimulationAddress() const;
57  void setOriginatingSimulationAddress(const SimulationAddress &pX);
58 
59  int getPadding1() const;
60  void setPadding1(int pX);
61 
62  short getPadding2() const;
63  void setPadding2(short pX);
64 
65  unsigned char getAttributeRecordPduType() const;
66  void setAttributeRecordPduType(unsigned char pX);
67 
68  unsigned char getAttributeRecordProtocolVersion() const;
69  void setAttributeRecordProtocolVersion(unsigned char pX);
70 
71  unsigned int getMasterAttributeRecordType() const;
72  void setMasterAttributeRecordType(unsigned int pX);
73 
74  unsigned char getActionCode() const;
75  void setActionCode(unsigned char pX);
76 
77  char getPadding3() const;
78  void setPadding3(char pX);
79 
80  unsigned short getNumberAttributeRecordSet() const;
81  void setNumberAttributeRecordSet(unsigned short pX);
82 
83 
84 virtual int getMarshalledSize() const;
85 
86  bool operator ==(const AttributePdu& rhs) const;
87 };
88 }
89 
90 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
91 // Redistribution and use in source and binary forms, with or without
92 // modification, are permitted provided that the following conditions
93 // are met:
94 //
95 // * Redistributions of source code must retain the above copyright
96 // notice, this list of conditions and the following disclaimer.
97 // * Redistributions in binary form must reproduce the above copyright
98 // notice, this list of conditions and the following disclaimer
99 // in the documentation and/or other materials provided with the
100 // distribution.
101 // * Neither the names of the Naval Postgraduate School (NPS)
102 // Modeling Virtual Environments and Simulation (MOVES) Institute
103 // (http://www.nps.edu and http://www.MovesInstitute.org)
104 // nor the names of its contributors may be used to endorse or
105 // promote products derived from this software without specific
106 // prior written permission.
107 //
108 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
109 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
110 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
111 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
112 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
113 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
114 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
115 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
116 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
117 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
118 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
119 // POSSIBILITY OF SUCH DAMAGE.
Definition: SimulationAddress.h:15
int _padding1
Padding.
Definition: AttributePdu.h:24
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
SimulationAddress _originatingSimulationAddress
This field shall identify the simulation issuing the Attribute PDU.
Definition: AttributePdu.h:21
unsigned char _attributeRecordPduType
This field shall represent the type of the PDU that is being extended or updated, if applicable...
Definition: AttributePdu.h:30
Definition: EntityInformationFamilyPdu.h:16
a class to support managing a network buffer.
Definition: DataStream.h:28
char _padding3
Padding.
Definition: AttributePdu.h:42
short _padding2
Padding.
Definition: AttributePdu.h:27
Definition: AttributePdu.h:17
unsigned int _masterAttributeRecordType
This field shall contain the Attribute record type of the Attribute records in the PDU if they all ha...
Definition: AttributePdu.h:36
unsigned short _numberAttributeRecordSet
This field shall specify the number of Attribute Record Sets that make up the remainder of the PDU...
Definition: AttributePdu.h:45
unsigned char _attributeRecordProtocolVersion
This field shall indicate the Protocol Version associated with the Attribute Record PDU Type...
Definition: AttributePdu.h:33
unsigned char _actionCode
This field shall identify the action code applicable to this Attribute PDU.
Definition: AttributePdu.h:39