unique_storage< I, V > Class Template Reference

Store values such that only one copy of the value is ever stored. More...

#include <unique_storage.h>

Inheritance diagram for unique_storage< I, V >:
Inheritance graph
[legend]

List of all members.

Classes

struct  id_value
 the actual ID type More...

Public Types

typedef std::vector< V > stored_values

Public Member Functions

 unique_storage ()
virtual ~unique_storage ()
id_value const create (V const &value)
 ensure this value is available
V const & get (id_value const &id) const
 return the stored value for the given ID

Detailed Description

template<typename I, typename V>
class unique_storage< I, V >

Store values such that only one copy of the value is ever stored.

I is an arbitrary typename that's never used.

It is a required parameter in order to enforce type-safety for a collection.

The value type "V" must be default-constructible, and this is the value returned by a stored id_value where .set() is false


Member Typedef Documentation

template<typename I, typename V>
typedef std::vector<V> unique_storage< I, V >::stored_values

Constructor & Destructor Documentation

template<typename I, typename V>
unique_storage< I, V >::unique_storage (  )  [inline]
template<typename I, typename V>
virtual unique_storage< I, V >::~unique_storage (  )  [inline, virtual]

Member Function Documentation

template<typename I, typename V>
id_value const unique_storage< I, V >::create ( V const &  value  )  [inline]

ensure this value is available

template<typename I, typename V>
V const& unique_storage< I, V >::get ( id_value const &  id  )  const [inline]

return the stored value for the given ID


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

Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1