Rosetta 3.3
Public Types | Public Member Functions | Friends
utility::keys::KeyVector< K, T > Class Template Reference

Keyed-access vector. More...

#include <KeyVector.hh>

Collaboration diagram for utility::keys::KeyVector< K, T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedefkey_type
typedef Vector::value_type value_type
typedef Vector::reference reference
typedef Vector::const_reference const_reference
typedef Vector::pointer pointer
typedef Vector::const_pointer const_pointer
typedef Vector::iterator iterator
typedef Vector::const_iterator const_iterator
typedef Vector::reverse_iterator reverse_iterator
typedef
Vector::const_reverse_iterator 
const_reverse_iterator
typedef Vector::size_type size_type
typedef Vector::index_type index_type
typedef Vector::difference_type difference_type
typedef Vector::allocator_type allocator_type
typedefKey
typedef Vector::Value Value
typedef Vector::Reference Reference
typedef Vector::ConstReference ConstReference
typedef Vector::Pointer Pointer
typedef Vector::ConstPointer ConstPointer
typedef Vector::Iterator Iterator
typedef Vector::ConstIterator ConstIterator
typedef Vector::ReverseIterator ReverseIterator
typedef
Vector::ConstReverseIterator 
ConstReverseIterator
typedef Vector::Size Size
typedef Vector::Index Index
typedef Vector::Difference Difference
typedef Vector::Allocator Allocator

Public Member Functions

 KeyVector ()
 Default constructor.
 KeyVector (Size const num)
 Size constructor.
 KeyVector (Size const num, Value const &value)
 Uniform value constructor.
template<typename InputIterator >
 KeyVector (InputIterator const beg, InputIterator const end)
 Iterator range constructor.
 ~KeyVector ()
 Destructor.
KeyVectoroperator= (KeyVector const &a)
 Copy assignment.
KeyVectoroperator= (Value const &value)
 Uniform value assignment to elements.
KeyVectorassign (Key const &key, Value const &value)
 Assign a value to an element with a key.
void assign (Size const num, Value const &value)
 Uniform value assignment.
template<typename InputIterator >
void assign (InputIterator const beg, InputIterator const end)
 Iterator assignment.
KeyVectoradd (Key const &key)
 Add an element with a key if not present.
Iterator insert (Iterator const pos, Value const &value)
 Insert an element at an iterator position.
void insert (Iterator const pos, Size const num, Value const &value)
 Insert num copies of an element at an iterator position.
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.
void push_back (Value const &value)
 Appends an element.
Iterator erase (Iterator const pos)
 Erase an element at an iterator position.
Iterator erase (Iterator const beg, Iterator const end)
 Erase elements in the iterator range [beg,end)
void pop_back ()
 Removes the last element.
void resize (Size const num)
 Resize: Default construct new elements.
void resize (Size const num, Value const &value)
 Resize: Assign given value to new elements.
void reserve (Size const num)
 Reserve space for a given number of elements.
void shrink ()
 Shrink the vector to remove unused capacity.
void swap (KeyVector &a)
 swap( KeyVector )
void clear ()
 Clear the vector.
Size size () const
 Size.
bool empty () const
 Empty?
Size max_size () const
 Max size.
Size capacity () const
 Capacity.
ConstReference front () const
 Front element.
Reference front ()
 Front element.
ConstReference back () const
 Back element.
Reference back ()
 Back element.
bool has (Key const &key) const
 Is an element with a key present?
bool active (Key const &key) const
 Is a key active?
bool inactive (Key const &key) const
 Is a key inactive?
ConstIterator find (Key const &key) const
 Iterator to element with a key.
Iterator find (Key const &key)
 Iterator to element with a key.
Reference operator() (Key const &key)
 KeyVector( key )
ConstReference operator[] (Key const &key) const
 KeyVector[ key ] const.
Reference operator[] (Key const &key)
 KeyVector[ key ].
