This is some awesome robot code

Dependencies:   mbed-rtos mbed QEI

Fork of ICRSEurobot13 by Thomas Branch

Embed: (wiki syntax)

« Back to documentation index

Vector< T, Sz > Class Template Reference

Compile time fixed length vector with evaluation on compile time. More...

#include <tvmet/Vector.h>

Data Structures

struct  Info
 Structure for info printing as Vector<T, Size>. More...

Public Types

enum  { Size = Sz }
 

Dimensions.

More...
enum  
 

Complexity counter.

More...
typedef T value_type
 Data type of the tvmet::Vector.
typedef T & reference
 Reference type of the tvmet::Vector data elements.
typedef const T & const_reference
 const reference type of the tvmet::Vector data elements.
typedef T * iterator
 STL iterator interface.
typedef const T * const_iterator
 STL const_iterator interface.
typedef std::reverse_iterator
< iterator
reverse_iterator
 STL reverse iterator interface.
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 STL const reverse iterator interface.

Public Member Functions

iterator begin ()
 STL iterator interface.
iterator end ()
 STL iterator interface.
const_iterator begin () const
 STL const_iterator interface.
const_iterator end () const
 STL const_iterator interface.
reverse_iterator rbegin ()
 STL reverse iterator interface reverse begin.
const_reverse_iterator rbegin () const
 STL const reverse iterator interface reverse begin.
reverse_iterator rend ()
 STL reverse iterator interface reverse end.
const_reverse_iterator rend () const
 STL const reverse iterator interface reverse end.
value_type front ()
 STL vector front element.
const_reference front () const
 STL vector const front element.
value_type back ()
 STL vector back element.
const_reference back () const
 STL vector const back element.
 ~Vector ()
 Default Destructor.
 Vector ()
 Default Constructor.
 Vector (const Vector &rhs)
 Copy Constructor, not explicit!
template<class InputIterator >
 Vector (InputIterator first, InputIterator last)
 Constructor with STL iterator interface.
template<class InputIterator >
 Vector (InputIterator first, std::size_t sz)
 Constructor with STL iterator interface.
 Vector (value_type rhs)
 Constructor with initializer for all elements.
 Vector (value_type x0, value_type x1)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6, value_type x7)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6, value_type x7, value_type x8)
 Default Constructor with initializer list.
 Vector (value_type x0, value_type x1, value_type x2, value_type x3, value_type x4, value_type x5, value_type x6, value_type x7, value_type x8, value_type x9)
 Default Constructor with initializer list.
template<class E >
 Vector (const XprVector< E, Size > &e)
 Construct a vector by expression.
CommaInitializer< Vector, Size > operator= (value_type rhs)
 Assign a value_type on array, this can be used for a single value or a comma separeted list of values.
ConstReference const_ref () const
 Return a const Reference of the internal data.
XprVector< ConstReference, Size > as_expr () const
 Return the vector as const expression.
template<class T2 , class Assign >
void assign_to (Vector< T2, Size > &dest, const Assign &assign_fn) const
 assign this to a vector expression using the functional assign_fn.
template<class T2 >
Vectoroperator= (const Vector< T2, Size > &rhs)
 assign a given Vector element wise to this vector.
template<class E >
Vectoroperator= (const XprVector< E, Size > &rhs)
 assign a given XprVector element wise to this vector.
std::ostream & print_xpr (std::ostream &os, std::size_t l=0) const
 Member function for expression level printing.
std::ostream & print_on (std::ostream &os) const
 Member function for printing internal data.

Static Public Member Functions

static bool empty ()
 STL vector empty() - returns allways false.
static std::size_t size ()
 The size of the vector.
static std::size_t max_size ()
 STL vector max_size() - returns allways Size.
static Info info ()
 Get an info object of this vector.

Detailed Description

template<class T, std::size_t Sz>
class tvmet::Vector< T, Sz >

Compile time fixed length vector with evaluation on compile time.

Definition at line 108 of file Vector.h.


Member Typedef Documentation

typedef const T* const_iterator

STL const_iterator interface.

Definition at line 124 of file Vector.h.

typedef const T& const_reference

const reference type of the tvmet::Vector data elements.

Definition at line 118 of file Vector.h.

typedef std::reverse_iterator<const_iterator> const_reverse_iterator

STL const reverse iterator interface.

Definition at line 130 of file Vector.h.

typedef T* iterator

STL iterator interface.

Definition at line 121 of file Vector.h.

typedef T& reference

Reference type of the tvmet::Vector data elements.

Definition at line 115 of file Vector.h.

typedef std::reverse_iterator<iterator> reverse_iterator

STL reverse iterator interface.

Definition at line 127 of file Vector.h.

typedef T value_type

Data type of the tvmet::Vector.

Definition at line 112 of file Vector.h.


Member Enumeration Documentation

anonymous enum

Dimensions.

Enumerator:
Size 

The size of the vector.

Definition at line 134 of file Vector.h.

anonymous enum

Complexity counter.

Definition at line 140 of file Vector.h.


Constructor & Destructor Documentation

~Vector (  )

Default Destructor.

Definition at line 198 of file Vector.h.

Vector (  ) [explicit]

Default Constructor.

The allocated memory region isn't cleared. If you want a clean use the constructor argument zero.

