|
bipedal locomotion framework
A suite of libraries for achieving bipedal locomotion on humanoid robots
|
The class ref is used a substitution to a classical reference to a Vector. More...
#include <GenericContainer/include/BipedalLocomotion/GenericContainer/Vector.h>
Public Member Functions | |
| Ref ()=delete | |
| A reference cannot exist on its own. | |
| Ref (BipedalLocomotion::GenericContainer::Vector< T >::Ref &other) | |
| Copy constructor. More... | |
| Ref (BipedalLocomotion::GenericContainer::Vector< T >::Ref &&other) | |
| Move constructor. More... | |
| Ref (BipedalLocomotion::GenericContainer::Vector< T > &other) | |
| Constructor from a GenericContainer::Vector<T>&. More... | |
| Ref (BipedalLocomotion::GenericContainer::Vector< T > &&other) | |
| Constructor from a GenericContainer::Vector<T>&. More... | |
| template<class Vector , typename = typename std::enable_if<!GenericContainer::is_vector<Vector>::value && !std::is_same<Vector, std::string>::value && GenericContainer::is_vector_ref_constructible<T,Vector>::value && !std::is_const_v<T> && !is_container_const<Vector>::value>::type> | |
| Ref (Vector &input) | |
| Constructor from another container. More... | |
| template<class Vector , typename = typename std::enable_if<!GenericContainer::is_vector<Vector>::value && !std::is_same<Vector, std::string>::value && GenericContainer::is_vector_ref_constructible<T,Vector>::value && std::is_const_v<T>>::type> | |
| Ref (const Vector &input) | |
| Constructor from another container. More... | |
| ~Ref ()=default | |
| Default constructor. | |
| Ref | operator= (const Ref &other) |
| Copy operator. More... | |
| Ref | operator= (Ref &&other) |
| Copy operator. More... | |
Public Member Functions inherited from BipedalLocomotion::GenericContainer::Vector< T > | |
| Vector (iDynTree::Span< T > span, resize_function_type resizeLambda) | |
| Constructor. More... | |
| Vector (iDynTree::Span< T > span) | |
| Constructor. More... | |
| ~Vector ()=default | |
| Destructor. | |
| Vector (const Vector< T > &other)=delete | |
| Copy constructor. More... | |
| Vector (Vector< T > &&other) | |
| Move constructor. More... | |
| bool | clone (const Vector< T > &other) |
| Copies the content of the vector. More... | |
| bool | clone (iDynTree::Span< T > other) |
| Copies the content of the vector. More... | |
| Vector< T > & | operator= (const Vector< T > &other) |
| operator = Copies the content More... | |
| Vector< T > & | operator= (iDynTree::Span< T > other) |
| operator = Copies the content More... | |
| Vector< T > & | operator= (Vector< T > &&other) |
| Move operator = Copies the content. More... | |
| bool | resizeVector (index_type newSize) |
| resizeVector It resize the original vector (if possible) More... | |
| void | resize (index_type newSize) |
| resize It resize the original vector (if possible) More... | |
| index_type | size () const |
| size Get the size of the Vector More... | |
| bool | empty () const |
| empty Checks if the container is empty (zero size) More... | |
| const_reference | operator[] (index_type idx) const |
| operator [] Accessor More... | |
| reference | operator[] (index_type idx) |
| operator [] Accessor More... | |
| vector_element_type | getVal (index_type idx) const |
| getVal Accessor More... | |
| bool | setVal (index_type idx, vector_element_type val) |
| setVal Setter More... | |
| const_reference | at (index_type idx) const |
| at Accessor More... | |
| reference | at (index_type idx) |
| at Accessor More... | |
| const_reference | operator() (index_type idx) const |
| operator () Accessor More... | |
| reference | operator() (index_type idx) |
| operator () Accessor More... | |
| pointer | data () const |
| data Raw pointer to the data More... | |
| iterator | begin () |
| begin Iterator More... | |
| iterator | end () |
| end Iterator More... | |
| const_iterator | begin () const |
| begin Iterator More... | |
| const_iterator | end () const |
| end Iterator More... | |
| const_iterator | cbegin () const |
| cbegin Iterator More... | |
| const_iterator | cend () const |
| cend Iterator More... | |
| reverse_iterator | rbegin () |
| rbegin Iterator to the first element of the reversed vector More... | |
| reverse_iterator | rend () |
| rend Iterator to the element following the last element of the reversed vector. More... | |
| const_reverse_iterator | rbegin () const |
| rbegin Iterator to the first element of the reversed vector More... | |
| const_reverse_iterator | rend () const |
| rend Iterator to the element following the last element of the reversed vector. More... | |
| const_reverse_iterator | crbegin () const |
| crbegin Iterator to the first element of the reversed vector More... | |
| const_reverse_iterator | crend () const |
| crend Iterator to the element following the last element of the reversed vector. More... | |
| eigen_map_type | toEigen () |
| Get an Eigen map corresponding to the current generic vector (see https://eigen.tuxfamily.org/dox/classEigen_1_1Map.html). | |
| eigen_map_const_type | toEigen () const |
| Get an Eigen const map corresponding to the current generic vector (see https://eigen.tuxfamily.org/dox/classEigen_1_1Map.html). | |
Additional Inherited Members | |
Public Types inherited from BipedalLocomotion::GenericContainer::Vector< T > | |
| using | vector_element_type = typename iDynTree::Span< T >::element_type |
| Utility aliases depending on the type T. More... | |
| using | value_type = typename iDynTree::Span< T >::value_type |
| using | index_type = typename iDynTree::Span< T >::index_type |
| using | pointer = typename iDynTree::Span< T >::pointer |
| using | reference = typename iDynTree::Span< T >::reference |
| using | const_reference = const value_type & |
| using | size_type = typename iDynTree::Span< T >::size_type |
| using | iterator = typename iDynTree::Span< T >::iterator |
| Utility aliases to define iterators. | |
| using | const_iterator = typename iDynTree::Span< T >::const_iterator |
| using | reverse_iterator = typename iDynTree::Span< T >::reverse_iterator |
| using | const_reverse_iterator = typename iDynTree::Span< T >::const_reverse_iterator |
| using | resize_function_type = std::function< iDynTree::Span< T >(index_type)> |
| Alias for the type of lambda used to resize the original vector. More... | |
| using | eigen_map_type = typename Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 > > |
| Alias to determine the output type of toEigen() | |
| using | eigen_map_const_type = typename Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 > > |
Protected Member Functions inherited from BipedalLocomotion::GenericContainer::Vector< T > | |
| Vector ()=default | |
| The default constructor is private. More... | |
Protected Attributes inherited from BipedalLocomotion::GenericContainer::Vector< T > | |
| iDynTree::Span< T > | m_span |
| Span of the pointed vector. More... | |
| resize_function_type | m_resizeLambda |
| User specified lambda to resize the existing container. | |
The class ref is used a substitution to a classical reference to a Vector.
The advantage of using this, is that custom vectors (all those supported by GenericContainer::Vector) can be implicitly casted to Ref. Ref does not allocate any memory in construction, hence can be used as a parameter to be passed by copy. The = operator clones the content. Ref inherits Vector<T>, hence it can be used as it was a Vector<T>.
|
inline |
Copy constructor.
| other | The ref from which to copy the context. |
|
inline |
Move constructor.
| other | The ref from which to get the context. |
|
inline |
Constructor from a GenericContainer::Vector<T>&.
| other | The input vector from which the context is copied |
|
inline |
Constructor from a GenericContainer::Vector<T>&.
| other | The input vector from which the context is taken In principle, Ref should be the reference of a Vector<T> which should remain alive while Ref is alive. On the other hand, Vector<T> is only a pointer to some data which does not own. Hence, Ref can remain alive even if the Vector<T> is deleted, provided that the original container stays alive. |
|
inline |
Constructor from another container.
This is used if:
|
inline |
Constructor from another container.
This is used if:
|
inline |
Copy operator.
| other | The other Ref, from which the data is copied |
|
inline |
Copy operator.
| other | The other Ref, from which the data is copied |