MetaClass.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2011, SRI International (R)
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include <vector>
19 
20 #include <OpenKarto/MetaClass.h>
21 
22 namespace karto
23 {
24 
28 
30  {
31  std::vector<Any> m_Arguments;
32  };
33 
34  MetaArguments::MetaArguments()
35  : m_pPrivate(new MetaArgsPrivate)
36  {
37  }
38 
39  MetaArguments::MetaArguments(const Any& a0)
40  : m_pPrivate(new MetaArgsPrivate)
41  {
42  m_pPrivate->m_Arguments.push_back(a0);
43  }
44 
45  MetaArguments::MetaArguments(const Any& a0, const Any& a1)
46  : m_pPrivate(new MetaArgsPrivate)
47  {
48  m_pPrivate->m_Arguments.push_back(a0);
49  m_pPrivate->m_Arguments.push_back(a1);
50  }
51 
52  MetaArguments::MetaArguments(const Any& a0, const Any& a1, const Any& a2)
53  : m_pPrivate(new MetaArgsPrivate)
54  {
55  m_pPrivate->m_Arguments.push_back(a0);
56  m_pPrivate->m_Arguments.push_back(a1);
57  m_pPrivate->m_Arguments.push_back(a2);
58  }
59 
60  MetaArguments::MetaArguments(const Any& a0, const Any& a1, const Any& a2, const Any& a3)
61  : m_pPrivate(new MetaArgsPrivate)
62  {
63  m_pPrivate->m_Arguments.push_back(a0);
64  m_pPrivate->m_Arguments.push_back(a1);
65  m_pPrivate->m_Arguments.push_back(a2);
66  m_pPrivate->m_Arguments.push_back(a3);
67  }
68 
69  MetaArguments::MetaArguments(const Any& a0, const Any& a1, const Any& a2, const Any& a3, const Any& a4)
70  : m_pPrivate(new MetaArgsPrivate)
71  {
72  m_pPrivate->m_Arguments.push_back(a0);
73  m_pPrivate->m_Arguments.push_back(a1);
74  m_pPrivate->m_Arguments.push_back(a2);
75  m_pPrivate->m_Arguments.push_back(a3);
76  m_pPrivate->m_Arguments.push_back(a4);
77  }
78 
79  MetaArguments::~MetaArguments()
80  {
81  delete m_pPrivate;
82  }
83 
84  kt_size_t MetaArguments::GetCount() const
85  {
86  return m_pPrivate->m_Arguments.size();
87  }
88 
89  const Any& MetaArguments::operator[](kt_size_t index) const
90  {
91  assert(index >= 0 && index < GetCount());
92  return m_pPrivate->m_Arguments[index];
93  }
94 
98 
100  : m_Name(rName)
101  {
102  }
103 
105  {
106  }
107 
109  {
110  return m_Name;
111  }
112 
114  {
115  return m_BaseClasses.Size();
116  }
117 
119  {
120  if (index >= m_BaseClasses.Size())
121  {
122  assert(false);
123  throw karto::Exception("MetaClass::GetBase() - Index out of range");
124  }
125 
126  return *m_BaseClasses[index];
127  }
128 
129  bool MetaClass::operator==(const MetaClass& rOther) const
130  {
131  return m_Name == rOther.m_Name;
132  }
133 
134  bool MetaClass::operator!=(const MetaClass& rOther) const
135  {
136  return m_Name != rOther.m_Name;
137  }
138 
142 
143 }
karto::String m_Name
Definition: MetaClass.h:358
kt_bool operator!=(const MetaClass &rOther) const
Definition: MetaClass.cpp:134
std::size_t kt_size_t
Definition: Types.h:138
Definition: Any.h:55
List< const MetaClass * > m_BaseClasses
Definition: MetaClass.h:359
const karto::String & GetName() const
Definition: MetaClass.cpp:108
const MetaClass & GetBase(kt_size_t index) const
Definition: MetaClass.cpp:118
kt_bool operator==(const MetaClass &rOther) const
Definition: MetaClass.cpp:129
kt_size_t GetBaseSize() const
Definition: MetaClass.cpp:113
std::vector< Any > m_Arguments
Definition: MetaClass.cpp:31
Definition: Any.cpp:20
MetaClass(const karto::String &rName)
Definition: MetaClass.cpp:99


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Thu Jun 6 2019 19:20:24