open-dis-cpp
Munition.h
1 #pragma once
2 
3 #include <dis7/EntityType.h>
4 #include <dis7/utils/DataStream.h>
5 #include <dis7/opendis7_export.h>
6 
7 
8 namespace DIS
9 {
10 // An entity's munition (e.g., bomb, missile) information shall be represented by one or more Munition records. For each type or location of munition, this record shall specify the type, location, quantity and status of munitions that an entity contains. Section 6.2.60
11 
12 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
13 //
14 // @author DMcG, jkg
15 
16 class OPENDIS7_EXPORT Munition
17 {
18 protected:
21 
23  unsigned int _station;
24 
26  unsigned short _quantity;
27 
29  unsigned char _munitionStatus;
30 
32  unsigned char _padding;
33 
34 
35  public:
36  Munition();
37  virtual ~Munition();
38 
39  virtual void marshal(DataStream& dataStream) const;
40  virtual void unmarshal(DataStream& dataStream);
41 
42  EntityType& getMunitionType();
43  const EntityType& getMunitionType() const;
44  void setMunitionType(const EntityType &pX);
45 
46  unsigned int getStation() const;
47  void setStation(unsigned int pX);
48 
49  unsigned short getQuantity() const;
50  void setQuantity(unsigned short pX);
51 
52  unsigned char getMunitionStatus() const;
53  void setMunitionStatus(unsigned char pX);
54 
55  unsigned char getPadding() const;
56  void setPadding(unsigned char pX);
57 
58 
59 virtual int getMarshalledSize() const;
60 
61  bool operator ==(const Munition& 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.
unsigned char _munitionStatus
the status of the munition.
Definition: Munition.h:29
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
Definition: Munition.h:16
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned int _station
the station or launcher to which the munition is assigned.
Definition: Munition.h:23
unsigned char _padding
padding
Definition: Munition.h:32
Definition: EntityType.h:15
unsigned short _quantity
the quantity remaining of this munition.
Definition: Munition.h:26
EntityType _munitionType
This field shall identify the entity type of the munition.
Definition: Munition.h:20