Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
OpenKarto
source
MetaAttribute.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 <map>
19
20
#include <
OpenKarto/MetaAttribute.h
>
21
22
namespace
karto
23
{
24
28
29
struct
MetaAttributePrivate
30
{
31
typedef
std::map< karto::String, Any >
Attributes
;
32
Attributes
m_Attributes
;
33
};
34
38
39
MetaAttribute::MetaAttribute
()
40
: m_pPrivate(new
MetaAttributePrivate
())
41
{
42
}
43
44
MetaAttribute::~MetaAttribute
()
45
{
46
delete
m_pPrivate
;
47
}
48
49
kt_bool
MetaAttribute::HasAttribute
(
const
karto::String
& rId)
const
50
{
51
return
m_pPrivate
->
m_Attributes
.find(rId) !=
m_pPrivate
->
m_Attributes
.end();
52
}
53
54
const
Any
&
MetaAttribute::GetAttribute
(
const
karto::String
& rId)
const
55
{
56
MetaAttributePrivate::Attributes::const_iterator iter =
m_pPrivate
->
m_Attributes
.find(rId);
57
if
(iter !=
m_pPrivate
->
m_Attributes
.end())
58
{
59
return
iter->second;
60
}
61
62
return
Any::Empty
;
63
}
64
65
void
MetaAttribute::AddAttribute
(
const
karto::String
& rId,
const
Any
& rValue)
const
66
{
67
m_pPrivate
->
m_Attributes
[rId] = rValue;
68
}
69
70
}
karto::MetaAttribute::m_pPrivate
MetaAttributePrivate * m_pPrivate
Definition:
MetaAttribute.h:86
kt_bool
bool kt_bool
Definition:
Types.h:145
karto::Any
Definition:
Any.h:55
karto::String
Definition:
String.h:52
karto::MetaAttributePrivate
Definition:
MetaAttribute.cpp:29
karto::Any::Empty
static const Any Empty
Definition:
Any.h:191
karto::MetaAttributePrivate::Attributes
std::map< karto::String, Any > Attributes
Definition:
MetaAttribute.cpp:31
karto::MetaAttribute::AddAttribute
void AddAttribute(const karto::String &rId, const Any &rValue) const
Definition:
MetaAttribute.cpp:65
karto::MetaAttribute::~MetaAttribute
virtual ~MetaAttribute()
Definition:
MetaAttribute.cpp:44
karto::MetaAttribute::MetaAttribute
MetaAttribute()
Definition:
MetaAttribute.cpp:39
karto::MetaAttribute::GetAttribute
const Any & GetAttribute(const karto::String &rId) const
Definition:
MetaAttribute.cpp:54
karto::MetaAttributePrivate::m_Attributes
Attributes m_Attributes
Definition:
MetaAttribute.cpp:32
karto
Definition:
Any.cpp:20
MetaAttribute.h
karto::MetaAttribute::HasAttribute
kt_bool HasAttribute(const karto::String &rId) const
Definition:
MetaAttribute.cpp:49
nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Tue Nov 7 2017 06:02:36