class
RefThe 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::
Base classes
-
template<typename T>class BipedalLocomotion::GenericContainer::Vector<T>
- Forward declaration of Vector class.
Constructors, destructors, conversion operators
- Ref() deleted
- A reference cannot exist on its own.
-
Ref(BipedalLocomotion::
GenericContainer:: Vector<T>::Ref& other) - Copy constructor.
-
Ref(BipedalLocomotion::
GenericContainer:: Vector<T>::Ref&& other) - Move constructor.
-
Ref(BipedalLocomotion::
GenericContainer:: Vector<T>& other) - Constructor from a GenericContainer::Vector<T>&.
-
Ref(BipedalLocomotion::
GenericContainer:: Vector<T>&& other) - Constructor from a GenericContainer::Vector<T>&.
-
template<class Vector, typename = typename std::enable_if<!GenericContainer::Ref(Vector& input)
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> - Constructor from another container.
-
template<class Vector, typename = typename std::enable_if<!GenericContainer::Ref(const Vector& input)
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> - Constructor from another container.
- ~Ref() defaulted
- Default constructor.
Public functions
Function documentation
BipedalLocomotion:: GenericContainer:: Vector:: Ref:: Ref(BipedalLocomotion:: GenericContainer:: Vector<T>::Ref& other)
Copy constructor.
Parameters | |
---|---|
other | The ref from which to copy the context. |
BipedalLocomotion:: GenericContainer:: Vector:: Ref:: Ref(BipedalLocomotion:: GenericContainer:: Vector<T>::Ref&& other)
Move constructor.
Parameters | |
---|---|
other | The ref from which to get the context. |
BipedalLocomotion:: GenericContainer:: Vector:: Ref:: Ref(BipedalLocomotion:: GenericContainer:: Vector<T>& other)
Constructor from a GenericContainer::Vector<T>&.
Parameters | |
---|---|
other | The input vector from which the context is copied |
BipedalLocomotion:: GenericContainer:: Vector:: Ref:: Ref(BipedalLocomotion:: GenericContainer:: Vector<T>&& other)
Constructor from a GenericContainer::Vector<T>&.
Parameters | |
---|---|
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. |
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>
BipedalLocomotion:: GenericContainer:: Vector:: Ref:: Ref(Vector& input)
Constructor from another container.
This is used if:
- the input container is not a GenericContainer::
Vector, to avoid ambiguities with other constructors - the input container is not a string. This allows using Ref and string with overloaded methods.
- a GenericContainer::Vector<T>::Ref can be constructed from the Container
- T is not const
- the input container is not const.
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>
BipedalLocomotion:: GenericContainer:: Vector:: Ref:: Ref(const Vector& input)
Constructor from another container.
This is used if:
- the input container is not a GenericContainer::
Vector, to avoid ambiguities with other constructors - the input container is not a string. This allows using Ref and string with overloaded methods.
- a GenericContainer::Vector<T>::Ref can be constructed from the Container
- T is const.