IODA
ioda::Attribute Class Reference

This class represents attributes, which may be attached to both Variables and Groups. More...

#include <Attribute.h>

Inheritance diagram for ioda::Attribute:
Collaboration diagram for ioda::Attribute:

Public Member Functions

 Attribute ()
 
 Attribute (std::shared_ptr< detail::Attribute_Backend > b)
 
 Attribute (const Attribute &)
 
Attributeoperator= (const Attribute &)
 
virtual ~Attribute ()
 
- Public Member Functions inherited from ioda::detail::Attribute_Base< Attribute_Implementation >
virtual Attribute_Implementation write (gsl::span< char > data, const Type &type)
 The fundamental write function. Backends overload this function to implement all write operations. More...
 
template<class DataType , class Marshaller = ioda::Object_Accessor<DataType>, class TypeWrapper = Types::GetType_Wrapper<DataType>>
Attribute_Implementation write (gsl::span< const DataType > data)
 Write data. More...
 
template<class DataType , class Marshaller = ioda::Object_Accessor<DataType>, class TypeWrapper = Types::GetType_Wrapper<DataType>>
Attribute_Implementation write (const std::vector< DataType > &data)
 Write data. More...
 
template<class DataType >
Attribute_Implementation write (std::initializer_list< DataType > data)
 Write data. More...
 
template<class DataType >
Attribute_Implementation write (DataType data)
 Write a datum. More...
 
template<class EigenClass >
Attribute_Implementation writeWithEigenRegular (const EigenClass &d)
 Write an Eigen object (a Matrix, an Array, a Block, a Map). More...
 
template<class EigenClass >
Attribute_Implementation writeWithEigenTensor (const EigenClass &d)
 Write an Eigen Tensor-like object. More...
 
virtual Attribute_Implementation read (gsl::span< char > data, const Type &in_memory_dataType) const
 The fundamental read function. Backends overload this function to implement all read operations. More...
 
template<class DataType , class Marshaller = ioda::Object_Accessor<DataType>, class TypeWrapper = Types::GetType_Wrapper<DataType>>
Attribute_Implementation read (gsl::span< DataType > data) const
 Read data. More...
 
template<class DataType >
Attribute_Implementation read (std::vector< DataType > &data) const
 Vector read convenience function. More...
 
template<class DataType >
Attribute_Implementation read (std::valarray< DataType > &data) const
 Valarray read convenience function. More...
 
template<class DataType >
Attribute_Implementation read (DataType &data) const
 Read into a single value (convenience function). More...
 
template<class DataType >
DataType read () const
 Read a single value (convenience function). More...
 
template<class DataType >
std::vector< DataType > readAsVector () const
 Read into a new vector. Python convenience function. More...
 
template<class EigenClass , bool Resize = detail::EigenCompat::CanResize<EigenClass>::value>
Attribute_Implementation readWithEigenRegular (EigenClass &res) const
 Read data into an Eigen::Array, Eigen::Matrix, Eigen::Map, etc. More...
 
template<class EigenClass >
Attribute_Implementation readWithEigenTensor (EigenClass &res) const
 Read data into an Eigen::Array, Eigen::Matrix, Eigen::Map, etc. More...
 
template<class EigenClass >
EigenClass _readWithEigenRegular_python () const
 
virtual Type getType () const
 Get Attribute type. More...
 
Type type () const
 Get Attribute type. More...
 
virtual detail::Type_ProvidergetTypeProvider () const
 Query the backend and get the type provider. More...
 
template<class DataType >
bool isA () const
 Convenience function to check an Attribute's storage type. More...
 
virtual bool isA (Type lhs) const
 Hand-off to the backend to check equivalence. More...
 
bool isA (BasicTypes dataType)
 Python compatability function. More...
 
bool _py_isA2 (BasicTypes dataType)
 
virtual Dimensions getDimensions () const
 Get Attribute's dimensions. More...
 
virtual ~Attribute_Base ()
 

Public Attributes

Python compatability objects
detail::python_bindings::AttributeIsA< Attribute_py_isA
 
detail::python_bindings::AttributeReadSingle< Attribute_py_readSingle
 
detail::python_bindings::AttributeReadVector< Attribute_py_readVector
 
detail::python_bindings::AttributeReadNPArray< Attribute_py_readNPArray
 
detail::python_bindings::AttributeWriteSingle< Attribute_py_writeSingle
 
detail::python_bindings::AttributeWriteVector< Attribute_py_writeVector
 
detail::python_bindings::AttributeWriteNPArray< Attribute_py_writeNPArray
 

Additional Inherited Members

- Protected Member Functions inherited from ioda::detail::Attribute_Base< Attribute_Implementation >
 Attribute_Base (std::shared_ptr< Attribute_Backend >)
 
- Protected Attributes inherited from ioda::detail::Attribute_Base< Attribute_Implementation >
std::shared_ptr< Attribute_Backendbackend_
 Using an opaque object to implement the backend. More...
 

Detailed Description

This class represents attributes, which may be attached to both Variables and Groups.

Attributes are used to store small objects that get tagged to a Variable or a Group to provide context to users and other programs. Attributes include descriptions, units, alternate names, dimensions, and similar constructs. Attributes may have different types (ints, floats, datetimes, strings, etc.), and may be 0- or 1-dimensional.

We can open an Attribute from a Has_Attribute object, which is a member of Groups and Variables.

Note
Multidimensional attributes are supported by some of the underlying backends, like HDF5, but are incompatible with the NetCDF file format.
See also
Has_Attribute for the class that can create and open new Attribute objects.
Exceptions
jedi::xErroron all exceptions.

Definition at line 493 of file Attribute.h.

Constructor & Destructor Documentation

◆ Attribute() [1/3]

ioda::Attribute::Attribute ( )

Definition at line 91 of file Attribute.cpp.

◆ Attribute() [2/3]

ioda::Attribute::Attribute ( std::shared_ptr< detail::Attribute_Backend b)

Definition at line 100 of file Attribute.cpp.

◆ Attribute() [3/3]

ioda::Attribute::Attribute ( const Attribute r)

Definition at line 109 of file Attribute.cpp.

◆ ~Attribute()

ioda::Attribute::~Attribute ( )
virtualdefault

Member Function Documentation

◆ operator=()

Attribute & ioda::Attribute::operator= ( const Attribute r)

Definition at line 118 of file Attribute.cpp.

Member Data Documentation

◆ _py_isA

Definition at line 504 of file Attribute.h.

◆ _py_readNPArray

detail::python_bindings::AttributeReadNPArray<Attribute> ioda::Attribute::_py_readNPArray

Definition at line 508 of file Attribute.h.

◆ _py_readSingle

detail::python_bindings::AttributeReadSingle<Attribute> ioda::Attribute::_py_readSingle

Definition at line 506 of file Attribute.h.

◆ _py_readVector

detail::python_bindings::AttributeReadVector<Attribute> ioda::Attribute::_py_readVector

Definition at line 507 of file Attribute.h.

◆ _py_writeNPArray

detail::python_bindings::AttributeWriteNPArray<Attribute> ioda::Attribute::_py_writeNPArray

Definition at line 512 of file Attribute.h.

◆ _py_writeSingle

detail::python_bindings::AttributeWriteSingle<Attribute> ioda::Attribute::_py_writeSingle

Definition at line 510 of file Attribute.h.

◆ _py_writeVector

detail::python_bindings::AttributeWriteVector<Attribute> ioda::Attribute::_py_writeVector

Definition at line 511 of file Attribute.h.


The documentation for this class was generated from the following files: