Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
OpenKarto
source
GridIndexLookup.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/GridIndexLookup.h
>
19
20
namespace
karto
21
{
22
23
LookupArray::LookupArray
()
24
: m_pArray(NULL)
25
, m_Capacity(0)
26
, m_Size(0)
27
{
28
}
29
30
LookupArray::~LookupArray
()
31
{
32
assert(
m_pArray
!= NULL);
33
34
delete
[]
m_pArray
;
35
m_pArray
= NULL;
36
}
37
38
void
LookupArray::Clear
()
39
{
40
memset(
m_pArray
, 0,
sizeof
(
kt_int32s
) *
m_Capacity
);
41
}
42
43
kt_int32u
LookupArray::GetSize
()
const
44
{
45
return
m_Size
;
46
}
47
48
void
LookupArray::SetSize
(
kt_int32u
size)
49
{
50
assert(size != 0);
51
52
if
(size >
m_Capacity
)
53
{
54
if
(
m_pArray
!= NULL)
55
{
56
delete
[]
m_pArray
;
57
}
58
m_Capacity
= size;
59
m_pArray
=
new
kt_int32s
[
m_Capacity
];
60
}
61
62
m_Size
= size;
63
}
64
65
}
karto::LookupArray::Clear
void Clear()
Definition:
GridIndexLookup.cpp:38
karto::LookupArray::LookupArray
LookupArray()
Definition:
GridIndexLookup.cpp:23
karto::LookupArray::m_Size
kt_int32u m_Size
Definition:
GridIndexLookup.h:116
karto::LookupArray::m_pArray
kt_int32s * m_pArray
Definition:
GridIndexLookup.h:114
kt_int32u
uint32_t kt_int32u
Definition:
Types.h:111
GridIndexLookup.h
kt_int32s
int32_t kt_int32s
Definition:
Types.h:106
karto::LookupArray::GetSize
kt_int32u GetSize() const
Definition:
GridIndexLookup.cpp:43
karto::LookupArray::SetSize
void SetSize(kt_int32u size)
Definition:
GridIndexLookup.cpp:48
karto
Definition:
Any.cpp:20
karto::LookupArray::~LookupArray
virtual ~LookupArray()
Definition:
GridIndexLookup.cpp:30
karto::LookupArray::m_Capacity
kt_int32u m_Capacity
Definition:
GridIndexLookup.h:115
nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Tue Nov 7 2017 06:02:36