Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::ivector< T > Class Template Reference

#include <ivector.h>

Public Types

typedef T value_type
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef std::reverse_iterator
< iterator > 
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator > 
const_reverse_iterator
 
typedef size_t size_type
 
typedef std::iterator_traits
< iterator >::difference_type 
difference_type
 
- Public Types inherited from etl::vector_base
typedef size_t size_type
 

Public Member Functions

ivectoroperator= (ivector &other)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
void resize (size_t newSize, T value=T())
 
reference operator[] (size_t i)
 
const_reference operator[] (size_t i) const
 
reference at (size_t i)
 
const_reference at (size_t i) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
pointer data ()
 
const_pointer data () const
 
template<typename TIterator >
void assign (TIterator first, TIterator last)
 
void assign (size_t n, parameter_t value)
 
void push_back (parameter_t value)
 
iterator insert (iterator position, parameter_t value)
 
void insert (iterator position, size_t n, parameter_t value)
 
template<class TIterator >
void insert (iterator position, TIterator first, TIterator last)
 
iterator erase (iterator iElement)
 
iterator erase (iterator first, iterator last)
 
void clear ()
 
- Public Member Functions inherited from etl::vector_base
size_type size () const
 
bool empty () const
 
bool full () const
 
size_type capacity () const
 
size_type max_size () const
 
size_t available () const
 
void clear ()
 Clears the vector.
 
void push_back ()
 
void pop_back ()
 

Protected Types

typedef parameter_type< T >::type parameter_t
 

Protected Member Functions

 ivector (T *p_buffer, size_t MAX_SIZE)
 Constructor.
 
- Protected Member Functions inherited from etl::vector_base
 vector_base (size_t max_size)
 Constructor.
 

Additional Inherited Members

- Protected Attributes inherited from etl::vector_base
size_type current_size
 The current number of elements in the vector.
 
const size_type MAX_SIZE
 The maximum number of elements in the vector.
 

Detailed Description

template<typename T>
class etl::ivector< T >

The base class for specifically sized vectors. Can be used as a reference type for all vectors containing a specific type.

Member Function Documentation

template<typename T>
template<typename TIterator >
void etl::ivector< T >::assign ( TIterator  first,
TIterator  last 
)
inline

Assigns values to the vector. If ETL_THROW_EXCEPTIONS is defined, throws vector_full if the vector does not have enough free space. If ETL_THROW_EXCEPTIONS is defined, throws vector_iterator if the iterators are reversed.

Parameters
firstThe iterator to the first element.
lastThe iterator to the last element + 1.
template<typename T>
void etl::ivector< T >::assign ( size_t  n,
parameter_t  value 
)
inline

Assigns values to the vector. If ETL_THROW_EXCEPTIONS is defined, throws vector_full if the vector does not have enough free space.

Parameters
nThe number of elements to add.
valueThe value to insert for each element.
template<typename T>
reference etl::ivector< T >::at ( size_t  i)
inline

Returns a reference to the value at index 'i' If ETL_THROW_EXCEPTIONS is defined, throws a std::range_error if the index is out of range.

Parameters
iThe index.
Returns
A reference to the value at index 'i'
template<typename T>
const_reference etl::ivector< T >::at ( size_t  i) const
inline

Returns a const reference to the value at index 'i' If ETL_THROW_EXCEPTIONS is defined, throws a std::range_error if the index is out of range.

Parameters
iThe index.
Returns
A const reference to the value at index 'i'
template<typename T>
reference etl::ivector< T >::back ( )
inline

Returns a reference to the last element.

Returns
A reference to the last element.
template<typename T>
const_reference etl::ivector< T >::back ( ) const
inline

Returns a const reference to the last element.

Returns
A const reference to the last element.
template<typename T>
iterator etl::ivector< T >::begin ( )
inline

Returns an iterator to the beginning of the vector.

Returns
An iterator to the beginning of the vector.
template<typename T>
const_iterator etl::ivector< T >::begin ( ) const
inline

Returns a const_iterator to the beginning of the vector.

Returns
A const iterator to the beginning of the vector.
template<typename T>
const_iterator etl::ivector< T >::cbegin ( ) const
inline

Returns a const_iterator to the beginning of the vector.

Returns
A const iterator to the beginning of the vector.
template<typename T>
const_iterator etl::ivector< T >::cend ( ) const
inline

Returns a const_iterator to the end of the vector.

Returns
A const iterator to the end of the vector.
template<typename T>
void etl::ivector< T >::clear ( )
inline

Clears the vector. Does not call the destructor for any elements.

template<typename T>
const_reverse_iterator etl::ivector< T >::crbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the vector.

Returns
Const reverse iterator to the reverse beginning of the vector.
template<typename T>
const_reverse_iterator etl::ivector< T >::crend ( ) const
inline

