File Information
Library: FastInfoset
Package: FastInfoset
Header: Poco/FastInfoset/Vocabulary.h
Description
A Vocabulary allows to map values to indices and vice versa. New values are automatically enqueued and assigned an index.
Member Summary
Member Functions: clone, empty, exists, index, size, subtract, value
Types
Index
typedef VerbTable < T > Index;
Constructors
Vocabulary
Vocabulary();
Creates the Vocabulary.
Vocabulary
Vocabulary(
const Vocabulary & voc
);
Destructor
~Vocabulary
virtual ~Vocabulary();
Destroys the Vocabulary.
Member Functions
clone
virtual Vocabulary * clone() const = 0;
Deep-copies the vocabulary
empty
virtual bool empty() const = 0;
Returns true iff the vocabulary is empty.
exists
virtual Poco::UInt32 exists(
const T & value,
bool & valueExisted
) const = 0;
Returns the index for the given value. Sets valueExisted to false if the value did not exist and returns Utility::INVALIDINDEX
index
virtual Poco::UInt32 index(
const T & value,
bool & valueExisted
) = 0;
Returns the index for the given value. Automatically appends the value and assigns it a new index if the value does not exist yet. Query valueExisted to find out if the value already existed.
index
const Index & index() const;
size
virtual std::size_t size() const = 0;
Returns the vocabulary's size.
subtract
virtual Vocabulary * subtract(
const Vocabulary & other
) const = 0;
Returns a new Vocabulary containing all entries that are contained in this Vocabulary, but not in the given other.
value
virtual const T & value(
Poco::UInt32 idx
) const = 0;
Returns the value for the given index. Throws an exception if the idx is out of range.
Variables
_index
Index _index;