DenseIntMap< TValue > Class Template Reference

A dense grow-as-needed array that serves as an integer-keyed map. More...

List of all members.

Public Types

typedef TValue Value
typedef TValue Value

Public Member Functions

const Value & default_value () const
 Accesses the default value.
Value & default_value ()
 Accesses the default value.
const Value & default_value () const
 Accesses the default value.
Value & default_value ()
 Accesses the default value.
const Value & get (index_t index) const
 Accesses an element, never growing the internal representation.
const Value & get (index_t index) const
 Accesses an element, never growing the internal representation.
void Init ()
 Creates a blank mapping.
void Init ()
 Creates a blank mapping.
const Value & operator[] (index_t index) const
 Accesses an element from a static context.
Value & operator[] (index_t index)
 Accesses an element, expanding if necessary.
const Value & operator[] (index_t index) const
 Accesses an element from a static context.
Value & operator[] (index_t index)
 Accesses an element, expanding if necessary.
index_t size () const
 Gets a non-inclusive upper bound on the last non-default element.
index_t size () const
 Gets a non-inclusive upper bound on the last non-default element.

Detailed Description

template<class TValue>
class DenseIntMap< TValue >

A dense grow-as-needed array that serves as an integer-keyed map.

Definition at line 47 of file intmap.h.


Member Function Documentation

template<class TValue >
const Value& DenseIntMap< TValue >::default_value (  )  const [inline]

Accesses the default value.

Definition at line 74 of file intmap.h.

template<class TValue >
Value& DenseIntMap< TValue >::default_value (  )  [inline]

Accesses the default value.

Use this to set it.

Definition at line 70 of file intmap.h.

template<class TValue >
const Value& DenseIntMap< TValue >::default_value (  )  const [inline]

Accesses the default value.

Definition at line 74 of file intmap.h.

template<class TValue >
Value& DenseIntMap< TValue >::default_value (  )  [inline]

Accesses the default value.

Use this to set it.

Definition at line 70 of file intmap.h.

template<class TValue >
const Value& DenseIntMap< TValue >::get ( index_t  index  )  const [inline]

Accesses an element, never growing the internal representation.

Definition at line 114 of file intmap.h.

template<class TValue >
const Value& DenseIntMap< TValue >::get ( index_t  index  )  const [inline]

Accesses an element, never growing the internal representation.

Definition at line 114 of file intmap.h.

template<class TValue >
void DenseIntMap< TValue >::Init (  )  [inline]

Creates a blank mapping.

Definition at line 64 of file intmap.h.

template<class TValue >
void DenseIntMap< TValue >::Init (  )  [inline]

Creates a blank mapping.

Definition at line 64 of file intmap.h.

template<class TValue >
const Value& DenseIntMap< TValue >::operator[] ( index_t  index  )  const [inline]

Accesses an element from a static context.

Definition at line 108 of file intmap.h.

template<class TValue >
Value& DenseIntMap< TValue >::operator[] ( index_t  index  )  [inline]

Accesses an element, expanding if necessary.

If you are just probing, beware that this might actually grow the array!

Definition at line 93 of file intmap.h.

References mem::Realloc().

template<class TValue >
const Value& DenseIntMap< TValue >::operator[] ( index_t  index  )  const [inline]

Accesses an element from a static context.

Definition at line 108 of file intmap.h.

template<class TValue >
Value& DenseIntMap< TValue >::operator[] ( index_t  index  )  [inline]

Accesses an element, expanding if necessary.

If you are just probing, beware that this might actually grow the array!

Definition at line 93 of file intmap.h.

References mem::Realloc().

template<class TValue >
index_t DenseIntMap< TValue >::size (  )  const [inline]

Gets a non-inclusive upper bound on the last non-default element.

Iterating up to size() is guaranteed to hit all elements without growing the internal array.

Definition at line 84 of file intmap.h.

template<class TValue >
index_t DenseIntMap< TValue >::size (  )  const [inline]

Gets a non-inclusive upper bound on the last non-default element.

Iterating up to size() is guaranteed to hit all elements without growing the internal array.

Definition at line 84 of file intmap.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 24 12:04:40 2011 for FASTlib by  doxygen 1.6.3