16     : backend_(backend), atts((backend) ? backend->atts : 
Has_Attributes()) {}
 
   28     if (backend_ == 
nullptr)
 
   30     return backend_->isA(lhs);
 
   33       "An exception occurred inside ioda while checking variable type.", 
ioda_Here()));
 
   39     if (backend_ == 
nullptr)
 
   41     return backend_->getTypeProvider();
 
   44       "An exception occurred inside ioda while getting a backend type provider.", 
ioda_Here()));
 
   51     if (backend_ == 
nullptr)
 
   53     return backend_->getType();
 
   56       "An exception occurred inside ioda while determining variable type.", 
ioda_Here()));
 
   80       "An exception occurred inside ioda while determining variable type.", 
ioda_Here()));
 
   87     if (backend_ == 
nullptr)
 
   89     return backend_->getCreationParameters(doAtts, doDims);
 
   92       "An exception occurred inside ioda while getting creation-time metadata of a variable.",
 
  100     if (backend_ == 
nullptr)
 
  102     return backend_->hasFillValue();
 
  105       "An exception occurred inside ioda while determining if a variable has a fill value.",
 
  113     if (backend_ == 
nullptr)
 
  115     return backend_->getFillValue();
 
  118       "An exception occurred inside ioda while reading a variable's fill value.", 
ioda_Here()));
 
  125     if (backend_ == 
nullptr)
 
  127     return backend_->getChunkSizes();
 
  130       "An exception occurred inside ioda while determining a variable's chunking options.",
 
  138     if (backend_ == 
nullptr)
 
  140     return backend_->getGZIPCompression();
 
  143       "An exception occurred inside ioda while reading GZIP compression options.", 
ioda_Here()));
 
  150     if (backend_ == 
nullptr)
 
  152     return backend_->getSZIPCompression();
 
  155       "An exception occurred inside ioda while reading SZIP compression options.", 
ioda_Here()));
 
  162     if (backend_ == 
nullptr)
 
  164     return backend_->getDimensions();
 
  167       "An exception occurred inside ioda while reading a variable's dimensions.", 
ioda_Here()));
 
  174     if (backend_ == 
nullptr)
 
  176     return backend_->resize(
newDims);
 
  179       "An exception occurred inside ioda while resizing a variable.", 
ioda_Here()));
 
  187     if (backend_ == 
nullptr)
 
  189     return backend_->attachDimensionScale(DimensionNumber, scale);
 
  192       "An exception occurred inside ioda while attaching a dimension scale to a variable.",
 
  201     if (backend_ == 
nullptr)
 
  203     return backend_->detachDimensionScale(DimensionNumber, scale);
 
  206       "An exception occurred inside ioda while detaching a dimension " 
  214     for (
unsigned int i = 0; i < vdims.size(); ++i)
 
  215       attachDimensionScale(i, vdims[i]);
 
  219       "An exception occurred inside ioda while setting dimension scales on a variable.",
 
  227     for (
unsigned int i = 0; i < vdims.size(); ++i) attachDimensionScale(i, vdims[i].var);
 
  230     std::throw_with_nested(
 
  231       Exception(
"An exception occurred inside ioda while setting dimension scales on a variable.",
 
  238   return setDimScale(std::vector<Variable>{dims});
 
  242   return setDimScale(std::vector<Variable>{dim1, dim2});
 
  247   return setDimScale(std::vector<Variable>{dim1, dim2, dim3});
 
  253     if (backend_ == 
nullptr)
 
  255     return backend_->isDimensionScale();
 
  258       "An exception occurred inside ioda while checking if a variable is a dimension scale.",
 
  266     if (backend_ == 
nullptr)
 
  268     return backend_->setIsDimensionScale(dimensionScaleName);
 
  271       "An exception occurred inside ioda while making a variable a dimension scale.",
 
  278     if (backend_ == 
nullptr)
 
  280     return backend_->getDimensionScaleName(res);
 
  283       "An exception occurred inside ioda while determining the human-readable " 
  284       "name of a dimension scale.", 
ioda_Here()));
 
  291     if (backend_ == 
nullptr)
 
  293     return backend_->isDimensionScaleAttached(DimensionNumber, scale);
 
  296       "An exception occurred inside ioda while determining if a dimension scale is " 
  297       "attached to a variable at a specified dimension.", 
