FPGA Resource Manager C++ API  1.8
inaccel::vector< _Tp > Class Template Reference
Inheritance diagram for inaccel::vector< _Tp >:
Collaboration diagram for inaccel::vector< _Tp >:

Public Types

typedef _Tp value_type
 
typedef _Base::pointer pointer
 
typedef _Base::const_pointer const_pointer
 
typedef _Base::reference reference
 
typedef _Base::const_reference const_reference
 
typedef _Base::iterator iterator
 
typedef _Base::const_iterator const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef _Alloc allocator_type
 
typedef _Base::fundamental_type fundamental_type
 

Public Member Functions

 vector ()
 Creates a vector with no elements. More...
 
 vector (size_type __n, const value_type &__value=value_type())
 Creates a vector with copies of an exemplar element. More...
 
 vector (const vector &__x)
 Vector copy constructor. More...
 
template<typename _InputIterator >
 vector (_InputIterator __first, _InputIterator __last)
 Builds a vector from a range. More...
 
 ~vector () _GLIBCXX_NOEXCEPT
 The dtor only erases the elements, and note that if the elements themselves are pointers, the pointed-to memory is not touched in any way. More...
 
bool is_dirty ()
 
bool is_dirty () const
 
vectorset_dirty ()
 
const vectorset_dirty () const
 
vectorunset_dirty ()
 
const vectorunset_dirty () const
 
bool is_fundamental ()
 
vectoroperator= (const vector &__x)
 Vector assignment operator. More...
 
void assign (size_type __n, const value_type &__val)
 Assigns a given value to a vector. More...
 
template<typename _InputIterator >
void assign (_InputIterator __first, _InputIterator __last)
 Assigns a range to a vector. More...
 
reverse_iterator rbegin () _GLIBCXX_NOEXCEPT
 Returns a read/write reverse iterator that points to the last element in the vector. More...
 
const_reverse_iterator rbegin () const _GLIBCXX_NOEXCEPT
 Returns a read-only (constant) reverse iterator that points to the last element in the vector. More...
 
reverse_iterator rend () _GLIBCXX_NOEXCEPT
 Returns a read/write reverse iterator that points to one before the first element in the vector. More...
 
const_reverse_iterator rend () const _GLIBCXX_NOEXCEPT
 Returns a read-only (constant) reverse iterator that points to one before the first element in the vector. More...
 
void resize (size_type __new_size, value_type __x=value_type())
 Resizes the vector to the specified number of elements. More...
 
bool empty () const _GLIBCXX_NOEXCEPT
 Returns true if the vector is empty. More...
 
reference at (size_type __n)
 Provides access to the data contained in the vector. More...
 
const_reference at (size_type __n) const
 Provides access to the data contained in the vector. More...
 
reference front () _GLIBCXX_NOEXCEPT
 Returns a read/write reference to the data at the first element of the vector. More...
 
const_reference front () const _GLIBCXX_NOEXCEPT
 Returns a read-only (constant) reference to the data at the first element of the vector. More...
 
reference back () _GLIBCXX_NOEXCEPT
 Returns a read/write reference to the data at the last element of the vector. More...
 
const_reference back () const _GLIBCXX_NOEXCEPT
 Returns a read-only (constant) reference to the data at the last element of the vector. More...
 
void insert (iterator __position, size_type __n, const value_type &__x)
 Inserts a number of copies of given data into the vector. More...
 
template<typename _InputIterator >
void insert (iterator __position, _InputIterator __first, _InputIterator __last)
 Inserts a range into the vector. More...
 
iterator erase (iterator __position)
 Remove element at given position. More...
 
iterator erase (iterator __first, iterator __last)
 Remove a range of elements. More...
 
void swap (vector &__x) _GLIBCXX_NOEXCEPT
 Swaps data with another vector. More...
 
void clear () _GLIBCXX_NOEXCEPT
 Erases all the elements. More...
 

Protected Types

