Rosetta
Public Types | Public Member Functions | Public Attributes | Private Types | Static Private Attributes | Friends | List of all members
utility::vectorL< L, bool, A > Class Template Reference

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

#include <vectorL_bool.hh>

Inheritance diagram for utility::vectorL< L, bool, 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 super::size_type 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< bool > 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...
 
void erase_index (index_type const i)
 Deletes the index from the vector. More...
 
void shrink ()
 Shrink the index map to remove unused capacity. 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...
 
vectorL< L, bool, Ainvert () const
 Inversion operator. More...
 
bool has_value (bool const &t) const
 useful function – was commented out previously due, I think, to a conflict with has() in OptionKeys! Now renamed to has_value(). More...
 
void swap (vectorL &v)
 swap( vectorL ) More...
 

Public Attributes

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

Private Types

typedef std::vector< bool, 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 AA >
void swap (vectorL< LL, AA > &a, vectorL< LL, AA > &b)
 swap( vectorL, vectorL ) More...
 
template<platform::SSize LL, typename AA >
void swap (vectorL< LL, AA > &a, std::vector< bool, AA > &b)
 swap( vectorL, std::vector ) More...
 
template<platform::SSize LL, typename AA >
void swap (std::vector< bool, AA > &a, vectorL< LL, AA > &b)
 swap( std::vector, vectorL ) More...
 

Detailed Description

template<platform::SSize L, typename A>
class utility::vectorL< L, bool, A >

std::vector with L-based indexing: bool specialization

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

◆ Allocator

template<platform::SSize L, typename A >
typedef super::allocator_type utility::vectorL< L, bool, A >::Allocator

◆ allocator_type

template<platform::SSize L, typename A >
typedef super::allocator_type utility::vectorL< L, bool, A >::allocator_type

◆ const_iterator

template<platform::SSize L, typename A >
typedef super::const_iterator utility::vectorL< L, bool, A >::const_iterator

◆ const_pointer

template<platform::SSize L, typename A >
typedef super::const_pointer utility::vectorL< L, bool, A >::const_pointer

◆ const_reference

template<platform::SSize L, typename A >
typedef super::const_reference utility::vectorL< L, bool, A >::const_reference

◆ const_reverse_iterator

template<platform::SSize L, typename A >
typedef super::const_reverse_iterator utility::vectorL< L, bool, A >::const_reverse_iterator

◆ ConstIterator

template<platform::SSize L, typename A >
typedef super::const_iterator utility::vectorL< L, bool, A >::ConstIterator

◆ ConstPointer

template<platform::SSize L, typename A >
typedef super::const_pointer utility::vectorL< L, bool, A >::ConstPointer

◆ ConstReference

template<platform::SSize L, typename A >
typedef super::const_reference utility::vectorL< L, bool, A >::ConstReference

◆ ConstReverseIterator

template<platform::SSize L, typename A >
typedef super::const_reverse_iterator utility::vectorL< L, bool, A >::ConstReverseIterator

◆ Difference

template<platform::SSize L, typename A >
typedef super::difference_type utility::vectorL< L, bool, A >::Difference

◆ difference_type

template<platform::SSize L, typename A >
typedef super::difference_type utility::vectorL< L, bool, A >::difference_type

◆ iterator

template<platform::SSize L, typename A >
typedef super::iterator utility::vectorL< L, bool, A >::iterator

◆ Iterator

template<platform::SSize L, typename A >
typedef super::iterator utility::vectorL< L, bool, A >::Iterator

◆ pointer

template<platform::SSize L, typename A >
typedef super::pointer utility::vectorL< L, bool, A >::pointer

◆ Pointer

template<platform::SSize L, typename A >
typedef super::pointer utility::vectorL< L, bool, A >::Pointer

◆ reference

template<platform::SSize L, typename A >
typedef super::reference utility::vectorL< L, bool, A >::reference

◆ Reference

template<platform::SSize L, typename A >
typedef super::reference utility::vectorL< L, bool, A >::Reference

◆ reverse_iterator

template<platform::SSize L, typename A >
typedef super::reverse_iterator utility::vectorL< L, bool, A >::reverse_iterator

◆ ReverseIterator

template<platform::SSize L, typename A >
typedef super::reverse_iterator utility::vectorL< L, bool, A >::ReverseIterator

◆ Size

template<platform::SSize L, typename A >
typedef super::size_type utility::vectorL< L, bool, A >::Size

