Stride Reference Manual
- generated for commit 9643b11
|
Datastructure to index a container (supporting RandomAccessIterators) with slices. More...
#include <SliceIndexer.h>
Public Types | |
using | range_type = boost::sliced_range< T > |
Public Member Functions | |
SliceIndexer (T &t) | |
SliceIndexer holds a reference to the conatiner that it indexes. More... | |
range_type & | Get (const Key &s) |
Retrieve reference to a range by its key. More... | |
const range_type & | Get (const Key &s) const |
Retrieve const reference to a range by its Id. More... | |
const std::vector< range_type > & | Get () |
Retrieve all the ranges,. More... | |
range_type & | Set (std::size_t ibegin, std::size_t iend, const Key &name) |
Set a range. Warning: range is [ibegin, iend) i.e. half-open, iend not included! More... | |
range_type & | Set (std::size_t ibegin, const Key &name) |
Set a range, where the end is the end of the container. More... | |
Private Member Functions | |
void | check (const Key &name) |
Check key map for duplicate; throw iff duplicate. More... | |
Private Attributes | |
std::map< Key, std::size_t > | m_map |
Maps key values to subscripts. More... | |
std::vector< range_type > | m_slices |
Contains the slices. More... | |
T & | m_t |
Refernec to container that gets sliced into ranges. More... | |
Datastructure to index a container (supporting RandomAccessIterators) with slices.
We store those slices in order in a vector and expose the vector because processing effiency may dictate that we retrieve the in that order. They can also be retrieved by ket (key type defaults to std::string).
T | Type of the container in whom the ranges are indexed. |
Key | Type of Id that can be useld to retrieve the ranges. |
Definition at line 39 of file SliceIndexer.h.
using stride::util::SliceIndexer< T, Key >::range_type = boost::sliced_range<T> |
Definition at line 42 of file SliceIndexer.h.
|
inlineexplicit |
SliceIndexer holds a reference to the conatiner that it indexes.
Definition at line 46 of file SliceIndexer.h.
|
inline |
Retrieve reference to a range by its key.
Definition at line 49 of file SliceIndexer.h.
References stride::util::SliceIndexer< T, Key >::m_map, and stride::util::SliceIndexer< T, Key >::m_slices.
|
inline |
Retrieve const reference to a range by its Id.
Definition at line 52 of file SliceIndexer.h.
References stride::util::SliceIndexer< T, Key >::m_map, and stride::util::SliceIndexer< T, Key >::m_slices.
|
inline |
Retrieve all the ranges,.
Definition at line 55 of file SliceIndexer.h.
References stride::util::SliceIndexer< T, Key >::m_slices.
|
inline |
Set a range. Warning: range is [ibegin, iend) i.e. half-open, iend not included!
Definition at line 58 of file SliceIndexer.h.
References stride::util::SliceIndexer< T, Key >::check(), stride::util::SliceIndexer< T, Key >::m_map, stride::util::SliceIndexer< T, Key >::m_slices, and stride::util::SliceIndexer< T, Key >::m_t.
|
inline |
Set a range, where the end is the end of the container.
Definition at line 68 of file SliceIndexer.h.
References stride::util::SliceIndexer< T, Key >::check(), stride::util::SliceIndexer< T, Key >::m_map, stride::util::SliceIndexer< T, Key >::m_slices, and stride::util::SliceIndexer< T, Key >::m_t.
|
inlineprivate |
Check key map for duplicate; throw iff duplicate.
Definition at line 79 of file SliceIndexer.h.
References stride::util::SliceIndexer< T, Key >::m_map.
Referenced by stride::util::SliceIndexer< T, Key >::Set().
|
private |
Maps key values to subscripts.
Definition at line 87 of file SliceIndexer.h.
Referenced by stride::util::SliceIndexer< T, Key >::check(), stride::util::SliceIndexer< T, Key >::Get(), and stride::util::SliceIndexer< T, Key >::Set().
|
private |
Contains the slices.
Definition at line 88 of file SliceIndexer.h.
Referenced by stride::util::SliceIndexer< T, Key >::Get(), and stride::util::SliceIndexer< T, Key >::Set().
|
private |
Refernec to container that gets sliced into ranges.
Definition at line 89 of file SliceIndexer.h.
Referenced by stride::util::SliceIndexer< T, Key >::Set().