ConstReference at (Key const &key) const
 Element at index key: Bounds checked.
Reference at (Key const &key)
 Element at index key: Bounds checked.
ConstIterator begin () const
 Begin iterator.
Iterator begin ()
 Begin iterator.
ConstIterator end () const
 End iterator.
Iterator end ()
 End iterator.
ConstReverseIterator rbegin () const
 Begin reverse iterator.
ReverseIterator rbegin ()
 Begin reverse iterator.
ConstReverseIterator rend () const
 End reverse iterator.
ReverseIterator rend ()
 End reverse iterator.

Friends

void swap (KeyVector &a, KeyVector &b)
 swap( KeyVector, KeyVector )
bool operator== (KeyVector const &a, KeyVector const &b)
 KeyVector == KeyVector.
bool operator!= (KeyVector const &a, KeyVector const &b)
 KeyVector != KeyVector.

Detailed Description

template<typename K, typename T>
class utility::keys::KeyVector< K, T >

Keyed-access vector.


Member Typedef Documentation

template<typename K, typename T>
typedef Vector::Allocator utility::keys::KeyVector< K, T >::Allocator
template<typename K, typename T>
typedef Vector::allocator_type utility::keys::KeyVector< K, T >::allocator_type
template<typename K, typename T>
typedef Vector::const_iterator utility::keys::KeyVector< K, T >::const_iterator
template<typename K, typename T>
typedef Vector::const_pointer utility::keys::KeyVector< K, T >::const_pointer
template<typename K, typename T>
typedef Vector::const_reference utility::keys::KeyVector< K, T >::const_reference
template<typename K, typename T>
typedef Vector::ConstIterator utility::keys::KeyVector< K, T >::ConstIterator
template<typename K, typename T>
typedef Vector::ConstPointer utility::keys::KeyVector< K, T >::ConstPointer
template<typename K, typename T>
typedef Vector::ConstReference utility::keys::KeyVector< K, T >::ConstReference
template<typename K, typename T>
typedef Vector::Difference utility::keys::KeyVector< K, T >::Difference
template<typename K, typename T>
typedef Vector::difference_type utility::keys::KeyVector< K, T >::difference_type
template<typename K, typename T>
typedef Vector::Index utility::keys::KeyVector< K, T >::Index
template<typename K, typename T>
typedef Vector::index_type utility::keys::KeyVector< K, T >::index_type
template<typename K, typename T>
typedef Vector::Iterator utility::keys::KeyVector< K, T >::Iterator
template<typename K, typename T>
typedef Vector::iterator utility::keys::KeyVector< K, T >::iterator
template<typename K, typename T>
typedef K utility::keys::KeyVector< K, T >::Key
template<typename K, typename T>
typedef K utility::keys::KeyVector< K, T >::key_type
template<typename K, typename T>
typedef Vector::Pointer utility::keys::KeyVector< K, T >::Pointer
template<typename K, typename T>
typedef Vector::pointer utility::keys::KeyVector< K, T >::pointer
template<typename K, typename T>
typedef Vector::Reference utility::keys::KeyVector< K, T >::Reference
template<typename K, typename T>
typedef Vector::reference utility::keys::KeyVector< K, T >::reference
template<typename K, typename T>
typedef Vector::ReverseIterator utility::keys::KeyVector< K, T >::ReverseIterator
template<typename K, typename T>
typedef Vector::Size utility::keys::KeyVector< K, T >::Size
template<typename K, typename T>
typedef Vector::size_type utility::keys::KeyVector< K, T >::size_type
template<typename K, typename T>
typedef Vector::Value utility::keys::KeyVector< K, T >::Value
template<typename K, typename T>
typedef Vector::value_type utility::keys::KeyVector< K, T >::value_type

Constructor & Destructor Documentation

template<typename K, typename T>
utility::keys::KeyVector< K, T >::KeyVector ( ) [inline]

Default constructor.

