18 #if !defined(XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680)
19 #define XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680
33 #include <xercesc/framework/MemoryManager.hpp>
42 using xercesc::MemoryManager;
50 #if XERCES_VERSION_MAJOR < 3
66 deallocate(
void* pointer) = 0;
68 virtual MemoryManager*
69 getExceptionMemoryManager() = 0;
74 #if XERCES_VERSION_MAJOR < 3
75 return theMemoryManager;
77 assert(theMemoryManager.getExceptionMemoryManager() != 0);
79 return *theMemoryManager.getExceptionMemoryManager();
103 MemoryManager& theMemoryManager,
105 m_memoryManager(theMemoryManager),
106 m_pointer(thePointer)
111 MemoryManager& theMemoryManager,
113 m_memoryManager(theMemoryManager),
114 m_pointer(theMemoryManager.allocate(theSize))
122 m_memoryManager.deallocate(m_pointer);
141 MemoryManager& m_memoryManager;
172 MemoryManager& theMemoryManager,
179 theMemoryManager.deallocate(theArg);
188 MemoryManager& theMemoryManager,
193 theMemoryManager.deallocate(&theArg);
201 MemoryManager& theMemoryManager,
209 new (theGuard.
get()) Type;
223 MemoryManager& theMemoryManager,
225 const Param1Type& theParam1)
232 new (theGuard.
get()) Type(theParam1);
246 MemoryManager& theMemoryManager,
248 Param1Type& theParam1)
255 new (theGuard.
get()) Type(theParam1);
270 MemoryManager& theMemoryManager,
272 Param1Type& theParam1,
273 const Param2Type& theParam2)
280 new (theGuard.
get()) Type(theParam1, theParam2);
297 MemoryManager& theMemoryManager,
299 const Param1Type* theParam1,
300 const Param2Type* theParam2,
301 const Param3Type* theParam3,
302 Param4Type& theParam4)
309 new (theGuard.
get()) Type(theParam1, theParam2, theParam3, theParam4);
328 MemoryManager& theMemoryManager,
330 const Param1Type* theParam1,
331 const Param2Type* theParam2,
332 const Param3Type* theParam3,
333 const Param4Type* theParam4,
334 const Param5Type* theParam5,
335 Param6Type& theParam6)
342 new (theGuard.
get()) Type(
364 MemoryManager& theMemoryManager,
366 Param1Type& theParam1,
367 const Param2Type& theParam2,
368 Param3Type& theParam3)
375 new (theGuard.
get()) Type(theParam1, theParam2, theParam3);
393 MemoryManager& theMemoryManager,
395 Param1Type& theParam1,
396 Param2Type& theParam2,
397 const Param3Type& theParam3,
398 const Param4Type& theParam4,
399 const Param5Type& theParam5)
406 new (theGuard.
get()) Type(theParam1, theParam2, theParam3, theParam4, theParam5);
425 MemoryManager& theMemoryManager,
427 Param1Type& theParam1,
428 Param2Type& theParam2,
429 const Param3Type& theParam3,
430 const Param4Type& theParam4,
431 const Param5Type& theParam5,
432 const Param6Type& theParam6)
439 new (theGuard.
get()) Type(theParam1, theParam2, theParam3, theParam4, theParam5, theParam6);
451 MemoryManager& theMemoryManager,
452 const Type& theSource)
458 Type*
const theInstance =
459 new (theGuard.
get()) Type(theSource);
473 MemoryManager& theMemoryManager,
474 const Type& theSource,
475 Param1Type& theParam1)
481 Type*
const theInstance =
482 new (theGuard.
get()) Type(theSource, theParam1);
495 static MemoryManager&
498 static MemoryManager&
499 getDefaultXercesMemMgr();
501 static MemoryManager&
504 return getDefaultXercesMemMgr();
511 #if defined (XALAN_DEVELOPMENT)
512 #define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR
513 #define XALAN_DEFAULT_MEMMGR = XalanMemMgrs::getDummyMemMgr()
515 #define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR = XalanMemMgrs::getDefaultXercesMemMgr()
516 #define XALAN_DEFAULT_MEMMGR = XalanMemMgrs::getDefaultXercesMemMgr()
550 return (C*)
new (address) C();
553 static C*
construct(C* address,
const C& theRhs, MemoryManager& )
555 return (C*)
new (address) C(theRhs);
566 return (C*)
new (address) C(mgr);
569 static C*
construct(C* address,
const C& theRhs, MemoryManager& mgr)
571 return (C*)
new (address) C(theRhs, mgr);
589 #define XALAN_USES_MEMORY_MANAGER(Type) \
591 struct MemoryManagedConstructionTraits<Type> \
593 typedef ConstructWithMemoryManager<Type> Constructor; \
614 #endif // XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680