mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-06 04:46:15 +02:00
Added deleteAll() member to VoxelNodeBag class
This commit is contained in:
parent
70818bd3fe
commit
5758e42870
2 changed files with 12 additions and 2 deletions
|
@ -15,11 +15,19 @@
|
||||||
#include <OctalCode.h>
|
#include <OctalCode.h>
|
||||||
|
|
||||||
VoxelNodeBag::~VoxelNodeBag() {
|
VoxelNodeBag::~VoxelNodeBag() {
|
||||||
|
deleteAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VoxelNodeBag::deleteAll() {
|
||||||
if (_bagElements) {
|
if (_bagElements) {
|
||||||
delete[] _bagElements;
|
delete[] _bagElements;
|
||||||
}
|
}
|
||||||
|
_bagElements = NULL;
|
||||||
|
_elementsInUse = 0;
|
||||||
|
_sizeOfElementsArray = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int GROW_BAG_BY = 100;
|
const int GROW_BAG_BY = 100;
|
||||||
|
|
||||||
// put a node into the bag
|
// put a node into the bag
|
||||||
|
|
|
@ -29,8 +29,10 @@ public:
|
||||||
void insert(VoxelNode* node); // put a node into the bag
|
void insert(VoxelNode* node); // put a node into the bag
|
||||||
VoxelNode* extract(); // pull a node out of the bag (could come in any order)
|
VoxelNode* extract(); // pull a node out of the bag (could come in any order)
|
||||||
|
|
||||||
bool isEmpty() const { return (_elementsInUse == 0); }
|
bool isEmpty() const { return (_elementsInUse == 0); };
|
||||||
int count() const { return _elementsInUse; }
|
int count() const { return _elementsInUse; };
|
||||||
|
|
||||||
|
void deleteAll();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue