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 VectorImpl & | operator= (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:
- push_back(), pop_back() to add/remove an element at the end of the vector
- resize(), to create an array of elements
- clear(), to clean the array (remove all elements)
- use [] to access single elements without range checking
- use set()/get() to access single elements with range checking
- use size() to get the current size of the Vector
- use operator= to copy Vectors
Definition at line 86 of file Vector.h.
Constructor & Destructor Documentation
Create a Vector object of a given size and fill the content.
- Parameters:
-
| size | is the number of elements of the vector. |
Member Function Documentation
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.
Resize a Vector placing def at each index.
- Parameters:
-
| size | is the size of the vector. |
| def | is the initial value of the vector. |
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.
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.
Push an element at the back of the array.
- Parameters:
-
| elem | a reference to the object to be added. |
Remove an element at the end of the vector.
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.
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.
Clears out the vector, it does not reallocate the buffer, but just sets the dynamic size to 0.
Friends And Related Function Documentation
Be friendly with your iterator.
Definition at line 180 of file Vector.h.
The documentation for this class was generated from the following file: