Public Member Functions | Friends

yarp::sig::impl::VectorImpl< T > Class Template Reference
[Signal Processing]

A simple Vector class derived from ACE and with Portable functionality. More...

#include <Vector.h>

Inheritance diagram for yarp::sig::impl::VectorImpl< T >:
yarp::sig::VectorOf< T >

Public Member Functions

 VectorImpl ()
 Default constructor.
 ~VectorImpl ()
 Destructor.
 VectorImpl (size_t size)
 Create a Vector object of a given size and fill the content.
 VectorImpl (const VectorImpl &l)
const VectorImploperator= (const VectorImpl &l)
 Copies a Vector object into the current one.
const T & operator= (const T &v)
void resize (size_t size, const T &def)
 Resize a Vector placing def at each index.
T & operator[] (int el)
 Access the el-th element of the vector, no range check.
const T & operator[] (int el) const
 Access the el-th element of the vector, const version, no range check.
int size () const
 Return the size of the array (number of elements).
void push_back (const T &elem)
 Push an element at the back of the array.
void pop_back (void)
 Remove an element at the end of the vector.
int set (T const &new_item, size_t slot)
 Set the value of the "slot" element, range check.
int get (T &item, size_t slot) const
 Get the value of the "slot" element, range check.
void clear ()
 Clears out the vector, it does not reallocate the buffer, but just sets the dynamic size to 0.

Friends

class yarp::sig::impl::IteratorOf< T >
 Be friendly with your iterator.

Detailed Description

template<class T>
class yarp::sig::impl::VectorImpl< T >

A simple Vector class derived from ACE and with Portable functionality.

Things you can do on Vector:

Definition at line 86 of file Vector.h.


Constructor & Destructor Documentation

template<class T>
yarp::sig::impl::VectorImpl< T >::VectorImpl (  ) 

Default constructor.

template<class T>
yarp::sig::impl::VectorImpl< T >::~VectorImpl (  ) 

Destructor.

template<class T>
yarp::sig::impl::VectorImpl< T >::VectorImpl ( size_t  size  ) 

Create a Vector object of a given size and fill the content.

Parameters:
size is the number of elements of the vector.
template<class T>
yarp::sig::impl::VectorImpl< T >::VectorImpl ( const VectorImpl< T > &  l  ) 

Member Function Documentation

template<class T>
const VectorImpl& yarp::sig::impl::VectorImpl< T >::operator= ( const VectorImpl< T > &  l  ) 

Copies a Vector object into the current one.

Parameters:
l is a reference to an object of type Vector.
Returns:
a reference to the current object.
template<class T>
const T& yarp::sig::impl::VectorImpl< T >::operator= ( const T &  v  ) 
template<class T>
void yarp::sig::impl::VectorImpl< T >::resize ( size_t  size,
const T &  def 
)

Resize a Vector placing def at each index.

Parameters:
size is the size of the vector.
def is the initial value of the vector.
template<class T>
T& yarp::sig::impl::VectorImpl< T >::operator[] ( int  el  ) 

Access the el-th element of the vector, no range check.

Parameters:
el index of the element to be accessed.
Returns:
a reference to the requested element.
template<class T>
const T& yarp::sig::impl::VectorImpl< T >::operator[] ( int  el  )  const

Access the el-th element of the vector, const version, no range check.

Parameters:
el index of the element to be accessed.
Returns:
a reference to the requested element.
template<class T>
int yarp::sig::impl::VectorImpl< T >::size (  )  const

Return the size of the array (number of elements).

Returns:
the current size of the array.

Referenced by yarp::sig::VectorOf< double >::getListSize().

template<class T>
void yarp::sig::impl::VectorImpl< T >::push_back ( const T &  elem  ) 

Push an element at the back of the array.

Parameters:
elem a reference to the object to be added.
template<class T>
void yarp::sig::impl::VectorImpl< T >::pop_back ( void   ) 

Remove an element at the end of the vector.

template<class T>
int yarp::sig::impl::VectorImpl< T >::set ( T const &  new_item,
size_t  slot 
)

Set the value of the "slot" element, range check.

Parameters:
new_item a reference of the new element to set
slot the position in which the new element should be set
Returns:
true/false on success/failure.
template<class T>
int yarp::sig::impl::VectorImpl< T >::get ( T &  item,
size_t  slot 
) const

Get the value of the "slot" element, range check.

Parameters:
item return value
slot the position of the element to get
Returns:
true/false on success/failure.
template<class T>
void yarp::sig::impl::VectorImpl< T >::clear (  ) 

Clears out the vector, it does not reallocate the buffer, but just sets the dynamic size to 0.


Friends And Related Function Documentation

template<class T>
friend class yarp::sig::impl::IteratorOf< T > [friend]

Be friendly with your iterator.

Definition at line 180 of file Vector.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines