AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::sina::DataHolder Class Reference

A DataHolder is a basic container for certain types of information. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/sina/core/DataHolder.hpp>

Inheritance diagram for axom::sina::DataHolder:

Public Types

using DatumMap = std::unordered_map< std::string, Datum >
 
using CurveSetMap = std::unordered_map< std::string, CurveSet >
 
using LibraryDataMap = std::unordered_map< std::string, std::shared_ptr< DataHolder > >
 

Public Member Functions

 DataHolder ()=default
 
virtual ~DataHolder ()=default
 
 DataHolder (DataHolder const &)=delete
 
DataHolderoperator= (DataHolder const &)=delete
 
 DataHolder (conduit::Node const &asNode)
 Construct a DataHolder from its conduit Node representation. More...
 
DatumMap const & getData () const noexcept
 Get the DataHolder's data. More...
 
void add (std::string name, Datum datum)
 Add a Datum to this DataHolder. More...
 
void add (CurveSet curveSet)
 Add a CurveSet to this DataHolder. More...
 
CurveSetMap const & getCurveSets () const noexcept
 Get the curve sets associated with this DataHolder. More...
 
std::shared_ptr< DataHolderaddLibraryData (std::string const &name)
 Add a new library to this DataHolder. More...
 
std::shared_ptr< DataHolderaddLibraryData (std::string const &name, conduit::Node existingLibraryData)
 Add a new library to this DataHolder with existing library data. More...
 
LibraryDataMap const & getLibraryData () const noexcept
 Get all library data associated with this DataHolder. More...
 
std::shared_ptr< DataHoldergetLibraryData (std::string const &libraryName)
 Get a specific library associated with this DataHolder. More...
 
std::shared_ptr< DataHolder > const getLibraryData (std::string const &libraryName) const
 Get a specific library associated with this DataHolder. More...
 
conduit::Node const & getUserDefinedContent () const noexcept
 Get the user-defined content of the object. More...
 
conduit::Node & getUserDefinedContent () noexcept
 Get the user-defined content of the object. More...
 
void setUserDefinedContent (conduit::Node userDefined)
 Set the user-defined content of the object. More...
 
virtual conduit::Node toNode (CurveSet::CurveOrder curveOrder) const
 Convert this DataHolder to its conduit Node representation. More...
 

Detailed Description

A DataHolder is a basic container for certain types of information.

DataHolders contain curves, libraries, and data (Datum), and represent all the information a library can have associated with it. Records expand on DataHolders to contain additional info.

See also
Record
LibraryDataMap

Member Typedef Documentation

◆ DatumMap

using axom::sina::DataHolder::DatumMap = std::unordered_map<std::string, Datum>

An unordered map of Datum objects.

◆ CurveSetMap

using axom::sina::DataHolder::CurveSetMap = std::unordered_map<std::string, CurveSet>

An unordered map of CurveSet objects.

◆ LibraryDataMap

using axom::sina::DataHolder::LibraryDataMap = std::unordered_map<std::string, std::shared_ptr<DataHolder> >

An unordered map of shared pointers to DataHolder objects.

Constructor & Destructor Documentation

◆ DataHolder() [1/3]

axom::sina::DataHolder::DataHolder ( )
default

Construct an empty DataHolder.

◆ ~DataHolder()

virtual axom::sina::DataHolder::~DataHolder ( )
virtualdefault

Virtual destructor to automatically clean up resources held by an instance of the DataHolder class.

◆ DataHolder() [2/3]

axom::sina::DataHolder::DataHolder ( DataHolder const &  )
delete

Copy constructor that disallows this constructor type.

◆ DataHolder() [3/3]

axom::sina::DataHolder::DataHolder ( conduit::Node const &  asNode)
explicit

Construct a DataHolder from its conduit Node representation.

Parameters
asNodethe DataHolder as a Node

Member Function Documentation

◆ operator=()

DataHolder& axom::sina::DataHolder::operator= ( DataHolder const &  )
delete

Disable copy assignment.

◆ getData()

DatumMap const& axom::sina::DataHolder::getData ( ) const
inlinenoexcept

Get the DataHolder's data.

Returns
the DataHolder's data

◆ add() [1/2]

void axom::sina::DataHolder::add ( std::string  name,
Datum  datum 
)

Add a Datum to this DataHolder.

Parameters
namethe key for the Datum to add
datumthe Datum to add

◆ add() [2/2]

void axom::sina::DataHolder::add ( CurveSet  curveSet)

Add a CurveSet to this DataHolder.

Parameters
curveSetthe CurveSet to add

◆ getCurveSets()

CurveSetMap const& axom::sina::DataHolder::getCurveSets ( ) const
inlinenoexcept

Get the curve sets associated with this DataHolder.

Returns
the dataholder's curve sets

◆ addLibraryData() [1/2]

std::shared_ptr<DataHolder> axom::sina::DataHolder::addLibraryData ( std::string const &  name)

Add a new library to this DataHolder.

If you try to add a library with a name that already exists, the old library will be replaced.

Returns
a pointer to a new DataHolder for a library of the given name.

◆ addLibraryData() [2/2]

std::shared_ptr<DataHolder> axom::sina::DataHolder::addLibraryData ( std::string const &  name,
conduit::Node  existingLibraryData 
)

Add a new library to this DataHolder with existing library data.

Returns
a pointer to a new DataHolder for a library of the given name.

◆ getLibraryData() [1/3]

LibraryDataMap const& axom::sina::DataHolder::getLibraryData ( ) const
inlinenoexcept

Get all library data associated with this DataHolder.

Returns
the dataholder's library data

◆ getLibraryData() [2/3]

std::shared_ptr<DataHolder> axom::sina::DataHolder::getLibraryData ( std::string const &  libraryName)
inline

Get a specific library associated with this DataHolder.

Returns
the dataholder's library data

◆ getLibraryData() [3/3]

std::shared_ptr<DataHolder> const axom::sina::DataHolder::getLibraryData ( std::string const &  libraryName) const
inline

Get a specific library associated with this DataHolder.

Returns
the dataholder's library data

◆ getUserDefinedContent() [1/2]

conduit::Node const& axom::sina::DataHolder::getUserDefinedContent ( ) const
inlinenoexcept

Get the user-defined content of the object.

Returns
the user-defined content

◆ getUserDefinedContent() [2/2]

conduit::Node& axom::sina::DataHolder::getUserDefinedContent ( )
inlinenoexcept

Get the user-defined content of the object.

Returns
the user-defined content

◆ setUserDefinedContent()

void axom::sina::DataHolder::setUserDefinedContent ( conduit::Node  userDefined)

Set the user-defined content of the object.

Parameters
userDefinedthe user-defined content. Must be an object (key/value pairs)

◆ toNode()

virtual conduit::Node axom::sina::DataHolder::toNode ( CurveSet::CurveOrder  curveOrder) const
virtual

Convert this DataHolder to its conduit Node representation.

Parameters
curveOrderthe order in which curves within curvesets should be written. A default is set in Record.
Returns
the Node representation of this DataHolder.

Reimplemented in axom::sina::Run, and axom::sina::Record.


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