Template Struct LayerView

Inheritance Relationships

Base Type

Struct Documentation

template<typename T>
struct LayerView : public navmap::LayerViewBase

Typed layer view storing one T value per NavCel.

Note

Elements are indexed by navmap::NavCelId.

Template Parameters:

T – Scalar type (uint8_t, float, double).

Element access (indexed by NavCelId).

inline T &operator[](NavCelId cid)
inline const T &operator[](NavCelId cid) const

Layer hashing & access

inline std::vector<T> &mutable_data() const
inline void set_data(const std::vector<T> &v)
virtual std::uint64_t content_hash() const override

Return 64-bit content hash (cached; recomputed lazily).

Public Functions

inline LayerView(std::string name, size_t nitems, LayerType t)

Construct a typed view.

Parameters:
  • name – Layer name.

  • nitems – Number of NavCels.

  • t – Runtime type tag corresponding to T.

inline virtual LayerType type() const override
Returns:

Type tag of the underlying storage.

inline virtual const std::string &name() const override
Returns:

Layer name (unique within the registry).

inline virtual size_t size() const override
Returns:

Number of items (= number of NavCels).

inline std::vector<T> &data()
Returns:

Mutable reference to internal storage.

inline const std::vector<T> &data() const
Returns:

Const reference to internal storage.

Public Members

std::string name_

Layer name (key in the registry)

std::vector<T> data_

Values, one per NavCel.

LayerType type_

Runtime type tag (must match T)