MetaEnumHelper.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 
19 #include <OpenKarto/MetaEnum.h>
20 
21 namespace karto
22 {
23 
24  MetaEnumHelper::MetaEnumHelper(MetaEnum& rMetaEnum)
25  : m_pMetaEnum(&rMetaEnum)
26  {
27  }
28 
29  MetaEnumHelper& MetaEnumHelper::Value(const karto::String& rName, kt_int64s value)
30  {
31  assert(!m_pMetaEnum->HasName(rName));
32  assert(!m_pMetaEnum->HasValue(value));
33 
34  EnumPair pair;
35  pair.name = rName;
36  pair.value = value;
37  m_pMetaEnum->AddEnumPair(pair);
38 
39  return *this;
40  }
41 
42 }
friend class MetaEnumHelper
Definition: MetaEnum.h:210
signed long long kt_int64s
Definition: Types.h:127
Definition: Any.cpp:20


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