ioda_Here())
 
  298       .add(
"DimensionNumber", DimensionNumber));
 
  304   const std::list<Named_Variable>& scalesToQueryAgainst, 
bool firstOnly)
 const {
 
  306     if (backend_ == 
nullptr)
 
  308     return backend_->getDimensionScaleMappings(scalesToQueryAgainst, firstOnly);
 
  311       "An exception occurred inside ioda while determining which scales are attached to " 
  312       "which dimensions of a variable.", 
ioda_Here()));
 
  320     if (backend_ == 
nullptr)
 
  322     return backend_->write(data, in_memory_dataType, mem_selection, file_selection);
 
  325       "An exception occurred inside ioda while writing data to a variable.", 
ioda_Here()));
 
  334     if (backend_ == 
nullptr)
 
  336     return backend_->read(data, in_memory_dataType, mem_selection, file_selection);
 
  339       "An exception occurred inside ioda while reading data from a variable.", 
ioda_Here()));
 
  346     if (backend_ == 
nullptr)
 
  348     return backend_->instantiateSelection(sel);
 
  351       "An exception occurred inside ioda.", 
ioda_Here()));
 
  361   const std::list<Named_Variable>& scalesToQueryAgainst, 
bool firstOnly)
 const {
 
  364     std::vector<std::vector<Named_Variable>> res(gsl::narrow<size_t>(dims.dimensionality));
 
  365     for (
unsigned i = 0; i < gsl::narrow<unsigned>(dims.dimensionality); ++i) {
 
  366       for (
const auto& s : scalesToQueryAgainst) {
 
  369           if (firstOnly) 
break;
 
  377       "An exception occurred inside ioda.", 
ioda_Here()));
 
  387     if (chunkinfo.size()) {
 
  395     if (std::get<0>(sz)) res.
compressWithSZIP(std::get<1>(sz), std::get<2>(sz));
 
  410       "An exception occurred inside ioda while determining creation-time parameters of a " 
  419     : detail::Variable_Base<
Variable>(nullptr),
 
  421       _py_readVector{this},
 
  422       _py_readNPArray{this},
 
  423       _py_writeVector{this},
 
  424       _py_writeNPArray{this},
 
  430       _py_readVector{this},
 
  431       _py_readNPArray{this},
 
  432       _py_writeVector{this},
 
  433       _py_writeNPArray{this},
 
  437     : Variable_Base{r.backend_},
 
  439       _py_readVector{this},
 
  440       _py_readNPArray{this},
 
  441       _py_writeVector{this},
 
  442       _py_writeNPArray{this},
 
  446   if (
this == &r) 
return *
this;
 
Interfaces for ioda::Has_Variables and related classes.
Interfaces  for ioda::Variable and related classes.
The ioda exception class.
This class exists inside of ioda::Group or ioda::Variable and provides the interface to manipulating ...
A Selection represents the bounds of the data, in ioda or in userspace, that you are reading or writi...
Represents the "type" (i.e. integer, string, float) of a piece of data.
detail::python_bindings::VariableReadVector< Variable > _py_readVector
detail::python_bindings::VariableScales< Variable > _py_scales
detail::python_bindings::VariableWriteNPArray< Variable > _py_writeNPArray
detail::python_bindings::VariableWriteVector< Variable > _py_writeVector
detail::python_bindings::VariableIsA< Variable > _py_isA
detail::python_bindings::VariableReadNPArray< Variable > _py_readNPArray
Variable & operator=(const Variable &)
Backends implement type providers in conjunction with Attributes, Has_Attributes, Variables and Has_V...
VariableCreationParameters getCreationParameters(bool doAtts=true, bool doDims=true) const override
Default implementation. Customizable by backends for performance.
virtual ~Variable_Backend()
std::vector< std::vector< Named_Variable > > getDimensionScaleMappings(const std::list< Named_Variable > &scalesToQueryAgainst, bool firstOnly=true) const override
Default, trivial implementation. Customizable by backends for performance.
virtual Variable attachDimensionScale(unsigned int DimensionNumber, const Variable &scale)
Attach a dimension scale to this Variable.
Variable setDimScale(const std::vector< Variable > &dims)
Set dimensions (convenience function to several invocations of attachDimensionScale).
virtual Type getType() const
Get type.
virtual FillValueData_t getFillValue() const
Retrieve the fill value.
virtual Variable setIsDimensionScale(const std::string &dimensionScaleName)
Designate this table as a dimension scale.
virtual std::vector< Dimensions_t > getChunkSizes() const
Retrieve the chunking options for the Variable.
virtual std::pair< bool, int > getGZIPCompression() const
Retrieve the GZIP compression options for the Variable.
std::shared_ptr< Variable_Backend > backend_
Using an opaque object to implement the backend.
bool isA() const
Convenience function to check a Variable's storage type.
Has_Attributes atts
Attributes.
virtual bool isDimensionScaleAttached(unsigned int DimensionNumber, const Variable &scale) const
Is a dimension scale attached to this Variable in a certain position?
virtual bool hasFillValue() const
Check if a variable has a fill value set.
virtual bool isDimensionScale() const
Is this Variable used as a dimension scale?
virtual Variable detachDimensionScale(unsigned int DimensionNumber, const Variable &scale)
Detach a dimension scale.
BasicTypes getBasicType() const
Convenience function to query type.
virtual Dimensions getDimensions() const
virtual std::tuple< bool, unsigned, unsigned > getSZIPCompression() const
Retrieve the SZIP compression options for the Variable.
virtual std::vector< std::vector< Named_Variable > > getDimensionScaleMappings(const std::list< Named_Variable > &scalesToQueryAgainst, bool firstOnly=true) const
Which dimensions are attached at which positions? This function may offer improved performance on som...
virtual VariableCreationParameters getCreationParameters(bool doAtts=true, bool doDims=true) const
Convenience function to get fill value, attributes, chunk sizes, and compression in a collective call...
virtual detail::Type_Provider * getTypeProvider() const
Query the backend and get the type provider.
std::string getDimensionScaleName() const
Get the name of this Variable's defined dimension scale.
virtual Variable read(gsl::span< char > data, const Type &in_memory_dataType, const Selection &mem_selection=Selection::all, const Selection &file_selection=Selection::all) const
Read the Variable - as char array. Ordering is row-major.
Variable_Base(std::shared_ptr< Variable_Backend >)
virtual Variable write(gsl::span< char > data, const Type &in_memory_dataType, const Selection &mem_selection=Selection::all, const Selection &file_selection=Selection::all)
The fundamental write function. Backends overload this function to implement all write operations.
std::shared_ptr< Variable_Backend > get() const
Gets a handle to the underlying object that implements the backend functionality.
virtual Variable resize(const std::vector< Dimensions_t > &newDims)
Resize the variable.
virtual Selections::SelectionBackend_t instantiateSelection(const Selection &sel) const
Convert a selection into its backend representation.
std::shared_ptr< InstantiatedSelection > SelectionBackend_t
@ undefined_
Internal use only.
Describes the dimensions of an Attribute or Variable.
Used to specify Variable creation-time properties.
void compressWithGZIP(int level=6)
detail::FillValueData_t fillValue_
std::vector< Dimensions_t > chunks
Manually specify the chunks. Never directly use. Use getChunks(...) instead.
void compressWithSZIP(unsigned PixelsPerBlock=16, unsigned options=4)
bool chunk
Do we chunk this variable? Required for extendible / compressible Variables.
Container used to store and manipulate fill values.