ObjectStorage< K, V, Comp > Class Template Reference

#include <objectstorage.h>

List of all members.

Public Types

typedef Mapping::iterator Iterator
typedef Mapping::const_iterator ConstIterator

Public Member Functions

 ObjectStorage ()
void clear ()
put (K key, V value)
get (K &key) const
bool contains (K &key) const
remove (K key)
size_t size () const
Iterator begin ()
ConstIterator begin () const
Iterator end ()
ConstIterator end () const

Private Types

typedef std::map< K, V, Comp > Mapping
typedef Mapping::value_type Association

Private Attributes

Mapping mapping

template<typename K, typename V, typename Comp>
class ObjectStorage< K, V, Comp >


Member Typedef Documentation

template<typename K, typename V, typename Comp>
typedef Mapping::value_type ObjectStorage< K, V, Comp >::Association [private]
template<typename K, typename V, typename Comp>
typedef Mapping::const_iterator ObjectStorage< K, V, Comp >::ConstIterator

Constant iterator type.

template<typename K, typename V, typename Comp>
typedef Mapping::iterator ObjectStorage< K, V, Comp >::Iterator

Iterator type.

template<typename K, typename V, typename Comp>
typedef std::map<K, V, Comp> ObjectStorage< K, V, Comp >::Mapping [private]

Constructor & Destructor Documentation

template<typename K, typename V, typename Comp>
ObjectStorage< K, V, Comp >::ObjectStorage (  )  [inline]

Empty constructor.


Member Function Documentation

template<typename K, typename V, typename Comp>
ConstIterator ObjectStorage< K, V, Comp >::begin (  )  const [inline]

Returns const iterator to first element.

Returns:
ConstIterator instance.
template<typename K, typename V, typename Comp>
Iterator ObjectStorage< K, V, Comp >::begin (  )  [inline]

Returns iterator to first element.

Returns:
Iterator instance.

Referenced by pdfobjects::CXref::cleanUp(), pdfobjects::CXref::getNumObjects(), and pdfobjects::XRefWriter::saveChanges().

template<typename K, typename V, typename Comp>
void ObjectStorage< K, V, Comp >::clear (  )  [inline]

Clears mapping.

Doesn't deallocate values!

Referenced by pdfobjects::CXref::cleanUp().

template<typename K, typename V, typename Comp>
bool ObjectStorage< K, V, Comp >::contains ( K &  key  )  const [inline]

Checks of given key is in the storage.

Parameters:
key Key object.
Returns:
true if given key is in the storage, false otherwise.

Referenced by pdfobjects::CXref::changeObject(), and pdfobjects::CXref::reserveRef().

template<typename K, typename V, typename Comp>
ConstIterator ObjectStorage< K, V, Comp >::end (  )  const [inline]

Returns const iterator to end iterator.

Returns:
ConstIterator instance.
template<typename K, typename V, typename Comp>
Iterator ObjectStorage< K, V, Comp >::end (  )  [inline]

Returns iterator to end iterator.

Returns:
Iterator instance.

Referenced by pdfobjects::CXref::cleanUp(), pdfobjects::CXref::getNumObjects(), and pdfobjects::XRefWriter::saveChanges().

template<typename K, typename V, typename Comp>
V ObjectStorage< K, V, Comp >::get ( K &  key  )  const [inline]

Finds value with the key.

Parameters:
key Key of the value.

Gets value associated with the key.

Returns:
value of the value (direct pointer) or 0 if no such key found.

Referenced by pdfobjects::CXref::changeObject(), pdfobjects::CXref::fetch(), and pdfobjects::CXref::knowsRef().

template<typename K, typename V, typename Comp>
V ObjectStorage< K, V, Comp >::put ( key,
value 
) [inline]

Add/change mapping.

Parameters:
key Key of the mapping.
value Value of the mapping (must be non null).

If the key is not in the mapping yet, associates it with the value and puts to the mapping. Otherwise update value of the previous mapping.
This method doesn't invalidate existing (if any) iterator pointing to the association.

Returns:
Value of the previous mapping or 0 if the key was inserted to the mapping.

Referenced by pdfobjects::CXref::changeObject(), and pdfobjects::CXref::reserveRef().

template<typename K, typename V, typename Comp>
V ObjectStorage< K, V, Comp >::remove ( key  )  [inline]

Removes association.

Parameters:
key Key of the value.

Gets value of the key and removes association from mapping.
This method doesn't invalidate interators, except one which points to the removed element.

Returns:
Value of the key or 0 if not found (and not removed).
template<typename K, typename V, typename Comp>
size_t ObjectStorage< K, V, Comp >::size (  )  const [inline]

Number of elements.

Returns:
Elements count.

Referenced by pdfobjects::CXref::cleanUp(), and pdfobjects::XRefWriter::saveChanges().


Member Data Documentation

template<typename K, typename V, typename Comp>
Mapping ObjectStorage< K, V, Comp >::mapping [private]

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