◆ size_type

template<platform::SSize L, typename A >
typedef super::size_type utility::vectorL< L, bool, A >::size_type

◆ SSize

template<platform::SSize L, typename A >
typedef platform::SSize utility::vectorL< L, bool, A >::SSize

◆ ssize_type

template<platform::SSize L, typename A >
typedef platform::SSize utility::vectorL< L, bool, A >::ssize_type

◆ super

template<platform::SSize L, typename A >
typedef std::vector< bool, A > utility::vectorL< L, bool, A >::super
private

◆ Value

template<platform::SSize L, typename A >
typedef super::value_type utility::vectorL< L, bool, A >::Value

◆ value_type

template<platform::SSize L, typename A >
typedef super::value_type utility::vectorL< L, bool, A >::value_type

Constructor & Destructor Documentation

◆ vectorL() [1/11]

template<platform::SSize L, typename A >
utility::vectorL< L, bool, A >::vectorL ( allocator_type const &  alloc = allocator_type())
inlineexplicit

Default constructor.

◆ vectorL() [2/11]

template<platform::SSize L, typename A >
utility::vectorL< L, bool, A >::vectorL ( vectorL< L, bool, A > const &  v)
inline

Copy constructor.

◆ vectorL() [3/11]

template<platform::SSize L, typename A >
template<ssize_type L_, typename T_ , typename A_ >
utility::vectorL< L, bool, A >::vectorL ( vectorL< L_, T_, A_ > const &  v)
inline

Assignable copy constructor.

◆ vectorL() [4/11]

template<platform::SSize L, typename A >
utility::vectorL< L, bool, A >::vectorL ( super const &  v)
inlineexplicit

std::vector constructor

◆ vectorL() [5/11]

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

Assignable std::vector constructor.

◆ vectorL() [6/11]

template<platform::SSize L, typename A >
utility::vectorL< L, bool, A >::vectorL ( size_type const  num)
inlineexplicit

Size constructor.

◆ vectorL() [7/11]

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

Uniform value constructor.

◆ vectorL() [8/11]

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

Iterator range constructor.

◆ vectorL() [9/11]

template<platform::SSize L, typename A >
utility::vectorL< L, bool, A >::vectorL ( vectorL< L, bool, A > &&  v)
inline

C++11 Move constructor.

◆ vectorL() [10/11]

template<platform::SSize L, typename A >
utility::vectorL< L, bool, A >::vectorL ( super &&  v)
inlineexplicit

C++11 std::vector move constructor.

◆ vectorL() [11/11]

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

C++11 initializer list constructor.

◆ ~vectorL()

template<platform::SSize L, typename A >
virtual utility::vectorL< L, bool, A >::~vectorL ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ append()

template<platform::SSize L, typename A >
vectorL& utility::vectorL< L, bool, A >::append ( vectorL< L, bool, A > const &  v)
inline

◆ at() [1/2]

template<platform::SSize L, typename A >
reference utility::vectorL< L, bool, A >::at ( index_type const  i)
inline

◆ at() [2/2]

template<platform::SSize L, typename A >
const_reference utility::vectorL< L, bool, A >::at ( index_type const  i) const
inline

vectorL.at( i ) const

References debug_assert, create_a3b_hbs::i, and utility::vectorL< L, T, A >::l_.

◆ erase_index()

template<platform::SSize L, typename A >
void utility::vectorL< L, bool, A >::erase_index ( index_type const  i)
inline

Deletes the index from the vector.

References begin, debug_assert, create_a3b_hbs::i, utility::vectorL< L, T, A >::l_, and subloop_histogram::size.

◆ has()

template<platform::SSize L, typename A >
bool utility::vectorL< L, bool, A >::has ( index_type const  i) const
inline

Has an element with an index?

References create_a3b_hbs::i, utility::vectorL< L, T, A >::l_, and subloop_histogram::size.

◆ has_value()

template<platform::SSize L, typename A >
bool utility::vectorL< L, bool, A >::has_value ( bool const &  t) const
inline

useful function – was commented out previously due, I think, to a conflict with has() in OptionKeys! Now renamed to has_value().

References begin, end, detail::find(), and predPRE::t.

◆ invert()

template<platform::SSize L, typename A >
vectorL< L, bool, A > utility::vectorL< L, bool, A >::invert ( ) const
inline

Inversion operator.

References create_a3b_hbs::i.

