open-dis-cpp
Association.h
1 #pragma once
2 
3 #include <dis7/EntityID.h>
4 #include <dis7/Vector3Double.h>
5 #include <dis7/utils/DataStream.h>
6 #include <dis7/opendis7_export.h>
7 
8 
9 namespace DIS
10 {
11 // An entity's associations with other entities and/or locations. For each association, this record shall specify the type of the association, the associated entity's EntityID and/or the associated location's world coordinates. This record may be used (optionally) in a transfer transaction to send internal state data from the divesting simulation to the acquiring simulation (see 5.9.4). This record may also be used for other purposes. Section 6.2.10
12 
13 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
14 //
15 // @author DMcG, jkg
16 
17 class OPENDIS7_EXPORT Association
18 {
19 protected:
20  unsigned char _associationType;
21 
22  unsigned char _padding4;
23 
26 
29 
30 
31  public:
32  Association();
33  virtual ~Association();
34 
35  virtual void marshal(DataStream& dataStream) const;
36  virtual void unmarshal(DataStream& dataStream);
37 
38  unsigned char getAssociationType() const;
39  void setAssociationType(unsigned char pX);
40 
41  unsigned char getPadding4() const;
42  void setPadding4(unsigned char pX);
43 
44  EntityID& getAssociatedEntityID();
45  const EntityID& getAssociatedEntityID() const;
46  void setAssociatedEntityID(const EntityID &pX);
47 
48  Vector3Double& getAssociatedLocation();
49  const Vector3Double& getAssociatedLocation() const;
50  void setAssociatedLocation(const Vector3Double &pX);
51 
52 
53 virtual int getMarshalledSize() const;
54 
55  bool operator ==(const Association& rhs) const;
56 };
57 }
58 
59 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
60 // Redistribution and use in source and binary forms, with or without
61 // modification, are permitted provided that the following conditions
62 // are met:
63 //
64 // * Redistributions of source code must retain the above copyright
65 // notice, this list of conditions and the following disclaimer.
66 // * Redistributions in binary form must reproduce the above copyright
67 // notice, this list of conditions and the following disclaimer
68 // in the documentation and/or other materials provided with the
69 // distribution.
70 // * Neither the names of the Naval Postgraduate School (NPS)
71 // Modeling Virtual Environments and Simulation (MOVES) Institute
72 // (http://www.nps.edu and http://www.MovesInstitute.org)
73 // nor the names of its contributors may be used to endorse or
74 // promote products derived from this software without specific
75 // prior written permission.
76 //
77 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
78 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
79 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
80 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
81 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
82 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
83 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
84 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
85 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
86 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
87 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
88 // 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
EntityID _associatedEntityID
identity of associated entity.
Definition: Association.h:25
Definition: Association.h:17
Definition: EntityID.h:15
Definition: Vector3Double.h:15
Vector3Double _associatedLocation
location, in world coordinates
Definition: Association.h:28