typedef _Vector_base< _Tp > _Base
 
typedef _Base::_Alloc _Alloc
 
typedef _Base::_Alloc_type _Alloc_type
 
typedef __gnu_cxx::__alloc_traits< _Alloc_type_Alloc_traits
 

Protected Member Functions

template<typename _Integer >
void _M_assign_dispatch (_Integer __n, _Integer __val, std::__true_type)
 
template<typename _InputIterator >
void _M_assign_dispatch (_InputIterator __first, _InputIterator __last, std::__false_type)
 
template<typename _Integer >
void _M_insert_dispatch (iterator __pos, _Integer __n, _Integer __val, std::__true_type)
 
template<typename _InputIterator >
void _M_insert_dispatch (iterator __pos, _InputIterator __first, _InputIterator __last, std::__false_type)
 

Member Typedef Documentation

template<class _Tp >
typedef _Base::_Alloc inaccel::vector< _Tp >::_Alloc
protected
template<class _Tp >
typedef __gnu_cxx::__alloc_traits<_Alloc_type> inaccel::vector< _Tp >::_Alloc_traits
protected
template<class _Tp >
typedef _Base::_Alloc_type inaccel::vector< _Tp >::_Alloc_type
protected
template<class _Tp >
typedef _Vector_base<_Tp> inaccel::vector< _Tp >::_Base
protected
template<class _Tp >
typedef _Alloc inaccel::vector< _Tp >::allocator_type
template<class _Tp >
typedef _Base::const_iterator inaccel::vector< _Tp >::const_iterator
template<class _Tp >
typedef _Base::const_pointer inaccel::vector< _Tp >::const_pointer
template<class _Tp >
typedef _Base::const_reference inaccel::vector< _Tp >::const_reference
template<class _Tp >
typedef std::reverse_iterator<const_iterator> inaccel::vector< _Tp >::const_reverse_iterator
template<class _Tp >
typedef ptrdiff_t inaccel::vector< _Tp >::difference_type
template<class _Tp >
typedef _Base::fundamental_type inaccel::vector< _Tp >::fundamental_type
template<class _Tp >
typedef _Base::iterator inaccel::vector< _Tp >::iterator
template<class _Tp >
typedef _Base::pointer inaccel::vector< _Tp >::pointer
template<class _Tp >
typedef _Base::reference inaccel::vector< _Tp >::reference
template<class _Tp >
typedef std::reverse_iterator<iterator> inaccel::vector< _Tp >::reverse_iterator
template<class _Tp >
typedef size_t inaccel::vector< _Tp >::size_type
template<class _Tp >
typedef _Tp inaccel::vector< _Tp >::value_type

Constructor & Destructor Documentation

template<class _Tp >
inaccel::vector< _Tp >::vector ( )
inline

Creates a vector with no elements.

template<class _Tp >
inaccel::vector< _Tp >::vector ( size_type  __n,
const value_type __value = value_type() 
)
inlineexplicit

Creates a vector with copies of an exemplar element.

Parameters
__nThe number of elements to initially create.
__valueAn element to copy.

This constructor fills the vector with __n copies of __value.

template<class _Tp >
inaccel::vector< _Tp >::vector ( const vector< _Tp > &  __x)
inline

Vector copy constructor.

Parameters
__xA vector of identical element types.

All the elements of __x are copied, but any unused capacity in __x will not be copied (i.e. capacity() == size() in the new vector).

template<class _Tp >
template<typename _InputIterator >
inaccel::vector< _Tp >::vector ( _InputIterator  __first,
_InputIterator  __last 
)
inline

Builds a vector from a range.

Parameters
__firstAn input iterator.
__lastAn input iterator.

Create a vector consisting of copies of the elements from [first,last).

If the iterators are forward, bidirectional, or random-access, then this will call the elements' copy constructor N times (where N is distance(first,last)) and do no memory reallocation. But if only input iterators are used, then this will do at most 2N calls to the copy constructor, and logN memory reallocations.

