Rosetta  2019.47
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Types | Private Types | Static Private Attributes | Friends | List of all members
utility::vectorL< SSize, T, A > Class Template Reference

std::vector with L-based indexing More...

#include <vectorL.hh>

Inheritance diagram for utility::vectorL< SSize, T, A >:
Inheritance graph
[legend]

Public Types

typedef super::value_type value_type
 
typedef super::reference reference
 
typedef super::const_reference const_reference
 
typedef super::pointer pointer
 
typedef super::const_pointer const_pointer
 
typedef super::iterator iterator
 
typedef super::const_iterator const_iterator
 
typedef super::reverse_iterator reverse_iterator
 
typedef
super::const_reverse_iterator 
const_reverse_iterator
 
typedef super::size_type size_type
 
typedef super::difference_type difference_type
 
typedef super::allocator_type allocator_type
 
typedef ::platform::SSize ssize_type
 
typedef super::value_type Value
 
typedef super::reference Reference
 
typedef super::const_reference ConstReference
 
typedef super::pointer Pointer
 
typedef super::const_pointer ConstPointer
 
typedef super::iterator Iterator
 
typedef super::const_iterator ConstIterator
 
typedef super::reverse_iterator ReverseIterator
 
typedef
super::const_reverse_iterator 
ConstReverseIterator
 
typedef ::platform::Size Size
 
typedef super::difference_type Difference
 
typedef super::allocator_type Allocator
 
typedef ::platform::SSize SSize
 

Public Member Functions

 vectorL (allocator_type const &alloc=allocator_type())
 Default constructor. More...
 
 vectorL (vectorL const &v)
 Copy constructor. More...
 
template<ssize_type L_, typename T_ , typename A_ >
 vectorL (vectorL< L_, T_, A_ > const &v)
 Assignable copy constructor. More...
 
 vectorL (super const &v)
 std::vector constructor More...
 
template<typename T_ , typename A_ >
 vectorL (std::vector< T_, A_ > const &v)
 Assignable std::vector constructor. More...
 
 vectorL (size_type const num)
 Size constructor. More...
 
 vectorL (size_type const num, value_type const &value, allocator_type const &alloc=allocator_type())
 Uniform value constructor. More...
 
template<typename InputIterator >
 vectorL (InputIterator const beg, InputIterator const ending, allocator_type const &alloc=allocator_type())
 Iterator range constructor. More...
 
 vectorL (vectorL &&v)
 C++11 Move constructor. More...
 
 vectorL (super &&v)
 C++11 std::vector move constructor. More...
 
 vectorL (std::initializer_list< T > init, const A &alloc=A())
 C++11 initializer list constructor. More...
 
virtual ~vectorL ()
 Destructor. More...
 
vectorLoperator= (vectorL const &v)
 Copy assignment. More...
 
template<ssize_type L_, typename T_ , typename A_ >
vectorLoperator= (vectorL< L_, T_, A_ > const &v)
 Assignable copy assignment. More...
 
vectorLoperator= (super const &v)
 std::vector assignment More...
 
template<typename T_ , typename A_ >
vectorLoperator= (std::vector< T_, A_ > const &v)
 Assignable std::vector assignment. More...
 
super const & vector () const
 std::vector const explicit conversion More...
 
supervector ()
 std::vector explicit conversion More...
 
vectorLappend (vectorL const &v)
 Append another vectorL to the back of the vector. More...
 
vectorLadd_back (T const &t)
 Add an element to the back of the vector. More...
 
vectorLremove_back ()
 Remove the element at the back of the vector. More...
 
vectorLpop (T const &t)
 Remove an element of the vector. More...
 