template<typename K, typename T>
utility::keys::KeyVector< K, T >::KeyVector ( Size const  num) [inline, explicit]

Size constructor.

template<typename K, typename T>
utility::keys::KeyVector< K, T >::KeyVector ( Size const  num,
Value const &  value 
) [inline]

Uniform value constructor.

template<typename K, typename T>
template<typename InputIterator >
utility::keys::KeyVector< K, T >::KeyVector ( InputIterator const  beg,
InputIterator const  end 
) [inline]

Iterator range constructor.

template<typename K, typename T>
utility::keys::KeyVector< K, T >::~KeyVector ( ) [inline]

Destructor.


Member Function Documentation

template<typename K, typename T>
bool utility::keys::KeyVector< K, T >::active ( Key const &  key) const [inline]
template<typename K, typename T>
KeyVector& utility::keys::KeyVector< K, T >::add ( Key const &  key) [inline]

Add an element with a key if not present.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::assign ( Size const  num,
Value const &  value 
) [inline]

Uniform value assignment.

template<typename K, typename T>
template<typename InputIterator >
void utility::keys::KeyVector< K, T >::assign ( InputIterator const  beg,
InputIterator const  end 
) [inline]

Iterator assignment.

template<typename K, typename T>
KeyVector& utility::keys::KeyVector< K, T >::assign ( Key const &  key,
Value const &  value 
) [inline]

Assign a value to an element with a key.

Note:
Expands the vector if necessary

References value.

template<typename K, typename T>
ConstReference utility::keys::KeyVector< K, T >::at ( Key const &  key) const [inline]

Element at index key: Bounds checked.

References utility::vectorL< L, T, A >::at().

template<typename K, typename T>
Reference utility::keys::KeyVector< K, T >::at ( Key const &  key) [inline]

Element at index key: Bounds checked.

References utility::vectorL< L, T, A >::at().

template<typename K, typename T>
ConstReference utility::keys::KeyVector< K, T >::back ( ) const [inline]

Back element.

template<typename K, typename T>
Reference utility::keys::KeyVector< K, T >::back ( ) [inline]

Back element.

template<typename K, typename T>
ConstIterator utility::keys::KeyVector< K, T >::begin ( ) const [inline]

Begin iterator.

template<typename K, typename T>
Iterator utility::keys::KeyVector< K, T >::begin ( ) [inline]

Begin iterator.

template<typename K, typename T>
Size utility::keys::KeyVector< K, T >::capacity ( ) const [inline]

Capacity.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::clear ( ) [inline]

Clear the vector.

template<typename K, typename T>
bool utility::keys::KeyVector< K, T >::empty ( ) const [inline]

Empty?

template<typename K, typename T>
Iterator utility::keys::KeyVector< K, T >::end ( ) [inline]

End iterator.

template<typename K, typename T>
ConstIterator utility::keys::KeyVector< K, T >::end ( ) const [inline]

End iterator.

template<typename K, typename T>
Iterator utility::keys::KeyVector< K, T >::erase ( Iterator const  pos) [inline]

Erase an element at an iterator position.

template<typename K, typename T>
Iterator utility::keys::KeyVector< K, T >::erase ( Iterator const  beg,
Iterator const  end 
) [inline]

Erase elements in the iterator range [beg,end)

template<typename K, typename T>
Iterator utility::keys::KeyVector< K, T >::find ( Key const &  key) [inline]

Iterator to element with a key.

References utility::keys::KeyVector< K, T >::active().

template<typename K, typename T>
ConstIterator utility::keys::KeyVector< K, T >::find ( Key const &  key) const [inline]

Iterator to element with a key.

References utility::keys::KeyVector< K, T >::active().

template<typename K, typename T>
ConstReference utility::keys::KeyVector< K, T >::front ( ) const [inline]

Front element.

template<typename K, typename T>
Reference utility::keys::KeyVector< K, T >::front ( ) [inline]

Front element.

