open-dis-cpp
IOCommunicationsNode.h
1 #pragma once
2 
3 #include <dis7/EntityID.h>
4 #include <dis7/utils/DataStream.h>
5 #include <dis7/opendis7_export.h>
6 
7 
8 namespace DIS
9 {
10 // A communications node that is part of a simulted communcations network. Section 6.2.49.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 IOCommunicationsNode
17 {
18 protected:
19  unsigned int _recordType;
20 
21  unsigned short _recordLength;
22 
23  unsigned char _communcationsNodeType;
24 
25  unsigned char _padding;
26 
27  EntityID _communicationsNode;
28 
29  unsigned short _elementID;
30 
31 
32  public:
34  virtual ~IOCommunicationsNode();
35 
36  virtual void marshal(DataStream& dataStream) const;
37  virtual void unmarshal(DataStream& dataStream);
38 
39  unsigned int getRecordType() const;
40  void setRecordType(unsigned int pX);
41 
42  unsigned short getRecordLength() const;
43  void setRecordLength(unsigned short pX);
44 
45  unsigned char getCommuncationsNodeType() const;
46  void setCommuncationsNodeType(unsigned char pX);
47 
48  unsigned char getPadding() const;
49  void setPadding(unsigned char pX);
50 
51  EntityID& getCommunicationsNode();
52  const EntityID& getCommunicationsNode() const;
53  void setCommunicationsNode(const EntityID &pX);
54 
55  unsigned short getElementID() const;
56  void setElementID(unsigned short pX);
57 
58 
59 virtual int getMarshalledSize() const;
60 
61  bool operator ==(const IOCommunicationsNode& rhs) const;
62 };
63 }
64 
65 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
66 // Redistribution and use in source and binary forms, with or without
67 // modification, are permitted provided that the following conditions
68 // are met:
69 //
70 // * Redistributions of source code must retain the above copyright
71 // notice, this list of conditions and the following disclaimer.
72 // * Redistributions in binary form must reproduce the above copyright
73 // notice, this list of conditions and the following disclaimer
74 // in the documentation and/or other materials provided with the
75 // distribution.
76 // * Neither the names of the Naval Postgraduate School (NPS)
77 // Modeling Virtual Environments and Simulation (MOVES) Institute
78 // (http://www.nps.edu and http://www.MovesInstitute.org)
79 // nor the names of its contributors may be used to endorse or
80 // promote products derived from this software without specific
81 // prior written permission.
82 //
83 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
84 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
85 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
86 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
87 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
88 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
89 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
90 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
91 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
92 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
93 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
94 // POSSIBILITY OF SUCH DAMAGE.
Definition: IOCommunicationsNode.h:16
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
a class to support managing a network buffer.
Definition: DataStream.h:28
Definition: EntityID.h:15