Xalan-C++ API Reference 1.12.0
xalanc::XStringAllocator Class Reference

#include <xalanc/XPath/XStringAllocator.hpp>

Public Types

typedef XString string_type
typedef ReusableArenaAllocator< string_typeArenaAllocatorType
typedef ArenaAllocatorType::size_type size_type

Public Member Functions

 XStringAllocator (MemoryManager &theManager, size_type theBlockCount)
 Construct an instance that will allocate blocks of the specified size.
 ~XStringAllocator ()
string_typecreateString (const XalanDOMString &theString)
 Create an XString object from a string.
string_typecreateString (const XalanDOMChar *theString)
 Create an XString object from a null-terminated array of characters.
string_typecreateString (const XalanDOMChar *theString, XalanSize_t theLength)
 Create an XString object from an array of characters.
bool destroy (string_type *theString)
 Delete an XString object from allocator.
bool ownsObject (const string_type *theObject)
 Determine if an object is owned by the allocator...
void reset ()
 Delete all XString objects from allocator.
size_type getBlockCount () const
 Get size of an ArenaBlock, that is, the number of objects in each block.
size_type getBlockSize () const
 Get the number of ArenaBlocks currently allocated.

Detailed Description

Definition at line 41 of file XStringAllocator.hpp.

Member Typedef Documentation

◆ ArenaAllocatorType

◆ size_type

◆ string_type

Constructor & Destructor Documentation

◆ XStringAllocator()

xalanc::XStringAllocator::XStringAllocator ( MemoryManager & theManager,
size_type theBlockCount )

Construct an instance that will allocate blocks of the specified size.

Parameters
theBlockSizeThe block size.

◆ ~XStringAllocator()

xalanc::XStringAllocator::~XStringAllocator ( )

Member Function Documentation

◆ createString() [1/3]

string_type * xalanc::XStringAllocator::createString ( const XalanDOMChar * theString)

Create an XString object from a null-terminated array of characters.

Parameters
theStringa pointer to the array
Returns
a pointer to string

◆ createString() [2/3]

string_type * xalanc::XStringAllocator::createString ( const XalanDOMChar * theString,
XalanSize_t theLength )

Create an XString object from an array of characters.

Parameters
theStringa pointer to the array
theLengththe length of the array.
Returns
a pointer to string

◆ createString() [3/3]

string_type * xalanc::XStringAllocator::createString ( const XalanDOMString & theString)

Create an XString object from a string.

Parameters
theStringsource string
Returns
a pointer to string

◆ destroy()

bool xalanc::XStringAllocator::destroy ( string_type * theString)

Delete an XString object from allocator.

◆ getBlockCount()

size_type xalanc::XStringAllocator::getBlockCount ( ) const
inline

Get size of an ArenaBlock, that is, the number of objects in each block.

Returns
The size of the block

Definition at line 120 of file XStringAllocator.hpp.

◆ getBlockSize()

size_type xalanc::XStringAllocator::getBlockSize ( ) const
inline

Get the number of ArenaBlocks currently allocated.

Returns
The number of blocks.

Definition at line 131 of file XStringAllocator.hpp.

◆ ownsObject()

bool xalanc::XStringAllocator::ownsObject ( const string_type * theObject)
inline

Determine if an object is owned by the allocator...

Definition at line 102 of file XStringAllocator.hpp.

◆ reset()

void xalanc::XStringAllocator::reset ( )

Delete all XString objects from allocator.


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