![]() |
Rosetta
2020.22
|
Keyed-access vector with key subset map. More...
#include <SmallKeyVector.hh>
Public Member Functions | |
SmallKeyVector () | |
Default constructor. More... | |
SmallKeyVector (SmallKeyVector const &a) | |
Copy constructor. More... | |
SmallKeyVector (Size num) | |
Size constructor. More... | |
SmallKeyVector (Size num, Value const &value) | |
Uniform value constructor. More... | |
template<typename InputIterator > | |
SmallKeyVector (InputIterator const beg, InputIterator const end) | |
Iterator range constructor. More... | |
~SmallKeyVector () | |
Destructor. More... | |
SmallKeyVector & | operator= (SmallKeyVector const &a) |
Copy assignment. More... | |
SmallKeyVector & | operator= (Value const &value) |
Uniform value assignment to current elements. More... | |
SmallKeyVector & | assign (Key const &key, Value const &value) |
Assign a value to an element with a key. More... | |
void | assign (Size num, Value const &value) |
Uniform value assignment. More... | |
template<typename InputIterator > | |
void | assign (InputIterator const beg, InputIterator const end) |
Iterator assignment. More... | |
SmallKeyVector & | add (Key const &key) |
Add an element with a key if not present: Activate key if inactive. More... | |
Iterator | insert (Iterator const &pos, Value const &value) |
Insert an element at an iterator position. More... | |
void | insert (Iterator const &pos, Size num, Value const &value) |
Insert num copies of an element at an iterator position. More... | |
template<typename InputIterator > | |
void | insert (Iterator const &pos, InputIterator const &beg, InputIterator const &end) |
Insert elements from iterator range [beg,end) at an iterator position. More... | |
void | push_back (Value const &value) |
Appends an element. More... | |
Iterator | erase (Iterator const &pos) |
Erase an element at an iterator position. More... | |
Iterator | erase (Iterator const &beg, Iterator const &end) |
Erase elements in the iterator range [beg,end) More... | |
void | pop_back () |
Removes the last element. More... | |
void | resize (Size num) |
Resize: Default construct new elements. More... | |
void | resize (Size num, Value const &value) |
Resize: Assign given value to new elements. More... | |
void | reserve (Size num) |
Reserve space for a given number of elements. More... | |
void | shrink () |
Shrink the vectors to remove unused capacity. More... | |
void | swap (SmallKeyVector &a) |
swap( SmallKeyVector ) More... | |
void | clear () |
Clear the vector. More... | |
Size | size () const |
Size. More... | |
bool | empty () const |
Empty? More... | |
Size | max_size () const |
Max size. More... | |
Size | capacity () const |
Capacity. More... | |
ConstReference | front () const |
Front element. More... | |
Reference | front () |
Front element. More... | |
ConstReference | back () const |
Back element. More... | |
Reference | back () |
Back element. More... | |
bool | has (Key const &key) const |
Is an element with a key present? More... | |
bool | active (Key const &key) const |
Is a key active? More... | |
bool | inactive (Key const &key) const |
Is a key inactive? More... | |
Index const & | index (Key const &key) |
Index of a key. More... | |
ConstIterator | find (Key const &key) const |
Iterator to element with a key. More... | |
Iterator | find (Key const &key) |
Iterator to element with a key. More... | |
Reference | operator() (Key const &key) |
SmallKeyVector( key ) More... | |
ConstReference | operator[] (Key const &key) const |
SmallKeyVector[ key ] const. More... | |
Reference | operator[] (Key const &key) |
SmallKeyVector[ key ]. More... | |
ConstReference | at (Key const &key) const |
Element at index key: Bounds checked. More... | |
Reference | at (Key const &key) |
Element at index key: Bounds checked. More... | |
ConstReference | operator[] (Index const &i) const |
SmallKeyVector[ index ] const. More... | |
Reference | operator[] (Index const &i) |
SmallKeyVector[ index ]. More... | |
ConstIterator | begin () const |
Begin iterator. More... | |
Iterator | begin () |
Begin iterator. More... | |
ConstIterator | end () const |
End iterator. More... | |
Iterator | end () |
End iterator. More... | |
ConstReverseIterator | rbegin () const |
Begin reverse iterator. More... | |
ReverseIterator | rbegin () |
Begin reverse iterator. More... | |
ConstReverseIterator | rend () const |
End reverse iterator. More... | |
ReverseIterator | rend () |
End reverse iterator. More... | |
Private Types | |
typedef vector1< T > | Vector |
typedef vector1< typename Vector::Index > | IndexMap |
typedef IndexMap::Size | IndexMapSize |
typedef IndexMap::Index | IndexMapIndex |
Private Member Functions | |
Index const & | add_key (Key const &key) |
Add an element with a key if not present and return its index: Activate key if inactive. More... | |
Private Attributes | |
Vector | v_ |
Vector of values indexed by a subset of the possible keys. More... | |
IndexMap | m_ |
Index map from keys into v_: Zero => inactive key. More... | |
Index | u_ |
Upper active index of active keys. More... | |
Friends | |
template<typename UK , typename UT > | |
void | swap (SmallKeyVector< UK, UT > &a, SmallKeyVector< UK, UT > &b) |
swap( SmallKeyVector, SmallKeyVector ) More... | |
bool | operator== (SmallKeyVector const &a, SmallKeyVector const &b) |
SmallKeyVector == SmallKeyVector. More... | |
bool | operator!= (SmallKeyVector const &a, SmallKeyVector const &b) |
SmallKeyVector != SmallKeyVector. More... | |
Keyed-access vector with key subset map.
typedef Vector::Allocator utility::keys::SmallKeyVector< K, T >::Allocator |
typedef Vector::allocator_type utility::keys::SmallKeyVector< K, T >::allocator_type |
typedef Vector::const_iterator utility::keys::SmallKeyVector< K, T >::const_iterator |
typedef Vector::const_pointer utility::keys::SmallKeyVector< K, T >::const_pointer |
typedef Vector::const_reference utility::keys::SmallKeyVector< K, T >::const_reference |
typedef Vector::const_reverse_iterator utility::keys::SmallKeyVector< K, T >::const_reverse_iterator |
typedef Vector::ConstIterator utility::keys::SmallKeyVector< K, T >::ConstIterator |
typedef Vector::ConstPointer utility::keys::SmallKeyVector< K, T >::ConstPointer |
typedef Vector::ConstReference utility::keys::SmallKeyVector< K, T >::ConstReference |
typedef Vector::ConstReverseIterator utility::keys::SmallKeyVector< K, T >::ConstReverseIterator |
typedef Vector::Difference utility::keys::SmallKeyVector< K, T >::Difference |
typedef Vector::difference_type utility::keys::SmallKeyVector< K, T >::difference_type |
typedef Vector::Index utility::keys::SmallKeyVector< K, T >::Index |
typedef Vector::index_type utility::keys::SmallKeyVector< K, T >::index_type |
|
private |
|
private |
|
private |
typedef Vector::iterator utility::keys::SmallKeyVector< K, T >::iterator |
typedef Vector::Iterator utility::keys::SmallKeyVector< K, T >::Iterator |
typedef K utility::keys::SmallKeyVector< K, T >::Key |
typedef K utility::keys::SmallKeyVector< K, T >::key_type |
typedef Vector::pointer utility::keys::SmallKeyVector< K, T >::pointer |
typedef Vector::Pointer utility::keys::SmallKeyVector< K, T >::Pointer |
typedef Vector::reference utility::keys::SmallKeyVector< K, T >::reference |
typedef Vector::Reference utility::keys::SmallKeyVector< K, T >::Reference |
typedef Vector::reverse_iterator utility::keys::SmallKeyVector< K, T >::reverse_iterator |
typedef Vector::ReverseIterator utility::keys::SmallKeyVector< K, T >::ReverseIterator |
typedef Vector::Size utility::keys::SmallKeyVector< K, T >::Size |
typedef Vector::size_type utility::keys::SmallKeyVector< K, T >::size_type |
typedef Vector::Value utility::keys::SmallKeyVector< K, T >::Value |
typedef Vector::value_type utility::keys::SmallKeyVector< K, T >::value_type |
|
private |
|
inline |
Default constructor.
|
inline |
Copy constructor.
|
inlineexplicit |
Size constructor.
|
inline |
Uniform value constructor.
|
inline |
Iterator range constructor.
|
inline |
Destructor.
|
inline |
Is a key active?
Referenced by utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::at(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::find(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::has(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::index(), and utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator[]().
|
inline |
Add an element with a key if not present: Activate key if inactive.
|
inlineprivate |
Add an element with a key if not present and return its index: Activate key if inactive.
Referenced by utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::add(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::assign(), and utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator()().
|
inline |
Assign a value to an element with a key.
|
inline |
Uniform value assignment.
|
inline |
Iterator assignment.
|
inline |
Element at index key: Bounds checked.
|
inline |
Element at index key: Bounds checked.
|
inline |
Back element.
|
inline |
Back element.
|
inline |
|
inline |
Begin iterator.
|
inline |
Capacity.
|
inline |
Clear the vector.
|
inline |
Empty?
|
inline |
End iterator.
Referenced by utility::options::OptionCollection::show_accessed_options(), and utility::options::OptionCollection::show_unused_options().
|
inline |
End iterator.
|
inline |
Erase an element at an iterator position.
|
inline |
Erase elements in the iterator range [beg,end)
|
inline |
Iterator to element with a key.
|
inline |
Iterator to element with a key.
|
inline |
Front element.
|
inline |
Front element.
|
inline |
Is an element with a key present?
Referenced by utility::options::OptionCollection::has(), utility::options::OptionCollection::operator()(), and utility::options::OptionCollection::operator[]().
|
inline |
Is a key inactive?
|
inline |
Index of a key.
|
inline |
Insert an element at an iterator position.
|
inline |
Insert num copies of an element at an iterator position.
|
inline |
Insert elements from iterator range [beg,end) at an iterator position.
|
inline |
Max size.
|
inline |
SmallKeyVector( key )
|
inline |
Copy assignment.
|
inline |
Uniform value assignment to current elements.
|
inline |
SmallKeyVector[ key ] const.
|
inline |
SmallKeyVector[ key ].
|
inline |
SmallKeyVector[ index ] const.
|
inline |
SmallKeyVector[ index ].
|
inline |
Removes the last element.
|
inline |
Appends an element.
|
inline |
Begin reverse iterator.
|
inline |
Begin reverse iterator.
|
inline |
End reverse iterator.
|
inline |
End reverse iterator.
|
inline |
Reserve space for a given number of elements.
|
inline |
Resize: Default construct new elements.
|
inline |
Resize: Assign given value to new elements.
|
inline |
Shrink the vectors to remove unused capacity.
|
inline |
Size.
|
inline |
swap( SmallKeyVector )
|
friend |
|
friend |
|
friend |
swap( SmallKeyVector, SmallKeyVector )
|
private |
Index map from keys into v_: Zero => inactive key.
Referenced by utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::active(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::add_key(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::at(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::clear(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::find(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::inactive(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::index(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator=(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator[](), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::shrink(), and utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::swap().
|
private |
Upper active index of active keys.
Referenced by utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::add_key(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::clear(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator=(), and utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::swap().
|
private |
Vector of values indexed by a subset of the possible keys.
Referenced by utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::add_key(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::assign(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::at(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::back(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::begin(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::capacity(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::clear(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::empty(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::end(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::erase(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::find(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::front(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::insert(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::max_size(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator()(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator=(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::operator[](), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::pop_back(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::push_back(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::rbegin(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::rend(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::reserve(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::resize(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::shrink(), utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::size(), and utility::keys::SmallKeyVector< PathVectorOptionKey, PathVectorOption >::swap().