Class star::LayerView¶
Lightweight view into a specific layer with inheritance from base. More...
#include <stards.h>
Public Attributes¶
| Type | Name |
|---|---|
| LayerMetadataAccessor | meta |
Public Functions¶
| Type | Name |
|---|---|
| LayerView (std::shared_ptr< StarDataset > base, const std::string & layer_name) |
|
| std::shared_ptr< StarDataset > | base () const Get parent dataset. |
| bool | contains (const std::string & key) const Check if key exists in this layer or base (with inheritance). |
| NDArray< T > | get (const std::string & key) Get array from this layer with inheritance. |
| std::vector< std::string > | keys () const Get all keys in this layer (local + inherited). |
| std::string | name () const Get layer name. |
| void | put (const std::string & key, NDArray< T > && value) Store array in this layer. |
Detailed Description¶
LayerView provides the same API as StarDataset but operates on a specific layer. Keys not found in the layer automatically fall back to the base layer.
Example: auto ds = StarDataset::open("file.stards"); auto layer1 = ds->create_layer("band_0"); layer1->meta.put("wavelength", NDArray<double>({}, 450.5)); // Layer-specific auto inst = layer1->meta.get("instrument"); // Falls back to base
Public Attributes Documentation¶
variable meta¶
Public Functions Documentation¶
function LayerView¶
inline star::LayerView::LayerView (
std::shared_ptr< StarDataset > base,
const std::string & layer_name
)
function base¶
Get parent dataset.
Returns:
Shared pointer to base StarDataset
function contains¶
Check if key exists in this layer or base (with inheritance).
Parameters:
keyKey to check
Returns:
true if key exists in layer or base
function get¶
Get array from this layer with inheritance.
Template parameters:
TElement type
Parameters:
keyKey to retrieve
Returns:
NDArray with data from layer or base
function keys¶
Get all keys in this layer (local + inherited).
Returns:
Vector of key names
function name¶
Get layer name.
Returns:
Layer name
function put¶
Store array in this layer.
Template parameters:
TElement type
Parameters:
keyKey to storevalueData to store
The documentation for this class was generated from the following file StarDS/include/stards.h