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 
19 
20 namespace karto
21 {
22 
24  : m_pArray(NULL)
25  , m_Capacity(0)
26  , m_Size(0)
27  {
28  }
29 
31  {
32  assert(m_pArray != NULL);
33 
34  delete[] m_pArray;
35  m_pArray = NULL;
36  }
37 
39  {
40  memset(m_pArray, 0, sizeof(kt_int32s) * m_Capacity);
41  }
42 
44  {
45  return m_Size;
46  }
47 
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;
60  }
61 
62  m_Size = size;
63  }
64 
65 }
uint32_t kt_int32u
Definition: Types.h:111
int32_t kt_int32s
Definition: Types.h:106
kt_int32u GetSize() const
void SetSize(kt_int32u size)
Definition: Any.cpp:20


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Tue Nov 7 2017 06:02:36