void erase_index (index_type const i)
 Deletes the index from the vector. Has same thread-safety/iterator guarantees as std::vector::erase() (That is, it's not safe to access anything past the point of deletion, including the end() iterator.) More...
 
void shrink ()
 Shrink the index map to remove unused capacity. More...
 
bool contains (T const &t) const
 Check if vector contains a given element. More...
 
SSize index_of (T const &t)
 Return the index of a given element or exit if not found. More...
 
bool has (index_type const i) const
 Has an element with an index? More...
 
const_reference operator[] (index_type const i) const
 vectorL[ i ] const More...
 
reference operator[] (index_type const i)
 vectorL[ i ] More...
 
const_reference at (index_type const i) const
 vectorL.at( i ) const More...
 
reference at (index_type const i)
 vectorL.at( i ) More...
 
index_type l () const
 Lower index. More...
 
index_type u () const
 Upper index. More...
 
void swap (vectorL &v)
 swap( vectorL ) More...
 

Public Attributes

typedef vectorL_IndexSelector< L > = 0 >::index_type index_type
 

Protected Types

typedef std::vector< T, Aroot
 

Private Types

typedef std::vector< T, Asuper
 

Static Private Attributes

static index_type const l_
 Lower index in index type. More...
 

Friends

bool operator== (vectorL const &a, vectorL const &b)
 vectorL == vectorL More...
 
bool operator!= (vectorL const &a, vectorL const &b)
 vectorL != vectorL More...
 
bool operator< (vectorL const &a, vectorL const &b)
 vectorL < vectorL More...
 
bool operator<= (vectorL const &a, vectorL const &b)
 vectorL <= vectorL More...
 
bool operator>= (vectorL const &a, vectorL const &b)
 vectorL >= vectorL More...
 
bool operator> (vectorL const &a, vectorL const &b)
 vectorL > vectorL More...
 
bool operator== (vectorL const &a, super const &b)
 vectorL == std::vector More...
 
bool operator!= (vectorL const &a, super const &b)
 vectorL != std::vector More...
 
bool operator< (vectorL const &a, super const &b)
 vectorL < std::vector More...
 
bool operator<= (vectorL const &a, super const &b)
 vectorL <= std::vector More...
 
bool operator>= (vectorL const &a, super const &b)
 vectorL >= std::vector More...
 
bool operator> (vectorL const &a, super const &b)
 vectorL > std::vector More...
 
bool operator== (super const &a, vectorL const &b)
 std::vector == vectorL More...
 
bool operator!= (super const &a, vectorL const &b)
 std::vector != vectorL More...
 
bool operator< (super const &a, vectorL const &b)
 std::vector < vectorL More...
 
bool operator<= (super const &a, vectorL const &b)
 std::vector <= vectorL More...
 
bool operator>= (super const &a, vectorL const &b)
 std::vector >= vectorL More...
 
bool operator> (super const &a, vectorL const &b)
 std::vector > vectorL More...
 
template<platform::SSize LL, typename TT , typename AA >
void swap (vectorL< LL, TT, AA > &a, vectorL< LL, TT, AA > &b)
 swap( vectorL, vectorL ) More...
 
template<platform::SSize LL, typename TT , typename AA >
void swap (vectorL< LL, TT, AA > &a, std::vector< TT, AA > &b)
 swap( vectorL, std::vector ) More...
 
template<platform::SSize LL, typename TT , typename AA >
void swap (std::vector< TT, AA > &a, vectorL< LL, TT, AA > &b)
 swap( std::vector, vectorL ) More...
 

Detailed Description

template<platform::SSize, typename T, typename A = std::allocator< T >>
class utility::vectorL< SSize, T, A >

std::vector with L-based indexing

Note
  • std::vector with L-based indexing and a few extras
  • Lower index must be in the range of ssize_t
  • Index type is std::size_t or ssize_t depending on sign of L
  • When L is negative indexing operators can only reach the first max( ssize_t ) element and attempting to index beyond that will trigger an assertion failure
  • Can construct and assign from std::vector and swap with std::vector
  • Can compare with std::vector: compares contents ignoring indexes
  • Can explicitly convert to std::vector
  • Private inheritance from std::vector is safe here

Member Typedef Documentation

template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::allocator_type utility::vectorL< SSize, T, A >::Allocator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::allocator_type utility::vectorL< SSize, T, A >::allocator_type
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_iterator utility::vectorL< SSize, T, A >::const_iterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_pointer utility::vectorL< SSize, T, A >::const_pointer
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_reference utility::vectorL< SSize, T, A >::const_reference
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_reverse_iterator utility::vectorL< SSize, T, A >::const_reverse_iterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_iterator utility::vectorL< SSize, T, A >::ConstIterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_pointer utility::vectorL< SSize, T, A >::ConstPointer
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_reference utility::vectorL< SSize, T, A >::ConstReference
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::const_reverse_iterator utility::vectorL< SSize, T, A >::ConstReverseIterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::difference_type utility::vectorL< SSize, T, A >::Difference
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::difference_type utility::vectorL< SSize, T, A >::difference_type
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::iterator utility::vectorL< SSize, T, A >::iterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::iterator utility::vectorL< SSize, T, A >::Iterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::pointer utility::vectorL< SSize, T, A >::pointer
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::pointer utility::vectorL< SSize, T, A >::Pointer
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::reference utility::vectorL< SSize, T, A >::reference
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::reference utility::vectorL< SSize, T, A >::Reference
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::reverse_iterator utility::vectorL< SSize, T, A >::reverse_iterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::reverse_iterator utility::vectorL< SSize, T, A >::ReverseIterator
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef std::vector< T, A > utility::vectorL< SSize, T, A >::root
protected
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef ::platform::Size utility::vectorL< SSize, T, A >::Size
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::size_type utility::vectorL< SSize, T, A >::size_type
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef ::platform::SSize utility::vectorL< SSize, T, A >::SSize
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef ::platform::SSize utility::vectorL< SSize, T, A >::ssize_type
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef std::vector< T, A > utility::vectorL< SSize, T, A >::super
private
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::value_type utility::vectorL< SSize, T, A >::Value
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef super::value_type utility::vectorL< SSize, T, A >::value_type

Constructor & Destructor Documentation

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( allocator_type const &  alloc = allocator_type())
inlineexplicit
template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( vectorL< SSize, T, A > const &  v)
inline

Copy constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<ssize_type L_, typename T_ , typename A_ >
utility::vectorL< SSize, T, A >::vectorL ( vectorL< L_, T_, A_ > const &  v)
inline

Assignable copy constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( super const &  v)
inlineexplicit

std::vector constructor

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<typename T_ , typename A_ >
utility::vectorL< SSize, T, A >::vectorL ( std::vector< T_, A_ > const &  v)
inlineexplicit

Assignable std::vector constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( size_type const  num)
inlineexplicit

Size constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( size_type const  num,
value_type const &  value,
allocator_type const &  alloc = allocator_type() 
)
inline

Uniform value constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<typename InputIterator >
utility::vectorL< SSize, T, A >::vectorL ( InputIterator const  beg,
InputIterator const  ending,
allocator_type const &  alloc = allocator_type() 
)
inline

Iterator range constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( vectorL< SSize, T, A > &&  v)
inline

C++11 Move constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( super &&  v)
inlineexplicit

C++11 std::vector move constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
utility::vectorL< SSize, T, A >::vectorL ( std::initializer_list< T init,
const A alloc = A() 
)
inline

C++11 initializer list constructor.

template<platform::SSize , typename T, typename A = std::allocator< T >>
virtual utility::vectorL< SSize, T, A >::~vectorL ( )
inlinevirtual

Destructor.

Member Function Documentation

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL& utility::vectorL< SSize, T, A >::add_back ( T const &  t)
inline

Add an element to the back of the vector.

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL& utility::vectorL< SSize, T, A >::append ( vectorL< SSize, T, A > const &  v)
inline

Append another vectorL to the back of the vector.

Author
Labonte JWLab.nosp@m.onte.nosp@m.@jhu..nosp@m.edu

Referenced by main(), make_mutation_tag(), and basic::options::process().

template<platform::SSize , typename T, typename A = std::allocator< T >>
const_reference utility::vectorL< SSize, T, A >::at ( index_type const  i) const
inline
template<platform::SSize , typename T, typename A = std::allocator< T >>
reference utility::vectorL< SSize, T, A >::at ( index_type const  i)
inline

vectorL.at( i )

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool utility::vectorL< SSize, T, A >::contains ( T const &  t) const
inline
template<platform::SSize , typename T, typename A = std::allocator< T >>
void utility::vectorL< SSize, T, A >::erase_index ( index_type const  i)
inline

Deletes the index from the vector. Has same thread-safety/iterator guarantees as std::vector::erase() (That is, it's not safe to access anything past the point of deletion, including the end() iterator.)

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool utility::vectorL< SSize, T, A >::has ( index_type const  i) const
inline
template<platform::SSize , typename T, typename A = std::allocator< T >>
SSize utility::vectorL< SSize, T, A >::index_of ( T const &  t)
inline

Return the index of a given element or exit if not found.

Author
Labonte JWLab.nosp@m.onte.nosp@m.@jhu..nosp@m.edu
template<platform::SSize , typename T, typename A = std::allocator< T >>
index_type utility::vectorL< SSize, T, A >::l ( ) const
inline

Lower index.

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL& utility::vectorL< SSize, T, A >::operator= ( vectorL< SSize, T, A > const &  v)
inline

Copy assignment.

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<ssize_type L_, typename T_ , typename A_ >
vectorL& utility::vectorL< SSize, T, A >::operator= ( vectorL< L_, T_, A_ > const &  v)
inline

Assignable copy assignment.

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL& utility::vectorL< SSize, T, A >::operator= ( super const &  v)
inline

std::vector assignment

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<typename T_ , typename A_ >
vectorL& utility::vectorL< SSize, T, A >::operator= ( std::vector< T_, A_ > const &  v)
inline

Assignable std::vector assignment.

template<platform::SSize , typename T, typename A = std::allocator< T >>
const_reference utility::vectorL< SSize, T, A >::operator[] ( index_type const  i) const
inline

vectorL[ i ] const

template<platform::SSize , typename T, typename A = std::allocator< T >>
reference utility::vectorL< SSize, T, A >::operator[] ( index_type const  i)
inline

vectorL[ i ]

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL& utility::vectorL< SSize, T, A >::pop ( T const &  t)
inline

Remove an element of the vector.

Author
Jared Adolf-Bryfogle jadol.nosp@m.fbr@.nosp@m.gmail.nosp@m..com

Referenced by MPDomainAssembly::apply().

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL& utility::vectorL< SSize, T, A >::remove_back ( )
inline

Remove the element at the back of the vector.

template<platform::SSize , typename T, typename A = std::allocator< T >>
void utility::vectorL< SSize, T, A >::shrink ( )
inline
template<platform::SSize , typename T, typename A = std::allocator< T >>
void utility::vectorL< SSize, T, A >::swap ( vectorL< SSize, T, A > &  v)
inline
template<platform::SSize , typename T, typename A = std::allocator< T >>
index_type utility::vectorL< SSize, T, A >::u ( ) const
inline

Upper index.

template<platform::SSize , typename T, typename A = std::allocator< T >>
super const& utility::vectorL< SSize, T, A >::vector ( ) const
inline

std::vector const explicit conversion

template<platform::SSize , typename T, typename A = std::allocator< T >>
super& utility::vectorL< SSize, T, A >::vector ( )
inline

std::vector explicit conversion

Friends And Related Function Documentation

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator!= ( vectorL< SSize, T, A > const &  a,
vectorL< SSize, T, A > const &  b 
)
friend
template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator!= ( vectorL< SSize, T, A > const &  a,
super const &  b 
)
friend

vectorL != std::vector

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator!= ( super const &  a,
vectorL< SSize, T, A > const &  b 
)
friend

std::vector != vectorL

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator< ( vectorL< SSize, T, A > const &  a,
vectorL< SSize, T, A > const &  b 
)
friend
template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator< ( vectorL< SSize, T, A > const &  a,
super const &  b 
)
friend

vectorL < std::vector

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator< ( super const &  a,
vectorL< SSize, T, A > const &  b 
)
friend

std::vector < vectorL

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator<= ( vectorL< SSize, T, A > const &  a,
vectorL< SSize, T, A > const &  b 
)
friend
template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator<= ( vectorL< SSize, T, A > const &  a,
super const &  b 
)
friend

vectorL <= std::vector

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator<= ( super const &  a,
vectorL< SSize, T, A > const &  b 
)
friend

std::vector <= vectorL

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator== ( vectorL< SSize, T, A > const &  a,
vectorL< SSize, T, A > const &  b 
)
friend
template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator== ( vectorL< SSize, T, A > const &  a,
super const &  b 
)
friend

vectorL == std::vector

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator== ( super const &  a,
vectorL< SSize, T, A > const &  b 
)
friend

std::vector == vectorL

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator> ( vectorL< SSize, T, A > const &  a,
vectorL< SSize, T, A > const &  b 
)
friend
template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator> ( vectorL< SSize, T, A > const &  a,
super const &  b 
)
friend

vectorL > std::vector

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator> ( super const &  a,
vectorL< SSize, T, A > const &  b 
)
friend

std::vector > vectorL

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator>= ( vectorL< SSize, T, A > const &  a,
vectorL< SSize, T, A > const &  b 
)
friend
template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator>= ( vectorL< SSize, T, A > const &  a,
super const &  b 
)
friend

vectorL >= std::vector

template<platform::SSize , typename T, typename A = std::allocator< T >>
bool operator>= ( super const &  a,
vectorL< SSize, T, A > const &  b 
)
friend

std::vector >= vectorL

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<platform::SSize LL, typename TT , typename AA >
void swap ( vectorL< LL, TT, AA > &  a,
vectorL< LL, TT, AA > &  b 
)
friend

swap( vectorL, vectorL )

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<platform::SSize LL, typename TT , typename AA >
void swap ( vectorL< LL, TT, AA > &  a,
std::vector< TT, AA > &  b 
)
friend

swap( vectorL, std::vector )

template<platform::SSize , typename T, typename A = std::allocator< T >>
template<platform::SSize LL, typename TT , typename AA >
void swap ( std::vector< TT, AA > &  a,
vectorL< LL, TT, AA > &  b 
)
friend

swap( std::vector, vectorL )

Member Data Documentation

template<platform::SSize , typename T, typename A = std::allocator< T >>
vectorL< L, T, A >::index_type const utility::vectorL< L, T, A >::l_
staticprivate
template<platform::SSize , typename T, typename A = std::allocator< T >>
typedef utility::vectorL< SSize, T, A >::vectorL_IndexSelector< L > = 0 >::index_type index_type

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