Skip to content

Struct star::MetadataValue

ClassList > star > MetadataValue

Type-erased wrapper for metadata values. More...

  • #include <stards.h>

Public Attributes

Type Name
ValueVariant data
DataType dtype
std::vector< size_t > shape

Public Functions

Type Name
NDArray< T > as () const
bool is_array () const
bool is_scalar () const
size_t ndim () const
size_t size () const
std::shared_ptr< NDArray< T > > try_as () const
std::string type_name () const

Detailed Description

Provides type introspection and safe casting for metadata retrieved without knowing the type ahead of time. Eliminates the need for type guessing loops.

Public Attributes Documentation

variable data

ValueVariant star::MetadataValue::data;

variable dtype

DataType star::MetadataValue::dtype;

variable shape

std::vector<size_t> star::MetadataValue::shape;

Public Functions Documentation

function as

template<typename T>
inline NDArray < T > star::MetadataValue::as () const

function is_array

inline bool star::MetadataValue::is_array () const

function is_scalar

inline bool star::MetadataValue::is_scalar () const

function ndim

inline size_t star::MetadataValue::ndim () const

function size

inline size_t star::MetadataValue::size () const

function try_as

template<typename T>
inline std::shared_ptr< NDArray < T > > star::MetadataValue::try_as () const

function type_name

inline std::string star::MetadataValue::type_name () const


The documentation for this class was generated from the following file StarDS/include/stards.h