Returns a const reverse iterator to the end + 1 of the vector.

Returns
Const reverse iterator to the end + 1 of the vector.
template<typename T>
pointer etl::ivector< T >::data ( )
inline

Returns a pointer to the beginning of the vector data.

Returns
A pointer to the beginning of the vector data.
template<typename T>
const_pointer etl::ivector< T >::data ( ) const
inline

Returns a const pointer to the beginning of the vector data.

Returns
A const pointer to the beginning of the vector data.
template<typename T>
iterator etl::ivector< T >::end ( )
inline

Returns an iterator to the end of the vector.

Returns
An iterator to the end of the vector.
template<typename T>
const_iterator etl::ivector< T >::end ( ) const
inline

Returns a const_iterator to the end of the vector.

Returns
A const iterator to the end of the vector.
template<typename T>
iterator etl::ivector< T >::erase ( iterator  iElement)
inline

Erases an element.

Parameters
iElementIterator to the element.
Returns
An iterator pointing to the element that followed the erased element.
template<typename T>
iterator etl::ivector< T >::erase ( iterator  first,
iterator  last 
)
inline

Erases a range of elements. The range includes all the elements between first and last, including the element pointed by first, but not the one pointed by last.

Parameters
firstIterator to the first element.
lastIterator to the last element.
Returns
An iterator pointing to the element that followed the erased element.
template<typename T>
reference etl::ivector< T >::front ( )
inline

Returns a reference to the first element.

Returns
A reference to the first element.
template<typename T>
const_reference etl::ivector< T >::front ( ) const
inline

Returns a const reference to the first element.

Returns
A const reference to the first element.
template<typename T>
iterator etl::ivector< T >::insert ( iterator  position,
parameter_t  value 
)
inline

Inserts a value to the vector. If ETL_THROW_EXCEPTIONS is defined, throws vector_full if the vector is already full.

Parameters
positionThe position to insert at.
valueThe value to insert.
template<typename T>
void etl::ivector< T >::insert ( iterator  position,
size_t  n,
parameter_t  value 
)
inline

Inserts 'n' values to the vector. If ETL_THROW_EXCEPTIONS is defined, throws vector_full if the vector does not have enough free space.

Parameters
positionThe position to insert at.
nThe number of elements to add.
valueThe value to insert.
template<typename T>
template<class TIterator >
void etl::ivector< T >::insert ( iterator  position,
TIterator  first,
TIterator  last 
)
inline

Inserts a range of values to the vector. If ETL_THROW_EXCEPTIONS is defined, throws vector_full if the vector does not have enough free space.

Parameters
positionThe position to insert at.
firstThe first element to add.
lastThe last + 1 element to add.
template<typename T>
ivector& etl::ivector< T >::operator= ( ivector< T > &  other)
inline

Assignment operator. The source vector can be larger than the destination, but only the elements that will fit in the destination will be copied.

Parameters
otherThe other vector.
template<typename T>
reference etl::ivector< T >::operator[] ( size_t  i)
inline

Returns a reference to the value at index 'i'

Parameters
iThe index.
Returns
A reference to the value at index 'i'
template<typename T>
const_reference etl::ivector< T >::operator[] ( size_t  i) const
inline

Returns a const reference to the value at index 'i'

Parameters
iThe index.
Returns
A const reference to the value at index 'i'
template<typename T>
void etl::ivector< T >::push_back ( parameter_t  value)
inline

Inserts a value at the end of the vector. If ETL_THROW_EXCEPTIONS is defined, throws vector_full if the vector is already full.

Parameters
valueThe value to add.
template<typename T>
reverse_iterator etl::ivector< T >::rbegin ( )
inline

Returns an reverse iterator to the reverse beginning of the vector.

Returns
Iterator to the reverse beginning of the vector.
template<typename T>
const_reverse_iterator etl::ivector< T >::rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the vector.

Returns
Const iterator to the reverse beginning of the vector.
template<typename T>
reverse_iterator etl::ivector< T >::rend ( )
inline

Returns a reverse iterator to the end + 1 of the vector.

Returns
Reverse iterator to the end + 1 of the vector.
template<typename T>
const_reverse_iterator etl::ivector< T >::rend ( ) const
inline

Returns a const reverse iterator to the end + 1 of the vector.

Returns
Const reverse iterator to the end + 1 of the vector.
template<typename T>
void etl::ivector< T >::resize ( size_t  newSize,
value = T() 
)
inline

Resizes the vector. If ETL_THROW_EXCEPTIONS is defined and the new size is larger than the maximum then a vector_full is thrown.

Parameters
newSizeThe new size.
valueThe value to fill new elements with. Default = default contructed value.

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