19#if !defined(REUSABLEARENAALLOCATOR_INCLUDE_GUARD_1357924680)
20#define REUSABLEARENAALLOCATOR_INCLUDE_GUARD_1357924680
37template<
class ObjectType>
39 ReusableArenaBlock<ObjectType> >
45 typedef typename ReusableArenaBlockType::size_type
size_type;
54 typedef typename ArenaBlockListType::iterator
iterator;
92 if ( this->m_blocks.empty() )
101 && (*iTerator)->blockAvailable() )
103 if ((*iTerator)->ownsBlock(
theObject) ==
true)
108 if (
iTerator != this->m_blocks.begin())
117 this->m_blocks.push_front(
block);
144 if (
rIterator != this->m_blocks.rbegin())
153 this->m_blocks.push_front(
block);
193 if( this->m_blocks.empty()
194 || !
this->m_blocks.front()->blockAvailable() )
196 this->m_blocks.push_front(
197 ReusableArenaBlockType::create(
198 this->getMemoryManager(),
201 assert( this->m_blocks.front() != 0 );
204 assert( this->m_blocks.front() != 0 );
205 assert( this->m_blocks.front()->blockAvailable() );
207 return this->m_blocks.front()->allocateBlock();
220 assert( this->m_blocks.empty() ==
false );
221 assert( this->m_blocks.front() != 0 );
224 this->m_blocks.front()->commitAllocation(
theObject);
226 if( !this->m_blocks.front()->blockAvailable() )
232 this->m_blocks.pop_front();
242 if ( this->m_blocks.empty() )
250 && (*iTerator)->blockAvailable() )
294 assert(m_destroyBlocks ==
true);
296 if ( this->m_blocks.empty() ==
false)
300 if ( (*iTerator)->isEmpty() )
304 if (
iTerator == this->m_blocks.end() ||
305 (*iTerator)->blockAvailable() )
307 this->m_blocks.pop_front();
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
virtual bool ownsObject(const ObjectType *theObject) const
ReusableArenaBlock< ObjectType > ReusableArenaBlockType
ArenaAllocator< ObjectType, ReusableArenaBlockType > BaseClassType
ArenaBlockListType::const_iterator const_iterator
ArenaBlockListType::iterator iterator
ReusableArenaAllocator(MemoryManager &theManager, size_type theBlockSize, bool destroyBlocks=false)
virtual void commitAllocation(ObjectType *theObject)
virtual ~ReusableArenaAllocator()
const bool m_destroyBlocks
ArenaBlockListType::reverse_iterator reverse_iterator
virtual ObjectType * allocateBlock()
ArenaBlockListType::const_reverse_iterator const_reverse_iterator
ReusableArenaAllocator< ObjectType > ThisType
XalanList< ReusableArenaBlockType * > ArenaBlockListType
ReusableArenaBlockType::size_type size_type
bool destroyObject(ObjectType *theObject)
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)