Typed layer view storing one T value per NavCel.
More...
#include <NavMap.hpp>
|
| std::vector< T > & | data () |
| const std::vector< T > & | data () const |
| | LayerView (std::string name, size_t nitems, LayerType t) |
| | Construct a typed view.
|
| const std::string & | name () const override |
| size_t | size () const override |
| LayerType | type () const override |
| T & | operator[] (NavCelId cid) |
| const T & | operator[] (NavCelId cid) const |
| std::vector< T > & | mutable_data () const |
| void | set_data (const std::vector< T > &v) |
| std::uint64_t | content_hash () const override |
| | Return 64-bit content hash (cached; recomputed lazily).
|
| std::shared_ptr< LayerViewBase > | clone () const override |
| | Independent copy of this layer (data, name, type, cached hash and pending changes).
|
| bool | all_changed () const noexcept |
| | Whether the whole layer changed (then changed() is not meaningful).
|
| const std::vector< NavCelId > & | changed () const noexcept |
| | Cells changed one by one since the last clear_changes(), in order of first change.
|
| void | clear_changes () const |
| | Forget the recorded changes (call it once every consumer has seen them).
|
| bool | has_changes () const noexcept |
| void | mark_all_changed () const noexcept |
| | Record that the whole layer changed.
|
| void | mark_changed (NavCelId cid) const |
| | Record that cell cid changed (deduplicated).
|
| void | mark_dirty () const noexcept |
| | Mark content dirty (forces hash recompute on next query).
|
| virtual | ~LayerViewBase ()=default |
|
| std::vector< T > | data_ |
| | Values, one per NavCel.
|
| std::string | name_ |
| | Layer name (key in the registry).
|
| LayerType | type_ |
| | Runtime type tag (must match T).
|
template<typename T>
struct LayerView< T >
Typed layer view storing one T value per NavCel.
- Template Parameters
-
| T | Scalar type (uint8_t, float, double). |
- Note
- Elements are indexed by navmap::NavCelId.
◆ LayerView()
Construct a typed view.
- Parameters
-
| name | Layer name. |
| nitems | Number of NavCels. |
| t | Runtime type tag corresponding to T. |
◆ clone()
template<typename T>
| std::shared_ptr< LayerViewBase > clone |
( |
| ) |
const |
|
overridevirtual |
Independent copy of this layer (data, name, type, cached hash and pending changes).
Implements LayerViewBase.
◆ content_hash()
template<typename T>
| std::uint64_t content_hash |
( |
| ) |
const |
|
overridevirtual |
Return 64-bit content hash (cached; recomputed lazily).
Implements LayerViewBase.
◆ data() [1/2]
template<typename T>
| std::vector< T > & data |
( |
| ) |
|
- Returns
- Mutable reference to internal storage.
◆ data() [2/2]
template<typename T>
| const std::vector< T > & data |
( |
| ) |
const |
- Returns
- Const reference to internal storage.
◆ mutable_data()
template<typename T>
| std::vector< T > & mutable_data |
( |
| ) |
const |
◆ name()
template<typename T>
| const std::string & name |
( |
| ) |
const |
|
overridevirtual |
- Returns
- Layer name (unique within the registry).
Implements LayerViewBase.
◆ operator[]() [1/2]
◆ operator[]() [2/2]
template<typename T>
| const T & operator[] |
( |
NavCelId | cid | ) |
const |
◆ set_data()
template<typename T>
| void set_data |
( |
const std::vector< T > & | v | ) |
|
◆ size()
- Returns
- Number of items (= number of NavCels).
Implements LayerViewBase.
◆ type()
- Returns
- Type tag of the underlying storage.
Implements LayerViewBase.
◆ data_
◆ name_
Layer name (key in the registry).
◆ type_
Runtime type tag (must match T).
The documentation for this struct was generated from the following file: