libdballe  7.6
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
dballe::memdb::ValueStorage< T > Class Template Reference

Data Structures

struct  index_iterator
 

Public Types

typedef T value_type
 

Public Member Functions

void clear ()
 
size_t element_count () const
 Number of valid elements. More...
 
T * get_checked (size_t idx)
 
const T * get_checked (size_t idx) const
 
std::vector< T * >::reference operator[] (size_t idx)
 
std::vector< T * >::const_reference operator[] (size_t idx) const
 
index_iterator index_begin () const
 
index_iterator index_end () const
 
template<typename OUTITER >
void copy_valptrs_to (OUTITER res) const
 Send all T pointers to the given output iterator.
 
template<typename OUTITER >
void copy_indices_to (OUTITER res) const
 Send all T pointers to the given output iterator.
 

Protected Member Functions

size_t value_add (T *value)
 Add the value to the storage and return its index take ownership of the pointer memory management.
 
void value_remove (size_t pos)
 Remove a value given its position.
 

Protected Attributes

std::vector< T * > values
 
std::vector< size_t > empty_slots
 

Member Function Documentation

template<typename T>
size_t dballe::memdb::ValueStorage< T >::element_count ( ) const
inline

Number of valid elements.

This is not called size, because it is not the same as the maximum index that can be passed to operator[]


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