Definition at line 206 of file Vector.h.

Vector ( const Vector< T, Sz > &  rhs )

Copy Constructor, not explicit!

Definition at line 213 of file Vector.h.

Vector ( InputIterator  first,
InputIterator  last 
) [explicit]

Constructor with STL iterator interface.

The data will be copied into the vector self, there isn't any stored reference to the array pointer.

Definition at line 226 of file Vector.h.

Vector ( InputIterator  first,
std::size_t  sz 
) [explicit]

Constructor with STL iterator interface.

The data will be copied into the vector self, there isn't any stored reference to the array pointer.

Definition at line 241 of file Vector.h.

Vector ( value_type  rhs ) [explicit]

Constructor with initializer for all elements.

Definition at line 251 of file Vector.h.

Vector ( value_type  x0,
value_type  x1 
) [explicit]

Default Constructor with initializer list.

Definition at line 261 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2 
) [explicit]

Default Constructor with initializer list.

Definition at line 271 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3 
) [explicit]

Default Constructor with initializer list.

Definition at line 281 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3,
value_type  x4 
) [explicit]

Default Constructor with initializer list.

Definition at line 291 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3,
value_type  x4,
value_type  x5 
) [explicit]

Default Constructor with initializer list.

Definition at line 302 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3,
value_type  x4,
value_type  x5,
value_type  x6 
) [explicit]

Default Constructor with initializer list.

Definition at line 314 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3,
value_type  x4,
value_type  x5,
value_type  x6,
value_type  x7 
) [explicit]

Default Constructor with initializer list.

Definition at line 326 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3,
value_type  x4,
value_type  x5,
value_type  x6,
value_type  x7,
value_type  x8 
) [explicit]

Default Constructor with initializer list.

Definition at line 338 of file Vector.h.

Vector ( value_type  x0,
value_type  x1,
value_type  x2,
value_type  x3,
value_type  x4,
value_type  x5,
value_type  x6,
value_type  x7,
value_type  x8,
value_type  x9 
) [explicit]

Default Constructor with initializer list.

Definition at line 351 of file Vector.h.

Vector ( const XprVector< E, Size > &  e ) [explicit]

Construct a vector by expression.

Definition at line 365 of file Vector.h.


Member Function Documentation

XprVector<ConstReference, Size> as_expr (  ) const

Return the vector as const expression.

Definition at line 411 of file Vector.h.

void assign_to ( Vector< T2, Size > &  dest,
const Assign &  assign_fn 
) const

assign this to a vector expression using the functional assign_fn.

Definition at line 433 of file Vector.h.

value_type back (  )

STL vector back element.

Definition at line 182 of file Vector.h.

const_reference back (  ) const

STL vector const back element.

Definition at line 185 of file Vector.h.

iterator begin (  )

STL iterator interface.

Definition at line 148 of file Vector.h.

const_iterator begin (  ) const

STL const_iterator interface.

Definition at line 154 of file Vector.h.

ConstReference const_ref (  ) const

Return a const Reference of the internal data.

Definition at line 408 of file Vector.h.

static bool empty (  ) [static]

STL vector empty() - returns allways false.

Definition at line 188 of file Vector.h.

const_iterator end (  ) const

STL const_iterator interface.

Definition at line 157 of file Vector.h.

iterator end (  )

STL iterator interface.

Definition at line 151 of file Vector.h.

value_type front (  )

STL vector front element.

Definition at line 176 of file Vector.h.

const_reference front (  ) const

STL vector const front element.

Definition at line 179 of file Vector.h.

static Info info (  ) [static]

Get an info object of this vector.

Definition at line 529 of file Vector.h.

static std::size_t max_size (  ) [static]

STL vector max_size() - returns allways Size.

Definition at line 194 of file Vector.h.

Vector& operator= ( const XprVector< E, Size > &  rhs )

assign a given XprVector element wise to this vector.

Definition at line 448 of file Vector.h.

CommaInitializer<Vector, Size> operator= ( value_type  rhs )

Assign a value_type on array, this can be used for a single value or a comma separeted list of values.

Definition at line 375 of file Vector.h.

Vector& operator= ( const Vector< T2, Size > &  rhs )

assign a given Vector element wise to this vector.

The operator=(const Vector&) is compiler generated.

Definition at line 441 of file Vector.h.

std::ostream & print_on ( std::ostream &  os ) const

Member function for printing internal data.

Definition at line 52 of file VectorImpl.h.

std::ostream & print_xpr ( std::ostream &  os,
std::size_t  l = 0 
) const

Member function for expression level printing.

Definition at line 40 of file VectorImpl.h.

const_reverse_iterator rbegin (  ) const

STL const reverse iterator interface reverse begin.

Definition at line 163 of file Vector.h.

reverse_iterator rbegin (  )

STL reverse iterator interface reverse begin.

Definition at line 160 of file Vector.h.

const_reverse_iterator rend (  ) const

STL const reverse iterator interface reverse end.

Definition at line 171 of file Vector.h.

reverse_iterator rend (  )

STL reverse iterator interface reverse end.

Definition at line 168 of file Vector.h.

static std::size_t size (  ) [static]

The size of the vector.

Definition at line 191 of file Vector.h.