open-dis-cpp
LiveEntityPdu.h
1 #pragma once
2 
3 #include <dis7/PduSuperclass.h>
4 #include <dis7/utils/DataStream.h>
5 #include <dis7/opendis7_export.h>
6 
7 
8 namespace DIS
9 {
10 // The live entity PDUs have a header with some different field names, but the same length. Section 9.3.2
11 
12 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
13 //
14 // @author DMcG, jkg
15 
16 class OPENDIS7_EXPORT LiveEntityPdu : public PduSuperclass
17 {
18 protected:
20  unsigned short _subprotocolNumber;
21 
23  unsigned char _padding;
24 
25 
26  public:
27  LiveEntityPdu();
28  virtual ~LiveEntityPdu();
29 
30  virtual void marshal(DataStream& dataStream) const;
31  virtual void unmarshal(DataStream& dataStream);
32 
33  unsigned short getSubprotocolNumber() const;
34  void setSubprotocolNumber(unsigned short pX);
35 
36  unsigned char getPadding() const;
37  void setPadding(unsigned char pX);
38 
39 
40 virtual int getMarshalledSize() const;
41 
42  bool operator ==(const LiveEntityPdu& rhs) const;
43 };
44 }
45 
46 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
47 // Redistribution and use in source and binary forms, with or without
48 // modification, are permitted provided that the following conditions
49 // are met:
50 //
51 // * Redistributions of source code must retain the above copyright
52 // notice, this list of conditions and the following disclaimer.
53 // * Redistributions in binary form must reproduce the above copyright
54 // notice, this list of conditions and the following disclaimer
55 // in the documentation and/or other materials provided with the
56 // distribution.
57 // * Neither the names of the Naval Postgraduate School (NPS)
58 // Modeling Virtual Environments and Simulation (MOVES) Institute
59 // (http://www.nps.edu and http://www.MovesInstitute.org)
60 // nor the names of its contributors may be used to endorse or
61 // promote products derived from this software without specific
62 // prior written permission.
63 //
64 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
65 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
66 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
67 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
68 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
69 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
70 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
71 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
72 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
73 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
74 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
75 // POSSIBILITY OF SUCH DAMAGE.
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned char _padding
zero-filled array of padding
Definition: LiveEntityPdu.h:23
a class to support managing a network buffer.
Definition: DataStream.h:28
Definition: PduSuperclass.h:15
Definition: LiveEntityPdu.h:16
unsigned short _subprotocolNumber
Subprotocol used to decode the PDU.
Definition: LiveEntityPdu.h:20