template<class _Tp >
inaccel::vector< _Tp >::~vector ( )
inline

The dtor only erases the elements, and note that if the elements themselves are pointers, the pointed-to memory is not touched in any way.

Managing the pointer is the user's responsibility.

Member Function Documentation

template<class _Tp >
template<typename _Integer >
void inaccel::vector< _Tp >::_M_assign_dispatch ( _Integer  __n,
_Integer  __val,
std::__true_type   
)
inlineprotected
template<class _Tp >
template<typename _InputIterator >
void inaccel::vector< _Tp >::_M_assign_dispatch ( _InputIterator  __first,
_InputIterator  __last,
std::__false_type   
)
inlineprotected
template<class _Tp >
template<typename _Integer >
void inaccel::vector< _Tp >::_M_insert_dispatch ( iterator  __pos,
_Integer  __n,
_Integer  __val,
std::__true_type   
)
inlineprotected
template<class _Tp >
template<typename _InputIterator >
void inaccel::vector< _Tp >::_M_insert_dispatch ( iterator  __pos,
_InputIterator  __first,
_InputIterator  __last,
std::__false_type   
)
inlineprotected
template<class _Tp >
void inaccel::vector< _Tp >::assign ( size_type  __n,
const value_type __val 
)
inline

Assigns a given value to a vector.

Parameters
__nNumber of elements to be assigned.
__valValue to be assigned.

This function fills a vector with __n copies of the given value. Note that the assignment completely changes the vector and that the resulting vector's size is the same as the number of elements assigned.

template<class _Tp >
template<typename _InputIterator >
void inaccel::vector< _Tp >::assign ( _InputIterator  __first,
_InputIterator  __last 
)
inline

Assigns a range to a vector.

Parameters
__firstAn input iterator.
__lastAn input iterator.

This function fills a vector with copies of the elements in the range [__first,__last).

Note that the assignment completely changes the vector and that the resulting vector's size is the same as the number of elements assigned.

template<class _Tp >
reference inaccel::vector< _Tp >::at ( size_type  __n)
inline

Provides access to the data contained in the vector.

Parameters
__nThe index of the element for which data should be accessed.
Returns
Read/write reference to data.
Exceptions
std::out_of_rangeIf __n is an invalid index.

This function provides for safer data access. The parameter is first checked that it is in the range of the vector. The function throws out_of_range if the check fails.

template<class _Tp >
const_reference inaccel::vector< _Tp >::at ( size_type  __n) const
inline

Provides access to the data contained in the vector.

Parameters
__nThe index of the element for which data should be accessed.
Returns
Read-only (constant) reference to data.
Exceptions
std::out_of_rangeIf __n is an invalid index.

This function provides for safer data access. The parameter is first checked that it is in the range of the vector. The function throws out_of_range if the check fails.

template<class _Tp >
reference inaccel::vector< _Tp >::back ( )
inline

Returns a read/write reference to the data at the last element of the vector.

template<class _Tp >
const_reference inaccel::vector< _Tp >::back ( ) const
inline

Returns a read-only (constant) reference to the data at the last element of the vector.

template<class _Tp >
void inaccel::vector< _Tp >::clear ( )
inline

Erases all the elements.

Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

template<class _Tp >
bool inaccel::vector< _Tp >::empty ( ) const
inline

Returns true if the vector is empty.

(Thus begin() would equal end().)

template<class _Tp >
iterator inaccel::vector< _Tp >::erase ( iterator  __position)
inline

Remove element at given position.

Parameters
__positionIterator pointing to element to be erased.
Returns
An iterator pointing to the next element (or end()).

This function will erase the element at the given position and thus shorten the vector by one.

Note This operation could be expensive and if it is frequently used the user should consider using std::list. The user is also cautioned that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

template<class _Tp >
iterator inaccel::vector< _Tp >::erase ( iterator  __first,
iterator  __last 
)
inline

