Template Class FixedSizeVariable

Inheritance Relationships

Base Type

  • public fuse_core::Variable

Class Documentation

template<size_t N>
class FixedSizeVariable : public fuse_core::Variable

A Variable base class for fixed-sized variables.

The FixedSizeVariable class implements a statically sized array to hold the scalar values. The size of the variable is provided as the template argument N when creating a derived class. The FixedSizeVariable class implements the Variable::data() accessor methods, and provides access to the scalar values as a std::array. This allows easier manipulation in C++ (iterators, range-based for loops, etc.). The FixedSizeVariable class is designed for variables where the size of the state vector is known at compile time…which should be almost all variable types. The dimension of typical variable types (points, poses, calibration parameters) are all known at design/compile time.

Public Functions

FixedSizeVariable() = default

Default constructor.

inline explicit FixedSizeVariable(const fuse_core::UUID &uuid)

Constructor.

virtual ~FixedSizeVariable() = default

Destructor.

inline size_t size() const override

Returns the number of elements of this variable.

The number of scalar values contained by this variable type is defined by the class template parameter N.

inline const double *data() const override

Read-only access to the variable data.

inline double *data() override

Read-write access to the variable data.

inline const std::array<double, N> &array() const

Read-only access to the variable data as a std::array.

inline std::array<double, N> &array()

Read-write access to the variable data as a std::array.

Public Static Attributes

static constexpr size_t SIZE = N

A static version of the variable size.

Protected Functions

template<class Archive>
inline void serialize(Archive &archive, const unsigned int)

The Boost Serialize method that serializes all of the data members in to/out of the archive.

Parameters:
  • [in/out] – archive - The archive object that holds the serialized class members

  • version[in] - The version of the archive being read/written. Generally unused.

Protected Attributes

std::array<double, N> data_

Fixed-sized, contiguous memory for holding the variable data members

Friends

friend class boost::serialization::access