Xerces-C++: DOMMemoryManager Class Reference

Xerces-C++ 3.2.3

List of all members
DOMMemoryManager Class Referenceabstract

The `DOMMemoryManager` interface exposes the memory allocation-related functionalities of a `DOMDocument` More...

## Protected Member Functions
Hidden constructors
| DOMMemoryManager ()

## Destructor
enum | NodeObjectType { ATTR_OBJECT = 0, ATTR_NS_OBJECT = 1, CDATA_SECTION_OBJECT = 2, COMMENT_OBJECT = 3, DOCUMENT_FRAGMENT_OBJECT = 4, DOCUMENT_TYPE_OBJECT = 5, ELEMENT_OBJECT = 6, ELEMENT_NS_OBJECT = 7, ENTITY_OBJECT = 8, ENTITY_REFERENCE_OBJECT = 9, NOTATION_OBJECT = 10, PROCESSING_INSTRUCTION_OBJECT = 11, TEXT_OBJECT = 12 }
virtual | ~DOMMemoryManager ()
| Destructor. More...
virtual XMLSize_t | getMemoryAllocationBlockSize () const =0
| Returns the size of the chunks of memory allocated by the memory manager. More...
virtual void | setMemoryAllocationBlockSize (XMLSize_t size)=0
| Set the size of the chunks of memory allocated by the memory manager. More...
virtual void * | allocate (XMLSize_t amount)=0
| Allocate a memory block of the requested size from the managed pool. More...
virtual void * | allocate (XMLSize_t amount, DOMMemoryManager::NodeObjectType type)=0
| Allocate a memory block of the requested size from the managed pool of DOM objects. More...
virtual void | release (DOMNode *object, DOMMemoryManager::NodeObjectType type)=0
| Release a DOM object and place its memory back in the pool. More...
virtual XMLCh * | cloneString (const XMLCh *src)=0
| Allocate a memory block from the mnaged pool and copy the provided string. More...

## Detailed Description

The `DOMMemoryManager` interface exposes the memory allocation-related functionalities of a `DOMDocument`

## Member Enumeration Documentation

## ◆ NodeObjectType

enum DOMMemoryManager::NodeObjectType

Enumerator
ATTR_OBJECT |
ATTR_NS_OBJECT |
CDATA_SECTION_OBJECT |
COMMENT_OBJECT |
DOCUMENT_FRAGMENT_OBJECT |
DOCUMENT_TYPE_OBJECT |
ELEMENT_OBJECT |
ELEMENT_NS_OBJECT |
ENTITY_OBJECT |
ENTITY_REFERENCE_OBJECT |
NOTATION_OBJECT |
PROCESSING_INSTRUCTION_OBJECT |
TEXT_OBJECT |

## Constructor & Destructor Documentation

## ◆ DOMMemoryManager()

DOMMemoryManager::DOMMemoryManager | ( |  | ) |
| protected

## ◆ ~DOMMemoryManager()

virtual DOMMemoryManager::~DOMMemoryManager | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ allocate() [1/2]

virtual void* DOMMemoryManager::allocate | ( | XMLSize_t | amount | ) |
| pure virtual

Allocate a memory block of the requested size from the managed pool.

Parameters

  amount | the size of the new memory block

Returns
  the pointer to the newly allocated block

## ◆ allocate() [2/2]

virtual void* DOMMemoryManager::allocate | ( | XMLSize_t | amount,
|  | DOMMemoryManager::NodeObjectType | type
| ) |  |
| pure virtual

Allocate a memory block of the requested size from the managed pool of DOM objects.

Parameters

  amount | the size of the new memory block
  type | the type of the DOM object that will be stored in the block

Returns
  the pointer to the newly allocated block

## ◆ cloneString()

virtual XMLCh* DOMMemoryManager::cloneString | ( | const XMLCh * | src | ) |
| pure virtual

Allocate a memory block from the mnaged pool and copy the provided string.

Parameters

  src | the string to be copied

Returns
  the pointer to the newly allocated block

## ◆ getMemoryAllocationBlockSize()

virtual XMLSize_t DOMMemoryManager::getMemoryAllocationBlockSize | ( |  | ) | const
| pure virtual

Returns the size of the chunks of memory allocated by the memory manager.

Returns
  the dimension of the chunks of memory allocated by the memory manager

## ◆ release()

virtual void DOMMemoryManager::release | ( | DOMNode * | object,
|  | DOMMemoryManager::NodeObjectType | type
| ) |  |
| pure virtual

Release a DOM object and place its memory back in the pool.

Parameters

  object | the pointer to the DOM node
  type | the type of the DOM object

## ◆ setMemoryAllocationBlockSize()

virtual void DOMMemoryManager::setMemoryAllocationBlockSize | ( | XMLSize_t | size | ) |
| pure virtual

Set the size of the chunks of memory allocated by the memory manager.

Parameters

  size | the new size of the chunks; it must be greater than 4KB

The documentation for this class was generated from the following file:

- DOMMemoryManager.hpp