]> git.mxchange.org Git - simgear.git/blob - simgear/hla/HLADataType.cxx
Add an initial implementation of a rti/hla dispatcher.
[simgear.git] / simgear / hla / HLADataType.cxx
1 // Copyright (C) 2009 - 2010  Mathias Froehlich - Mathias.Froehlich@web.de
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Library General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16 //
17
18 #include "HLADataType.hxx"
19
20 #include "HLADataElement.hxx"
21 #include "HLADataTypeVisitor.hxx"
22
23 namespace simgear {
24
25 HLADataType::HLADataType(const std::string& name, unsigned alignment) :
26     _name(name),
27     _alignment(1)
28 {
29     setAlignment(alignment);
30 }
31
32 HLADataType::~HLADataType()
33 {
34 }
35
36 void
37 HLADataType::accept(HLADataTypeVisitor& visitor) const
38 {
39     visitor.apply(*this);
40 }
41
42 const HLADataTypeReference*
43 HLADataType::toDataTypeReference() const
44 {
45     return 0;
46 }
47
48 const HLABasicDataType*
49 HLADataType::toBasicDataType() const
50 {
51     return 0;
52 }
53
54 const HLAArrayDataType*
55 HLADataType::toArrayDataType() const
56 {
57     return 0;
58 }
59
60 const HLAEnumeratedDataType*
61 HLADataType::toEnumeratedDataType() const
62 {
63     return 0;
64 }
65
66 const HLAFixedRecordDataType*
67 HLADataType::toFixedRecordDataType() const
68 {
69     return 0;
70 }
71
72 const HLAVariantDataType*
73 HLADataType::toVariantDataType() const
74 {
75     return 0;
76 }
77
78 void
79 HLADataType::setAlignment(unsigned alignment)
80 {
81     /// FIXME: more checks
82     if (alignment == 0)
83         _alignment = 1;
84     else
85         _alignment = alignment;
86 }
87
88 HLADataTypeReference::~HLADataTypeReference()
89 {
90 }
91
92 void
93 HLADataTypeReference::accept(HLADataTypeVisitor& visitor) const
94 {
95     visitor.apply(*this);
96 }
97
98 const HLADataTypeReference*
99 HLADataTypeReference::toDataTypeReference() const
100 {
101     return this;
102 }
103
104 }