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).
|
| |
| 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()
template<typename T>
| 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. |
◆ 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: