17 #if !defined(REUSABLEARENABLOCK_INCLUDE_GUARD_1357924680)
18 #define REUSABLEARENABLOCK_INCLUDE_GUARD_1357924680
29 XALAN_CPP_NAMESPACE_BEGIN
33 template <
class ObjectType,
34 #if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)
37 class SizeType =
unsigned short>
67 (
next <= rightBorder ) ) ?
true : false ;
73 return reinterpret_cast<NextBlock*
>(thePointer);
77 cast(
const void* thePointer)
79 return reinterpret_cast<const NextBlock*
>(thePointer);
98 XALAN_STATIC_ASSERT(
sizeof(ObjectType) >=
sizeof(NextBlock));
115 NextBlock*
const pStruct =
152 assert ( this->m_firstFreeBlock == (this->
m_blockSize + 1) );
160 ObjectType* theResult = 0;
162 assert ( this->m_firstFreeBlock <= this->m_blockSize );
163 assert ( this->m_nextFreeBlock <= this->m_blockSize );
166 if(this->m_firstFreeBlock != this->m_nextFreeBlock)
180 assert(this->m_nextFreeBlock <= this->m_blockSize);
197 assert ( this->m_objectCount <= this->
m_blockSize );
199 this->m_firstFreeBlock = this->m_nextFreeBlock;
212 assert(theObject != 0);
215 if ( this->m_firstFreeBlock != this->m_nextFreeBlock )
218 void*
const p = this->
m_objectBlock + this->m_firstFreeBlock;
220 new (p) NextBlock(this->m_nextFreeBlock);
222 this->m_nextFreeBlock = this->m_firstFreeBlock;
230 new (theObject) NextBlock(this->m_firstFreeBlock);
233 this->m_nextFreeBlock =
236 assert (this->m_firstFreeBlock <= this->
m_blockSize);
253 assert ( theObject != 0 );
274 return !isOnFreeList(theObject);
282 return !(this->
ownsBlock(reinterpret_cast<const ObjectType*>(block)) &&
307 isOnFreeList(
const ObjectType* theObject)
const
315 ObjectType* pRunPtr = this->
m_objectBlock + this->m_firstFreeBlock;
323 if (pRunPtr == theObject)
329 NextBlock*
const p =
reinterpret_cast<NextBlock*
>(pRunPtr);
331 assert(p->isValidFor(this->m_blockSize));
349 XALAN_CPP_NAMESPACE_END
353 #endif // !defined(REUSABLEARENABLOCK_INCLUDE_GUARD_1357924680)