18 #if !defined(XALAN_OBJECTSTACKCACHE_HEADER_GUARD)
19 #define XALAN_OBJECTSTACKCACHE_HEADER_GUARD
39 #if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)
40 class CreateFunctorType,
41 class DeleteFunctorType,
42 class ResetFunctorType>
44 class CreateFunctorType = DefaultCacheCreateFunctor<ObjectType>,
45 class DeleteFunctorType = DeleteFunctor<ObjectType>,
46 class ResetFunctorType = DefaultCacheResetFunctor<ObjectType> >
58 MemoryManager& theManager,
59 XalanSize_t initialListSize = 0) :
61 m_deleteFunctor(theManager),
63 m_numObjectsOnStack(0)
65 m_stack.reserve(initialListSize);
82 if (m_stack.size() == m_numObjectsOnStack)
84 ObjectType*
const theNewObject = m_createFunctor(m_stack.getMemoryManager());
85 m_stack.push_back(theNewObject);
86 ++m_numObjectsOnStack;
91 return m_stack[m_numObjectsOnStack++];
98 assert (m_numObjectsOnStack > 0);
100 return m_stack[m_numObjectsOnStack-1];
106 assert(m_numObjectsOnStack > 0);
108 return m_stack[--m_numObjectsOnStack];
116 for (iterator = m_stack.begin(); iterator < m_stack.end(); iterator++)
118 m_resetFunctor(*iterator);
148 template<
class ObjectType>