18 #if !defined(XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680) 19 #define XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680 33 #include <xercesc/framework/MemoryManager.hpp> 38 XALAN_CPP_NAMESPACE_BEGIN
50 #if XERCES_VERSION_MAJOR < 3 51 #if defined(XALAN_STRICT_ANSI_HEADERS) 67 allocate(size_type size) = 0;
70 deallocate(
void* pointer) = 0;
72 virtual MemoryManager*
73 getExceptionMemoryManager() = 0;
78 #if XERCES_VERSION_MAJOR < 3 79 return theMemoryManager;
81 assert(theMemoryManager.getExceptionMemoryManager() != 0);
83 return *theMemoryManager.getExceptionMemoryManager();
104 #if defined(XALAN_STRICT_ANSI_HEADERS) 111 MemoryManager& theMemoryManager,
113 m_memoryManager(theMemoryManager),
114 m_pointer(thePointer)
119 MemoryManager& theMemoryManager,
121 m_memoryManager(theMemoryManager),
122 m_pointer(theMemoryManager.allocate(theSize))
130 m_memoryManager.deallocate(m_pointer);
149 MemoryManager& m_memoryManager;
180 MemoryManager& theMemoryManager,
187 theMemoryManager.deallocate(theArg);
196 MemoryManager& theMemoryManager,
201 theMemoryManager.deallocate(&theArg);
209 MemoryManager& theMemoryManager,
217 new (theGuard.
get()) Type;
231 MemoryManager& theMemoryManager,
233 const Param1Type& theParam1)
240 new (theGuard.
get()) Type(theParam1);
254 MemoryManager& theMemoryManager,
256 Param1Type& theParam1)
263 new (theGuard.
get()) Type(theParam1);
278 MemoryManager& theMemoryManager,
280 Param1Type& theParam1,
281 const Param2Type& theParam2)
288 new (theGuard.
get()) Type(theParam1, theParam2);
305 MemoryManager& theMemoryManager,
307 const Param1Type* theParam1,
308 const Param2Type* theParam2,
309 const Param3Type* theParam3,
310 Param4Type& theParam4)
317 new (theGuard.
get()) Type(theParam1, theParam2, theParam3, theParam4);
336 MemoryManager& theMemoryManager,
338 const Param1Type* theParam1,
339 const Param2Type* theParam2,
340 const Param3Type* theParam3,
341 const Param4Type* theParam4,
342 const Param5Type* theParam5,
343 Param6Type& theParam6)
350 new (theGuard.
get()) Type(
372 MemoryManager& theMemoryManager,
374 Param1Type& theParam1,
375 const Param2Type& theParam2,
376 Param3Type& theParam3)
383 new (theGuard.
get()) Type(theParam1, theParam2, theParam3);
401 MemoryManager& theMemoryManager,
403 Param1Type& theParam1,
404 Param2Type& theParam2,
405 const Param3Type& theParam3,
406 const Param4Type& theParam4,
407 const Param5Type& theParam5)
414 new (theGuard.
get()) Type(theParam1, theParam2, theParam3, theParam4, theParam5);
433 MemoryManager& theMemoryManager,
435 Param1Type& theParam1,
436 Param2Type& theParam2,
437 const Param3Type& theParam3,
438 const Param4Type& theParam4,
439 const Param5Type& theParam5,
440 const Param6Type& theParam6)
447 new (theGuard.
get()) Type(theParam1, theParam2, theParam3, theParam4, theParam5, theParam6);
459 MemoryManager& theMemoryManager,
460 const Type& theSource)
466 Type*
const theInstance =
467 new (theGuard.
get()) Type(theSource);
481 MemoryManager& theMemoryManager,
482 const Type& theSource,
483 Param1Type& theParam1)
489 Type*
const theInstance =
490 new (theGuard.
get()) Type(theSource, theParam1);
503 static MemoryManager&
506 static MemoryManager&
507 getDefaultXercesMemMgr();
509 static MemoryManager&
512 return getDefaultXercesMemMgr();
519 #if defined (XALAN_DEVELOPMENT) 520 #define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR 521 #define XALAN_DEFAULT_MEMMGR = XalanMemMgrs::getDummyMemMgr() 523 #define XALAN_DEFAULT_CONSTRUCTOR_MEMMGR = XalanMemMgrs::getDefaultXercesMemMgr() 524 #define XALAN_DEFAULT_MEMMGR = XalanMemMgrs::getDefaultXercesMemMgr() 558 return (C*)
new (address) C();
561 static C*
construct(C* address,
const C& theRhs, MemoryManager& )
563 return (C*)
new (address) C(theRhs);
574 return (C*)
new (address) C(mgr);
577 static C*
construct(C* address,
const C& theRhs, MemoryManager& mgr)
579 return (C*)
new (address) C(theRhs, mgr);
597 #define XALAN_USES_MEMORY_MANAGER(Type) \ 599 struct MemoryManagedConstructionTraits<Type> \ 601 typedef ConstructWithMemoryManager<Type> Constructor; \ 618 XALAN_CPP_NAMESPACE_END
622 #endif // XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680 ConstructValueWithNoMemoryManager< C > ConstructableType
static C * construct(C *address, const C &theRhs, MemoryManager &)
ConstructWithNoMemoryManager< C > Constructor
static C * construct(C *address, const C &theRhs, MemoryManager &mgr)
ConstructWithMemoryManager< C > Constructor
ConstructValueWithNoMemoryManager(MemoryManager &)
ConstructValueWithMemoryManager< C > ConstructableType
XalanAllocationGuard(MemoryManager &theMemoryManager, size_type theSize)
Type * XalanCopyConstruct(MemoryManager &theMemoryManager, const Type &theSource)
ConstructWithMemoryManager< C > Constructor
XALAN_CPP_NAMESPACE_BEGIN typedef MemoryManager MemoryManagerType
static C * construct(C *address, MemoryManager &)
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
static MemoryManager & getExceptionMemoryManager(MemoryManager &theMemoryManager)
static C * construct(C *address, MemoryManager &mgr)
static MemoryManager & getDefault()
void XalanDestroy(Type &theArg)
ConstructWithNoMemoryManager< C > Constructor
XalanMemoryManager & operator=(const XalanMemoryManager &)
XalanAllocationGuard(MemoryManager &theMemoryManager, void *thePointer)
#define XALAN_PLATFORM_EXPORT
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)
ConstructValueWithMemoryManager(MemoryManager &mgr)
Type * XalanConstruct(MemoryManager &theMemoryManager, Type *&theInstance)