|
| VectorOf ()=default |
|
| VectorOf (size_t size) |
|
| VectorOf (std::initializer_list< T > values) |
| Initializer list constructor.
|
|
| VectorOf (size_t s, const T &def) |
| Build a vector and initialize it with def.
|
|
| VectorOf (size_t s, const T *p) |
| Builds a vector and initialize it with values from 'p'.
|
|
| VectorOf (const VectorOf &r)=default |
|
VectorOf< T > & | operator= (const VectorOf< T > &r)=default |
|
| VectorOf (VectorOf< T > &&other) noexcept=default |
|
VectorOf & | operator= (VectorOf< T > &&other) noexcept=default |
|
| ~VectorOf () override=default |
|
size_t | getElementSize () const override |
|
int | getBottleTag () const override |
|
size_t | getListSize () const override |
|
const char * | getMemoryBlock () const override |
|
char * | getMemoryBlock () override |
|
const T * | getFirst () const |
|
T * | getFirst () |
|
T * | data () |
| Return a pointer to the first element of the vector.
|
|
const T * | data () const |
| Return a pointer to the first element of the vector, const version.
|
|
void | resize (size_t size) override |
| Resize the vector.
|
|
void | resize (size_t size, const T &def) |
| Resize the vector and initilize the element to a default value.
|
|
void | reserve (size_t size) |
| reserve, increase the capacity of the vector to a value that's greater or equal to size.
|
|
void | push_back (const T &elem) |
| Push a new element in the vector: size is changed.
|
|
void | push_back (T &&elem) |
| Move a new element in the vector: size is changed.
|
|
template<typename... _Args> |
T & | emplace_back (_Args &&... args) |
| Construct a new element in the vector: size is changed.
|
|
void | pop_back () |
| Pop an element out of the vector: size is changed.
|
|
T & | operator[] (size_t i) |
| Single element access, no range check.
|
|
const T & | operator[] (size_t i) const |
| Single element access, no range check, const version.
|
|
T & | operator() (size_t i) |
| Single element access, no range check.
|
|
const T & | operator() (size_t i) const |
| Single element access, no range check, const version.
|
|
size_t | size () const |
|
size_t | length () const |
| Get the length of the vector.
|
|
size_t | capacity () const |
| capacity
|
|
void | zero () |
| Zero the elements of the vector.
|
|
std::string | toString (int precision=-1, int width=-1) const |
| Creates a string object containing a text representation of the object.
|
|
VectorOf< T > | 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.
|
|
bool | setSubvector (int position, const VectorOf< T > &v) |
| Set a portion of this vector with the values of the specified vector.
|
|
const VectorOf< T > & | operator= (T v) |
| Set all elements of the vector to a scalar.
|
|
bool | operator== (const VectorOf< T > &r) const |
| True iff all elements of 'a' match all element of 'b'.
|
|
iterator | begin () noexcept |
| Returns an iterator to the beginning of the VectorOf.
|
|
iterator | end () noexcept |
| Returns an iterator to the end of the VectorOf.
|
|
const_iterator | begin () const noexcept |
| Returns a const iterator to the beginning of the VectorOf.
|
|
const_iterator | end () const noexcept |
| Returns a const iterator to the end of the VectorOf.
|
|
const_iterator | cbegin () const noexcept |
| Returns a const iterator to the beginning of the VectorOf.
|
|
const_iterator | cend () const noexcept |
| Returns a const iterator to the end of the VectorOf.
|
|
void | clear () |
|
yarp::os::Type | getType () const override |
|
bool | read (yarp::os::ConnectionReader &connection) override |
| Read this object from a network connection.
|
|
bool | write (yarp::os::ConnectionWriter &connection) const override |
| Write vector to a connection.
|
|
virtual | ~PortReader () |
| Destructor.
|
|
virtual Type | getReadType () const |
|
virtual | ~PortWriter () |
| Destructor.
|
|
virtual void | onCompletion () const |
| This is called when the port has finished all writing operations.
|
|
virtual void | onCommencement () const |
| This is called when the port is about to begin writing operations.
|
|
virtual yarp::os::Type | getWriteType () const |
|
template<class T>
class yarp::sig::VectorOf< T >
Provides:
- 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 size() to get the current size of the Vector
- use operator= to copy Vectors
- read/write network methods Warning: the class is designed to work with simple types (i.e. types that do not allocate internal memory). Template instantiation needs to be checked to avoid unresolved externals. Network communication assumes same data representation (endianness) between machines.
- Examples
- dev/grabber_crop/grabber_crop.cpp.
Definition at line 116 of file Vector.h.