]> git.mxchange.org Git - simgear.git/blob - simgear/hla/HLADataType.cxx
hla: Use raw pointers for HLAFederate::_insert methods.
[simgear.git] / simgear / hla / HLADataType.cxx
1 // Copyright (C) 2009 - 2012  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 #ifdef HAVE_CONFIG_H
19 #  include <simgear_config.h>
20 #endif
21
22 #include <simgear/compiler.h>
23
24 #include "HLADataType.hxx"
25
26 #include "HLADataElement.hxx"
27 #include "HLADataTypeVisitor.hxx"
28
29 namespace simgear {
30
31 HLADataType::HLADataType(const std::string& name, unsigned alignment) :
32     _name(name),
33     _alignment(1)
34 {
35     setAlignment(alignment);
36 }
37
38 HLADataType::~HLADataType()
39 {
40 }
41
42 void
43 HLADataType::accept(HLADataTypeVisitor& visitor) const
44 {
45     visitor.apply(*this);
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 HLAVariantRecordDataType*
73 HLADataType::toVariantRecordDataType() const
74 {
75     return 0;
76 }
77
78 bool
79 HLADataType::recomputeAlignment()
80 {
81     unsigned alignment = getAlignment();
82     _recomputeAlignmentImplementation();
83     return alignment != getAlignment();
84 }
85
86 void
87 HLADataType::releaseDataTypeReferences()
88 {
89 }
90
91 void
92 HLADataType::setAlignment(unsigned alignment)
93 {
94     /// FIXME: more checks
95     if (alignment == 0)
96         _alignment = 1;
97     else
98         _alignment = alignment;
99 }
100
101 void
102 HLADataType::_recomputeAlignmentImplementation()
103 {
104 }
105
106 }