Template Class Vector

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class uconfig::Vector : public uconfig::Variable<std::vector<T>>

Vector object.

tparam T

Type to form vector of.

Public Types

template<typename F>
using iface_type = VectorIface<T, F>

Public Functions

Vector(bool optional = false)

Constructor.

Parameters

[in] optional – If vector considered to be optional (may be not initialized). Default false.

Vector(std::vector<T> &&init_value)

Constructor.

Vector(const std::vector<T> &init_value)

Constructor.

Vector(const Vector<T>&) = default

Copy constructor.

Vector<T> &operator=(const Vector<T>&) = default

Copy assignment.

Vector(Vector<T> &&other) noexcept = default

Move constructor.

Vector<T> &operator=(Vector<T> &&other) noexcept = default

Move assignment.

Vector<T> &operator=(std::vector<T> &&vector) noexcept

Move assignment from std::vector<T>.

virtual ~Vector() = default

Destructor.

T &operator[](std::size_t pos)

Get the value from underlying vector.

Parameters

[in] pos – Position to get value at.

Throws

uconfig::Error – Thrown if vector has no value.

Returns

A reference to the value at pos.

const T &operator[](std::size_t pos) const

Get the value from underlying vector.

Parameters

[in] pos – Position to get value at.

Throws

uconfig::Error – Thrown if vector has no value.

Returns

A const reference to the value at pos.

Friends

friend class VectorIface