18 #if !defined(XALANMEMMGRAUTOPTR_HEADER_GUARD_1357924680)
19 #define XALANMEMMGRAUTOPTR_HEADER_GUARD_1357924680
42 using xercesc::MemoryManager;
62 MemoryManager* memoryManager,
72 return this->first != 0 && this->second != 0;
82 this->second->~Type();
84 this->first->deallocate(this->second);
90 MemoryManager* memoryManager,
95 this->first = memoryManager;
97 this->second = dataPointer;
109 (this->first == 0 && this->second == 0));
115 MemoryManager& theManager,
117 m_pointerInfo(&theManager, ptr)
136 m_pointerInfo.deallocate();
138 m_pointerInfo = theRHS.
release();
146 m_pointerInfo.deallocate();
152 return *m_pointerInfo.second;
158 return m_pointerInfo.second;
164 return m_pointerInfo.second;
170 return m_pointerInfo.first;
176 return m_pointerInfo.first;
182 MemMgrAutoPtrData tmp = m_pointerInfo;
184 m_pointerInfo.reset(0, 0);
186 return MemMgrAutoPtrData(tmp);
192 MemMgrAutoPtrData tmp = release();
199 MemoryManager* theManager = 0,
200 Type* thePointer = 0)
202 m_pointerInfo.deallocate();
204 m_pointerInfo.reset(theManager, thePointer);
210 MemMgrAutoPtrData m_pointerInfo;
235 MemoryManager* memoryManager,
238 m_memoryManager(memoryManager),
239 m_dataArray(dataPointer),
248 return m_memoryManager != 0 && m_dataArray != 0 && m_size != 0;
256 if ( isInitilized() )
258 assert ( m_dataArray != 0 );
260 for (
size_type i = 0; i < m_size ; ++i )
262 m_dataArray[i].~Type();
265 m_memoryManager->deallocate(m_dataArray);
271 MemoryManager* theMemoryManager,
277 m_memoryManager = theMemoryManager;
279 m_dataArray = thePointer;
299 (m_memoryManager == 0 && m_dataArray == 0 && m_size == 0));
304 MemoryManager& theManager,
329 m_pointerInfo.deallocate();
331 m_pointerInfo = theRHS.
release();
339 m_pointerInfo.deallocate();
345 return *m_pointerInfo.m_dataArray;
351 return m_pointerInfo.m_dataArray;
357 return m_pointerInfo.m_dataArray;
363 return m_pointerInfo.m_size;
369 return m_pointerInfo.m_memoryManager;
375 return m_pointerInfo.m_memoryManager;
381 ++m_pointerInfo.m_size;
399 MemMgrAutoPtrArrayData
404 m_pointerInfo.
reset(0, 0, 0);
419 MemoryManager* theManager = 0,
420 Type* thePointer = 0 ,
423 m_pointerInfo.deallocate();
425 m_pointerInfo.reset(theManager, thePointer, size);
431 return m_pointerInfo.m_dataArray[index];
437 MemMgrAutoPtrArrayData m_pointerInfo;
447 #endif // if !defined(XALANMEMMGRAUTOPTR_HEADER_GUARD_1357924680)