Template Class VectorIface

Inheritance Relationships

Base Type

Class Documentation

template<typename T, typename Format>
class uconfig::VectorIface : public uconfig::Interface<Format>

Interface for uconfig::Vector objects.

tparam T

Type of Vector elements.

tparam Format

Format this interface interacts with.

Public Functions

VectorIface(const std::string &vector_path, Vector<T> *vector)

Constructor.

Note

Does not own vector, should not outlive it.

Parameters
  • [in] vector_path – Path to the vector in terms of Format.

  • [in] vector – Pointer to the uconfig::Vector to wrap.

VectorIface(const VectorIface<T, Format>&) = default

Copy constructor.

VectorIface<T, Format> &operator=(const VectorIface<T, Format>&) = default

Copy assignment.

VectorIface(VectorIface<T, Format>&&) noexcept = default

Move constructor.

VectorIface<T, Format> &operator=(VectorIface<T, Format>&&) noexcept = default

Move assignment.

virtual ~VectorIface() = default

Destructor.

virtual bool Parse(const format_type &parser, const source_type *source, bool throw_on_fail = true) override

Parse referenced uconfig::Vector from source using parser.

Parameters
  • [in] parser – Parser instance to use.

  • [in] source – Source to parse from.

  • [in] throw_on_fail – Will throw an uconfig::ParseError is failed to parse. Default true.

Throws

uconfig::ParseError – Thrown if throw_on_fail.

Returns

true if vector has been parsed, false otherwise.

virtual void Emit(const format_type &emitter, dest_type *dest, bool throw_on_fail = true) override

Emit referenced uconfig::Vector to destination using emitter.

Parameters
  • [in] emitter – Emitter instance to use.

  • [in] dest – Destination to emit into.

  • [in] throw_on_fail – Will throw an uconfig::EmitError is failed to emit. Default true.

Throws

uconfig::EmitError – Thrown if throw_on_fail.

virtual const std::string &Path() const noexcept override

Get path of the wrapped uconfig::Vector.

virtual bool Initialized() const noexcept override

Check if wrapped uconfig::Vector has all mandatory values set.

virtual bool Optional() const noexcept override

Check if wrapped uconfig::Vector declared as optional.