Remove a range of elements.

Parameters
__firstIterator pointing to the first element to be erased.
__lastIterator pointing to one past the last element to be erased.
Returns
An iterator pointing to the element pointed to by __last prior to erasing (or end()).

This function will erase the elements in the range [__first,__last) and shorten the vector accordingly.

Note This operation could be expensive and if it is frequently used the user should consider using std::list. The user is also cautioned that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

template<class _Tp >
reference inaccel::vector< _Tp >::front ( )
inline

Returns a read/write reference to the data at the first element of the vector.

template<class _Tp >
const_reference inaccel::vector< _Tp >::front ( ) const
inline

Returns a read-only (constant) reference to the data at the first element of the vector.

template<class _Tp >
void inaccel::vector< _Tp >::insert ( iterator  __position,
size_type  __n,
const value_type __x 
)
inline

Inserts a number of copies of given data into the vector.

Parameters
__positionAn iterator into the vector.
__nNumber of elements to be inserted.
__xData to be inserted.

This function will insert a specified number of copies of the given data before the location specified by position.

Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

template<class _Tp >
template<typename _InputIterator >
void inaccel::vector< _Tp >::insert ( iterator  __position,
_InputIterator  __first,
_InputIterator  __last 
)
inline

Inserts a range into the vector.

Parameters
__positionAn iterator into the vector.
__firstAn input iterator.
__lastAn input iterator.

This function will insert copies of the data in the range [__first,__last) into the vector before the location specified by pos.

Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list.

template<class _Tp >
bool inaccel::vector< _Tp >::is_dirty ( )
inline
template<class _Tp >
bool inaccel::vector< _Tp >::is_dirty ( ) const
inline
template<class _Tp >
bool inaccel::vector< _Tp >::is_fundamental ( )
inline
template<class _Tp >
vector& inaccel::vector< _Tp >::operator= ( const vector< _Tp > &  __x)
inline

Vector assignment operator.

Parameters
__xA vector of identical element types.

All the elements of __x are copied, but any unused capacity in __x will not be copied.

template<class _Tp >
reverse_iterator inaccel::vector< _Tp >::rbegin ( )
inline

Returns a read/write reverse iterator that points to the last element in the vector.

Iteration is done in reverse element order.

template<class _Tp >
const_reverse_iterator inaccel::vector< _Tp >::rbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the vector.

Iteration is done in reverse element order.

template<class _Tp >
reverse_iterator inaccel::vector< _Tp >::rend ( )
inline

Returns a read/write reverse iterator that points to one before the first element in the vector.

Iteration is done in reverse element order.

template<class _Tp >
const_reverse_iterator inaccel::vector< _Tp >::rend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element in the vector.

Iteration is done in reverse element order.

template<class _Tp >
void inaccel::vector< _Tp >::resize ( size_type  __new_size,
value_type  __x = value_type() 
)
inline

Resizes the vector to the specified number of elements.

Parameters
__new_sizeNumber of elements the vector should contain.
__xData with which new elements should be populated.

This function will resize the vector to the specified number of elements. If the number is smaller than the vector's current size the vector is truncated, otherwise the vector is extended and new elements are populated with given data.

template<class _Tp >
vector& inaccel::vector< _Tp >::set_dirty ( )
inline
template<class _Tp >
const vector& inaccel::vector< _Tp >::set_dirty ( ) const
inline
template<class _Tp >
void inaccel::vector< _Tp >::swap ( vector< _Tp > &  __x)
inline

Swaps data with another vector.

Parameters
__xA vector of the same element types.

This exchanges the elements between two vectors in constant time. (Three pointers, so it should be quite fast.) Note that the global std::swap() function is specialized such that std::swap(v1,v2) will feed to this function.

template<class _Tp >
vector& inaccel::vector< _Tp >::unset_dirty ( )
inline
template<class _Tp >
const vector& inaccel::vector< _Tp >::unset_dirty ( ) const
inline