open-dis-cpp
ReceiverPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/RadioCommunicationsFamilyPdu.h>
5 #include <dis6/utils/DataStream.h>
6 #include <dis6/opendis6_export.h>
7 
8 
9 namespace DIS
10 {
11 // Section 5.3.8.3. Communication of a receiver state. COMPLETE
12 
13 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
14 //
15 // @author DMcG, jkg
16 
17 class OPENDIS6_EXPORT ReceiverPdu : public RadioCommunicationsFamilyPdu
18 {
19 protected:
21  unsigned short _receiverState;
22 
24  unsigned short _padding1;
25 
28 
31 
33  unsigned short _transmitterRadioId;
34 
35 
36  public:
37  ReceiverPdu();
38  virtual ~ReceiverPdu();
39 
40  virtual void marshal(DataStream& dataStream) const;
41  virtual void unmarshal(DataStream& dataStream);
42 
43  unsigned short getReceiverState() const;
44  void setReceiverState(unsigned short pX);
45 
46  unsigned short getPadding1() const;
47  void setPadding1(unsigned short pX);
48 
49  float getReceivedPower() const;
50  void setReceivedPower(float pX);
51 
52  EntityID& getTransmitterEntityId();
53  const EntityID& getTransmitterEntityId() const;
54  void setTransmitterEntityId(const EntityID &pX);
55 
56  unsigned short getTransmitterRadioId() const;
57  void setTransmitterRadioId(unsigned short pX);
58 
59 
60 virtual int getMarshalledSize() const;
61 
62  bool operator ==(const ReceiverPdu& rhs) const;
63 };
64 }
65 
66 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
67 // Redistribution and use in source and binary forms, with or without
68 // modification, are permitted provided that the following conditions
69 // are met:
70 //
71 // * Redistributions of source code must retain the above copyright
72 // notice, this list of conditions and the following disclaimer.
73 // * Redistributions in binary form must reproduce the above copyright
74 // notice, this list of conditions and the following disclaimer
75 // in the documentation and/or other materials provided with the
76 // distribution.
77 // * Neither the names of the Naval Postgraduate School (NPS)
78 // Modeling Virtual Environments and Simulation (MOVES) Institute
79 // (http://www.nps.edu and http://www.MovesInstitute.org)
80 // nor the names of its contributors may be used to endorse or
81 // promote products derived from this software without specific
82 // prior written permission.
83 //
84 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
85 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
86 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
87 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
88 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
89 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
90 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
91 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
92 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
93 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
94 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
95 // POSSIBILITY OF SUCH DAMAGE.
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
Definition: RadioCommunicationsFamilyPdu.h:17
Definition: ReceiverPdu.h:17
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned short _transmitterRadioId
ID of transmitting radio.
Definition: ReceiverPdu.h:33
Definition: EntityID.h:15
float _receivedPower
received power
Definition: ReceiverPdu.h:27
unsigned short _padding1
padding
Definition: ReceiverPdu.h:24
EntityID _transmitterEntityId
ID of transmitter.
Definition: ReceiverPdu.h:30
unsigned short _receiverState
encoding scheme used, and enumeration
Definition: ReceiverPdu.h:21