Library: FastInfoset
Package: FastInfoset
Header: Poco/FastInfoset/Vocabulary.h
A Vocabulary allows to map values to indices and vice versa. New values are automatically enqueued and assigned an index.
Member Functions: clone, empty, exists, index, size, subtract, value
typedef VerbTable < T > Index;
Vocabulary();
Creates the Vocabulary.
Vocabulary(
const Vocabulary & voc
);
virtual ~Vocabulary();
Destroys the Vocabulary.
virtual Vocabulary * clone() const = 0;
Deep-copies the vocabulary
virtual bool empty() const = 0;
Returns true if and only if the vocabulary is empty.
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
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.
const Index & index() const;
virtual std::size_t size() const = 0;
Returns the vocabulary's size.
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.
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.
Index _index;