#include <yarp/sig/VectorBase.h>
Inheritance diagram for yarp::sig::VectorBase< Derived, Scalar >:Public Types | |
| using | value_type = Scalar |
| using | iterator = typename std::vector< Scalar >::iterator |
| using | const_iterator = typename std::vector< Scalar >::const_iterator |
Public Member Functions | |
| VectorBase ()=default | |
| VectorBase (size_t size) | |
| VectorBase (std::initializer_list< Scalar > values) | |
| Initializer list constructor. | |
| VectorBase (size_t s, const Scalar &def) | |
| Build a vector and initialize it with def. | |
| VectorBase (size_t s, const Scalar *p) | |
| Builds a vector and initialize it with values from 'p'. | |
| VectorBase (const VectorBase &r)=default | |
| VectorBase< Derived, Scalar > & | operator= (const VectorBase< Derived, Scalar > &r)=default |
| VectorBase (VectorBase< Derived, Scalar > &&other) noexcept=default | |
| VectorBase & | operator= (VectorBase< Derived, Scalar > &&other) noexcept=default |
| ~VectorBase ()=default | |
| size_t | capacity () const |
| Returns the capacity of the vector. | |
| void | reserve (size_t size) |
| Reserve space in the vector. | |
| void | resize (size_t size) |
| Resize the vector. | |
| void | pop_back () |
| Pop an element out of the vector: size is changed. | |
| Scalar & | operator[] (size_t i) |
| Single element access, no range check. | |
| const Scalar & | operator[] (size_t i) const |
| Single element access, no range check, const version. | |
| Scalar & | operator() (size_t i) |
| Single element access, no range check. | |
| const Scalar & | operator() (size_t i) const |
| Single element access, no range check, const version. | |
| size_t | size () const |
| Returns the number of elements in the vector. | |
| Derived & | operator= (const Scalar &val) |
| Derived & | operator= (std::initializer_list< Scalar > values) |
| Initializer list assignment. | |
| void | clear () |
| Clear (removes all elements) the vector. | |
| void | push_back (const Scalar &elem) |
| Push a new element in the vector: size is changed. | |
| void | push_back (Scalar &&elem) |
| Move a new element in the vector: size is changed. | |
| Scalar * | data () |
| Return a pointer to the first element of the vector. | |
| const Scalar * | data () const |
| Return a pointer to the first element of the vector, const version. | |
| Derived | subVector (unsigned int first, unsigned int last) const |
| Creates and returns a new vector, being the portion of the original vector defined by the first and last indexes of the items to be included in the subvector. | |
| void | resize (size_t size, const Scalar &def) |
| Resize the vector and initialize the element to a default value. | |
| void | zero () |
| Set to zero the elements of the vector. | |
| iterator | begin () noexcept |
| Returns an iterator to the beginning of the Vector. | |
| iterator | end () noexcept |
| const_iterator | begin () const noexcept |
| const_iterator | end () const noexcept |
| const_iterator | cbegin () const noexcept |
| void | erase (iterator pos) |
| Remove an element from the vector. | |
| void | erase (iterator first, iterator last) |
| Remove one or more elements from the vector. | |
| size_t | getElementSize () const |
Friends | |
| bool | operator== (const Derived &l, const Derived &r) |
Definition at line 25 of file VectorBase.h.
| using yarp::sig::VectorBase< Derived, Scalar >::const_iterator = typename std::vector<Scalar>::const_iterator |
Definition at line 31 of file VectorBase.h.
| using yarp::sig::VectorBase< Derived, Scalar >::iterator = typename std::vector<Scalar>::iterator |
Definition at line 30 of file VectorBase.h.
| using yarp::sig::VectorBase< Derived, Scalar >::value_type = Scalar |
Definition at line 29 of file VectorBase.h.
|
default |
|
inline |
Definition at line 35 of file VectorBase.h.
|
inline |
Initializer list constructor.
| [in] | values,list | of values with which initialize the Vector. |
Definition at line 45 of file VectorBase.h.
|
inline |
Build a vector and initialize it with def.
| s | the size |
| def | a default value used to fill the vector |
Definition at line 57 of file VectorBase.h.
|
inline |
Builds a vector and initialize it with values from 'p'.
Copies memory.
| s | the size of the data to be copied |
| T* | the pointer to the data |
Definition at line 68 of file VectorBase.h.
|
default |
|
defaultnoexcept |
|
default |
|
inlinenoexcept |
Definition at line 317 of file VectorBase.h.
|
inlinenoexcept |
Returns an iterator to the beginning of the Vector.
Definition at line 305 of file VectorBase.h.
|
inline |
Returns the capacity of the vector.
Definition at line 86 of file VectorBase.h.
|
inlinenoexcept |
Definition at line 329 of file VectorBase.h.
|
inline |
Clear (removes all elements) the vector.
Definition at line 216 of file VectorBase.h.
|
inline |
Return a pointer to the first element of the vector.
Definition at line 245 of file VectorBase.h.
|
inline |
Return a pointer to the first element of the vector, const version.
Definition at line 256 of file VectorBase.h.
|
inlinenoexcept |
Definition at line 323 of file VectorBase.h.
|
inlinenoexcept |
Definition at line 311 of file VectorBase.h.
|
inline |
Remove one or more elements from the vector.
| first | iterator pointing at the first element to remove |
| last | iterator pointing at the last element to remove |
Definition at line 350 of file VectorBase.h.
|
inline |
Remove an element from the vector.
| pos | iterator pointing at the element to remove |
Definition at line 339 of file VectorBase.h.
|
inline |
Definition at line 356 of file VectorBase.h.
|
inline |
Single element access, no range check.
| i | the index of the element to access. |
Definition at line 147 of file VectorBase.h.
|
inline |
Single element access, no range check, const version.
| i | the index of the element to access. |
Definition at line 158 of file VectorBase.h.
|
inline |
Definition at line 173 of file VectorBase.h.
|
default |
|
inline |
Initializer list assignment.
| [in] | values,list | of values with which to assign the Vector. |
Definition at line 186 of file VectorBase.h.
|
defaultnoexcept |
|
inline |
Single element access, no range check.
| i | the index of the element to access. |
Definition at line 125 of file VectorBase.h.
|
inline |
Single element access, no range check, const version.
| i | the index of the element to access. |
Definition at line 136 of file VectorBase.h.
|
inline |
Pop an element out of the vector: size is changed.
Definition at line 114 of file VectorBase.h.
|
inline |
Push a new element in the vector: size is changed.
Definition at line 225 of file VectorBase.h.
|
inline |
Move a new element in the vector: size is changed.
| elem,element | to be moved. |
Definition at line 235 of file VectorBase.h.
|
inline |
Reserve space in the vector.
| size | the new capacity of the vector. |
Definition at line 96 of file VectorBase.h.
|
inline |
Resize the vector.
| size | the new size of the vector. |
Definition at line 106 of file VectorBase.h.
|
inline |
Resize the vector and initialize the element to a default value.
| s | the new size |
| def | the default value |
Definition at line 286 of file VectorBase.h.
|
inline |
Returns the number of elements in the vector.
Definition at line 167 of file VectorBase.h.
|
inline |
Creates and returns a new vector, being the portion of the original vector defined by the first and last indexes of the items to be included in the subvector.
The indexes are checked: if wrong, a null vector is returned.
Definition at line 268 of file VectorBase.h.
|
inline |
Set to zero the elements of the vector.
Definition at line 296 of file VectorBase.h.
|
friend |
Definition at line 204 of file VectorBase.h.