20#ifndef _OBJECTPOOL_HXX_
21#define _OBJECTPOOL_HXX_
31 template<
class Y>
void clearVector(Y & v )
33 Y emptyVec; v.swap( emptyVec );
74 for (
int i = i0; i < i1; i++)
77 std::cerr <<
"a chunk to delete" << std::endl;
147 long adrobj = (long) (obj);
148 long adrmin = (long) (chunk);
149 int rank = (adrobj - adrmin) /
sizeof(X);
168 for (
size_t i = 0; i <
_chunkList.size(); i++)
195 const X*
at(
size_t i )
const
245 if (
_pool._freeList[
_i ] ==
false )
Definition: ObjectPool.hxx:216
virtual const X * next()
Return the current object and step to the next one.
Definition: ObjectPool.hxx:235
const ObjectPool< X > & _pool
Definition: ObjectPool.hxx:217
int _i
Definition: ObjectPool.hxx:218
ObjectPoolIterator(const ObjectPool< X > &pool)
Definition: ObjectPool.hxx:221
int _nbFound
Definition: ObjectPool.hxx:218
virtual bool more()
Return true if and only if there are other object in this iterator.
Definition: ObjectPool.hxx:230
Definition: ObjectPool.hxx:40
int getNextFree()
Definition: ObjectPool.hxx:54
std::vector< X * > _chunkList
Definition: ObjectPool.hxx:43
void clear()
Definition: ObjectPool.hxx:161
std::vector< bool > _freeList
Definition: ObjectPool.hxx:44
const X * at(size_t i) const
Definition: ObjectPool.hxx:195
size_t size() const
Definition: ObjectPool.hxx:175
const X * operator[](size_t i) const
Definition: ObjectPool.hxx:187
ObjectPool(int nblk=1024)
Definition: ObjectPool.hxx:84
int _nbHoles
Definition: ObjectPool.hxx:49
int _maxAvail
Definition: ObjectPool.hxx:46
int _nextFree
Definition: ObjectPool.hxx:45
int _maxOccupied
Definition: ObjectPool.hxx:48
X * getNew()
Definition: ObjectPool.hxx:102
size_t nbElements() const
Definition: ObjectPool.hxx:181
void destroy(X *obj)
Definition: ObjectPool.hxx:133
int _lastDelChunk
Definition: ObjectPool.hxx:50
void checkDelete(int chunkId)
Definition: ObjectPool.hxx:70
int _chunkSize
Definition: ObjectPool.hxx:47
virtual ~ObjectPool()
Definition: ObjectPool.hxx:96
Abstract class for iterators.
Definition: SMDS_Iterator.hxx:33