open-dis-cpp
ObjectType.h
1 #pragma once
2 
3 #include <dis6/utils/DataStream.h>
4 #include <dis6/opendis6_export.h>
5 
6 
7 namespace DIS
8 {
9 // Identifies type of object. This is a shorter version of EntityType that omits the specific and extra fields.
10 
11 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
12 //
13 // @author DMcG, jkg
14 
15 class OPENDIS6_EXPORT ObjectType
16 {
17 protected:
19  unsigned char _entityKind;
20 
22  unsigned char _domain;
23 
25  unsigned short _country;
26 
28  unsigned char _category;
29 
31  unsigned char _subcategory;
32 
33 
34  public:
35  ObjectType();
36  virtual ~ObjectType();
37 
38  virtual void marshal(DataStream& dataStream) const;
39  virtual void unmarshal(DataStream& dataStream);
40 
41  unsigned char getEntityKind() const;
42  void setEntityKind(unsigned char pX);
43 
44  unsigned char getDomain() const;
45  void setDomain(unsigned char pX);
46 
47  unsigned short getCountry() const;
48  void setCountry(unsigned short pX);
49 
50  unsigned char getCategory() const;
51  void setCategory(unsigned char pX);
52 
53  unsigned char getSubcategory() const;
54  void setSubcategory(unsigned char pX);
55 
56 
57 virtual int getMarshalledSize() const;
58 
59  bool operator ==(const ObjectType& rhs) const;
60 };
61 }
62 
63 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
64 // Redistribution and use in source and binary forms, with or without
65 // modification, are permitted provided that the following conditions
66 // are met:
67 //
68 // * Redistributions of source code must retain the above copyright
69 // notice, this list of conditions and the following disclaimer.
70 // * Redistributions in binary form must reproduce the above copyright
71 // notice, this list of conditions and the following disclaimer
72 // in the documentation and/or other materials provided with the
73 // distribution.
74 // * Neither the names of the Naval Postgraduate School (NPS)
75 // Modeling Virtual Environments and Simulation (MOVES) Institute
76 // (http://www.nps.edu and http://www.MovesInstitute.org)
77 // nor the names of its contributors may be used to endorse or
78 // promote products derived from this software without specific
79 // prior written permission.
80 //
81 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
82 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
83 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
84 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
85 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
86 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
87 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
88 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
89 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
90 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
91 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
92 // POSSIBILITY OF SUCH DAMAGE.
unsigned char _entityKind
Kind of entity.
Definition: ObjectType.h:19
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: ObjectType.h:15
unsigned short _country
country to which the design of the entity is attributed
Definition: ObjectType.h:25
unsigned char _subcategory
subcategory of entity
Definition: ObjectType.h:31
unsigned char _domain
Domain of entity (air, surface, subsurface, space, etc)
Definition: ObjectType.h:22
unsigned char _category
category of entity
Definition: ObjectType.h:28