◆ l()

template<platform::SSize L, typename A >
index_type utility::vectorL< L, bool, A >::l ( ) const
inline

Lower index.

References utility::vectorL< L, T, A >::l_.

◆ operator=() [1/4]

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

Assignable std::vector assignment.

References kmeans_adaptive_kernel_density_bb_dependent_rotlib::v.

◆ operator=() [2/4]

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

std::vector assignment

References kmeans_adaptive_kernel_density_bb_dependent_rotlib::v.

◆ operator=() [3/4]

template<platform::SSize L, typename A >
vectorL& utility::vectorL< L, bool, A >::operator= ( vectorL< L, bool, A > const &  v)
inline

◆ operator=() [4/4]

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

Assignable copy assignment.

References kmeans_adaptive_kernel_density_bb_dependent_rotlib::v.

◆ operator[]() [1/2]

template<platform::SSize L, typename A >
reference utility::vectorL< L, bool, A >::operator[] ( index_type const  i)
inline

◆ operator[]() [2/2]

template<platform::SSize L, typename A >
const_reference utility::vectorL< L, bool, A >::operator[] ( index_type const  i) const
inline

◆ shrink()

template<platform::SSize L, typename A >
void utility::vectorL< L, bool, A >::shrink ( )
inline

Shrink the index map to remove unused capacity.

References subloop_histogram::size, and utility::vectorL< L, T, A >::vectorL().

◆ swap()

template<platform::SSize L, typename A >
void utility::vectorL< L, bool, A >::swap ( vectorL< L, bool, A > &  v)
inline

◆ u()

template<platform::SSize L, typename A >
index_type utility::vectorL< L, bool, A >::u ( ) const
inline

◆ vector() [1/2]

template<platform::SSize L, typename A >
super& utility::vectorL< L, bool, A >::vector ( )
inline

std::vector explicit conversion

◆ vector() [2/2]

template<platform::SSize L, typename A >
super const& utility::vectorL< L, bool, A >::vector ( ) const
inline

std::vector const explicit conversion

Friends And Related Function Documentation

◆ operator!= [1/3]

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

std::vector != vectorL

◆ operator!= [2/3]

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

vectorL != std::vector

◆ operator!= [3/3]

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

◆ operator< [1/3]

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

std::vector < vectorL

◆ operator< [2/3]

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

vectorL < std::vector

◆ operator< [3/3]

template<platform::SSize L, typename A >
bool operator< ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)
friend

◆ operator<= [1/3]

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

std::vector <= vectorL

◆ operator<= [2/3]

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

vectorL <= std::vector

◆ operator<= [3/3]

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

◆ operator== [1/3]

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

std::vector == vectorL

◆ operator== [2/3]

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

vectorL == std::vector

◆ operator== [3/3]

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

◆ operator> [1/3]

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

std::vector > vectorL

◆ operator> [2/3]

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

vectorL > std::vector

◆ operator> [3/3]

template<platform::SSize L, typename A >
bool operator> ( vectorL< L, bool, A > const &  a,
vectorL< L, bool, A > const &  b 
)
friend

◆ operator>= [1/3]

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

std::vector >= vectorL

◆ operator>= [2/3]

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

vectorL >= std::vector

◆ operator>= [3/3]

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

◆ swap [1/3]

template<platform::SSize L, typename A >
template<platform::SSize LL, typename AA >
void swap ( std::vector< bool, AA > &  a,
vectorL< LL, AA > &  b 
)
friend

swap( std::vector, vectorL )

◆ swap [2/3]

template<platform::SSize L, typename A >
template<platform::SSize LL, typename AA >
void swap ( vectorL< LL, AA > &  a,
std::vector< bool, AA > &  b 
)
friend

swap( vectorL, std::vector )

◆ swap [3/3]

template<platform::SSize L, typename A >
template<platform::SSize LL, typename AA >
void swap ( vectorL< LL, AA > &  a,
vectorL< LL, AA > &  b 
)
friend

swap( vectorL, vectorL )

Member Data Documentation

◆ l_

template<platform::SSize L, typename A >
vectorL< L, bool, A >::index_type const utility::vectorL< L, bool, A >::l_
staticprivate

Lower index in index type.

◆ vectorL_IndexSelector< L >

template<platform::SSize L, typename A >
typedef utility::vectorL< L, bool, A >::vectorL_IndexSelector< L > = 0 >::index_type index_type

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