Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
OpenKarto
source
Dataset.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 <
OpenKarto/Dataset.h
>
19
#include <
OpenKarto/TypeCasts.h
>
20
21
namespace
karto
22
{
23
27
28
struct
DatasetPrivate
29
{
30
ObjectList
m_Objects
;
31
SmartPointer<DatasetInfo>
m_pDatasetInfo
;
32
};
33
34
Dataset::Dataset
()
35
: m_pDatasetPrivate(new
DatasetPrivate
())
36
{
37
m_pDatasetPrivate
->
m_pDatasetInfo
= NULL;
38
}
39
40
Dataset::~Dataset()
41
{
42
Clear
();
43
44
delete
m_pDatasetPrivate
;
45
}
46
47
void
Dataset::Add
(
Object
* pObject)
48
{
49
if
(pObject != NULL)
50
{
51
if
(IsDatasetInfo(pObject))
52
{
53
m_pDatasetPrivate
->
m_pDatasetInfo
=
dynamic_cast<
DatasetInfo*
>
(pObject);
54
}
55
else
56
{
57
m_pDatasetPrivate
->
m_Objects
.
Add
(pObject);
58
}
59
}
60
}
61
62
DatasetInfo*
Dataset::GetDatasetInfo
()
63
{
64
return
m_pDatasetPrivate
->
m_pDatasetInfo
;
65
}
66
67
void
Dataset::Clear
()
68
{
69
m_pDatasetPrivate
->
m_Objects
.
Clear
();
70
m_pDatasetPrivate
->
m_pDatasetInfo
= NULL;
71
}
72
73
const
ObjectList
&
Dataset::GetObjects
()
const
74
{
75
return
m_pDatasetPrivate
->
m_Objects
;
76
}
77
78
Object
*
Dataset::operator[]
(
kt_int32u
index)
const
79
{
80
assert(index < m_pDatasetPrivate->m_Objects.Size());
81
return
m_pDatasetPrivate
->
m_Objects
[index];
82
}
83
84
}
karto::Dataset::Clear
void Clear()
Definition:
Dataset.cpp:67
TypeCasts.h
karto::SmartPointer< DatasetInfo >
karto::Dataset::GetObjects
const ObjectList & GetObjects() const
Definition:
Dataset.cpp:73
karto::DatasetPrivate
Definition:
Dataset.cpp:28
karto::List::Add
virtual void Add(const T &rValue)
Definition:
List.h:111
karto::Dataset::operator[]
Object * operator[](kt_int32u index) const
Definition:
Dataset.cpp:78
karto::Dataset::Add
void Add(Object *pObject)
Definition:
Dataset.cpp:47
kt_int32u
uint32_t kt_int32u
Definition:
Types.h:111
karto::Dataset::Dataset
Dataset()
Definition:
Dataset.cpp:34
karto::List< ObjectPtr >
karto::Object
Definition:
Object.h:54
karto::Dataset::m_pDatasetPrivate
DatasetPrivate * m_pDatasetPrivate
Definition:
Dataset.h:96
karto::DatasetPrivate::m_Objects
ObjectList m_Objects
Definition:
Dataset.cpp:30
Dataset.h
karto::Dataset::GetDatasetInfo
DatasetInfo * GetDatasetInfo()
Definition:
Dataset.cpp:62
karto
Definition:
Any.cpp:20
karto::List::Clear
virtual void Clear()
Definition:
List.h:231
karto::DatasetPrivate::m_pDatasetInfo
SmartPointer< DatasetInfo > m_pDatasetInfo
Definition:
Dataset.cpp:31
nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Tue Nov 7 2017 06:02:36