template<typename K, typename T>
bool utility::keys::KeyVector< K, T >::has ( Key const &  key) const [inline]

Is an element with a key present?

References utility::vectorL< L, T, A >::has().

template<typename K, typename T>
bool utility::keys::KeyVector< K, T >::inactive ( Key const &  key) const [inline]

Is a key inactive?

References utility::vectorL< L, T, A >::has().

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::insert ( Iterator const  pos,
Size const  num,
Value const &  value 
) [inline]

Insert num copies of an element at an iterator position.

template<typename K, typename T>
template<typename InputIterator >
void utility::keys::KeyVector< K, T >::insert ( Iterator const  pos,
InputIterator const  beg,
InputIterator const  end 
) [inline]

Insert elements from iterator range [beg,end) at an iterator position.

template<typename K, typename T>
Iterator utility::keys::KeyVector< K, T >::insert ( Iterator const  pos,
Value const &  value 
) [inline]

Insert an element at an iterator position.

template<typename K, typename T>
Size utility::keys::KeyVector< K, T >::max_size ( ) const [inline]

Max size.

template<typename K, typename T>
Reference utility::keys::KeyVector< K, T >::operator() ( Key const &  key) [inline]

KeyVector( key )

Note:
Expands the vector if necessary
template<typename K, typename T>
KeyVector& utility::keys::KeyVector< K, T >::operator= ( Value const &  value) [inline]

Uniform value assignment to elements.

References color_pdb::i, and value.

template<typename K, typename T>
KeyVector& utility::keys::KeyVector< K, T >::operator= ( KeyVector< K, T > const &  a) [inline]

Copy assignment.

template<typename K, typename T>
ConstReference utility::keys::KeyVector< K, T >::operator[] ( Key const &  key) const [inline]

KeyVector[ key ] const.

References key.

template<typename K, typename T>
Reference utility::keys::KeyVector< K, T >::operator[] ( Key const &  key) [inline]

KeyVector[ key ].

References key.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::pop_back ( ) [inline]

Removes the last element.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::push_back ( Value const &  value) [inline]

Appends an element.

template<typename K, typename T>
ConstReverseIterator utility::keys::KeyVector< K, T >::rbegin ( ) const [inline]

Begin reverse iterator.

template<typename K, typename T>
ReverseIterator utility::keys::KeyVector< K, T >::rbegin ( ) [inline]

Begin reverse iterator.

template<typename K, typename T>
ReverseIterator utility::keys::KeyVector< K, T >::rend ( ) [inline]

End reverse iterator.

template<typename K, typename T>
ConstReverseIterator utility::keys::KeyVector< K, T >::rend ( ) const [inline]

End reverse iterator.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::reserve ( Size const  num) [inline]

Reserve space for a given number of elements.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::resize ( Size const  num) [inline]

Resize: Default construct new elements.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::resize ( Size const  num,
Value const &  value 
) [inline]

Resize: Assign given value to new elements.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::shrink ( ) [inline]

Shrink the vector to remove unused capacity.

References utility::vectorL< L, T, A >::shrink().

template<typename K, typename T>
Size utility::keys::KeyVector< K, T >::size ( ) const [inline]

Size.

template<typename K, typename T>
void utility::keys::KeyVector< K, T >::swap ( KeyVector< K, T > &  a) [inline]

swap( KeyVector )

References utility::vectorL< L, T, A >::swap().

Referenced by std::swap().


Friends And Related Function Documentation

template<typename K, typename T>
bool operator!= ( KeyVector< K, T > const &  a,
KeyVector< K, T > const &  b 
) [friend]
template<typename K, typename T>
bool operator== ( KeyVector< K, T > const &  a,
KeyVector< K, T > const &  b 
) [friend]
template<typename K, typename T>
void swap ( KeyVector< K, T > &  a,
KeyVector< K, T > &  b 
) [friend]

swap( KeyVector, KeyVector )


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines