Poco::XML

class NamePool

Library: XML
Package: XML
Header: Poco/XML/NamePool.h

Description

A hashtable that stores XML names consisting of an URI, a local name and a qualified name.

Member Summary

Member Functions: duplicate, hash, insert, release

Constructors

NamePool

NamePool(
    unsigned long size = 509
);

Creates a name pool with room for up to size strings.

The given size should be a suitable prime number, e.g. 251, 509, 1021 or 4093.

Destructor

~NamePool protected

~NamePool();

Member Functions

duplicate

void duplicate();

Increments the reference count.

insert

const Name & insert(
    const XMLString & qname,
    const XMLString & namespaceURI,
    const XMLString & localName
);

Returns a const reference to an Name for the given names. Creates the Name if it does not already exist. Throws a PoolOverflowException if the name pool is full.

insert

const Name & insert(
    const Name & name
);

Returns a const reference to an Name for the given name. Creates the Name if it does not already exist. Throws a PoolOverflowException if the name pool is full.

release

void release();

Decrements the reference count and deletes the object if the reference count reaches zero.

hash protected

unsigned long hash(
    const XMLString & qname,
    const XMLString & namespaceURI,
    const XMLString & localName
);