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

An object representing an entry in a Document's Record list. More...

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

Inheritance diagram for axom::sina::Record:

Public Types

using FileSet = std::unordered_set< File, FileHashByURI, FileEqualByURI >
 
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

void setDefaultCurveOrder (CurveSet::CurveOrder order)
 Set the default curve order for all Records. More...
 
CurveSet::CurveOrder getDefaultCurveOrder () const
 Get the effective default curve order for this Record. More...
 
 Record (ID id, std::string type)
 Construct a new Record. More...
 
 Record (conduit::Node const &asNode)
 Construct a Record from its conduit Node representation. More...
 
 Record (Record const &)=delete
 
Recordoperator= (Record const &)=delete
 
ID const & getId () const noexcept
 Get the Record's ID. More...
 
std::string const & getType () const noexcept
 Get the Record's type. More...
 
void remove (File const &file)
 Remove a File from this record. More...
 
void add (File file)
 Add a File to this record. More...
 
FileSet const & getFiles () const noexcept
 Get the files associated with this record. More...
 
conduit::Node toNode (CurveSet::CurveOrder curveOrder) const override
 Convert this record to its conduit Node representation. More...
 
conduit::Node toNode () const
 Convert using this record's default curve order. More...
 
void addRecordAsLibraryData (Record const &childRecord, std::string const &name)
 Add another record to this one as library 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...
 
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...
 

Static Public Attributes

static CurveSet::CurveOrder defaultCurveOrder
 

Detailed Description

An object representing an entry in a Document's Record list.

The Record class represents an entry in a Document's Record list. Records represent the data to be stored (as opposed to the relationships between data)–natural scopes for Records include things like a single run of an application, an msub job, a cluster of runs that has some metadata attached to the cluster (this Record might have a "contains" Relationship for all the runs within it), etc.

Each Record must have a type and an id. Each Record can also have a list of File objects and a map of Datum objects.

std::unique_ptr<axom::sina::Record> myRecord{new axom::sina::Record{myID, "my_type"}};
std::vector<std::string> myTags{"input"};
axom::sina::Datum myDatum{12, myTags};
myRecord->add("my_scalar",std::move(myDatum));
std::cout << myRecord->toNode().to_json() << std::endl;
An object to track a value associated with a Record.
Definition: Datum.hpp:81
conduit::Node toNode() const
Convert this Datum to its conduit Node representation.
The ID of a Record.
Definition: ID.hpp:50
An object representing an entry in a Document's Record list.
Definition: Record.hpp:88

The output would be:

{"local_id":"my_record","type":"my_type","data":{"my_scalar":{"tags":["input"],"value":12.0}}}

Member Typedef Documentation

◆ FileSet

An unordered set of File objects.

◆ DatumMap

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

An unordered map of Datum objects.

◆ CurveSetMap

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

An unordered map of CurveSet objects.

◆ LibraryDataMap

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

An unordered map of shared pointers to DataHolder objects.

Constructor & Destructor Documentation

◆ Record() [1/3]

axom::sina::Record::Record ( ID  id,
std::string  type 
)

Construct a new Record.

Parameters
idthe ID of the record
typethe type of the record

◆ Record() [2/3]

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

Construct a Record from its conduit Node representation.

For the purpose of the order in which curves are written, Nodes are assumed to be ordered OLDEST FIRST. This should be consistent within codes.

Parameters
asNodethe Record as a Node

◆ Record() [3/3]

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

Disable the copy constructor.

Member Function Documentation

◆ setDefaultCurveOrder()

void axom::sina::Record::setDefaultCurveOrder ( CurveSet::CurveOrder  order)

Set the default curve order for all Records.

Parameters
orderthe new default curve order

◆ getDefaultCurveOrder()

CurveSet::CurveOrder axom::sina::Record::getDefaultCurveOrder ( ) const

Get the effective default curve order for this Record.

Returns
the instance default if set, otherwise the global default

◆ operator=()

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

Disable copy assignment.

◆ getId()

ID const& axom::sina::Record::getId ( ) const
inlinenoexcept

Get the Record's ID.

Returns
the ID

◆ getType()

std::string const& axom::sina::Record::getType ( ) const
inlinenoexcept

Get the Record's type.

Returns
the Record's type

◆ remove()

void axom::sina::Record::remove ( File const &  file)

Remove a File from this record.

Parameters
filethe File to remove

◆ add() [1/5]

void axom::sina::Record::add ( File  file)

Add a File to this record.

Parameters
filethe File to add

◆ getFiles()

FileSet const& axom::sina::Record::getFiles ( ) const
inlinenoexcept

Get the files associated with this record.

Returns
the record's files

◆ toNode() [1/2]

conduit::Node axom::sina::Record::toNode ( CurveSet::CurveOrder  curveOrder) const
overridevirtual

Convert this record to its conduit Node representation.

Parameters
curveOrderOptionally, specify an order that CurveSets should be written in. Options are enumerated in CurveSets; REGISTRATION_OLDEST_FIRST is "ULTRA style".
Returns
the Node representation of this record.

Reimplemented from axom::sina::DataHolder.

Reimplemented in axom::sina::Run.

◆ toNode() [2/2]

conduit::Node axom::sina::Record::toNode ( ) const

Convert using this record's default curve order.

◆ addRecordAsLibraryData()

void axom::sina::Record::addRecordAsLibraryData ( Record const &  childRecord,
std::string const &  name 
)

Add another record to this one as library data.

Useful for libraries that can run in standalone mode; the host simply calls this method on the record the library produces. Merges file lists.

Parameters
nameThe host code's name for the library

◆ add() [2/5]

void axom::sina::DataHolder::add

Add a Datum to this DataHolder.

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

◆ add() [3/5]

void axom::sina::DataHolder::add

Add a CurveSet to this DataHolder.

Parameters
curveSetthe CurveSet to add

◆ getData()

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

Get the DataHolder's data.

Returns
the DataHolder's data

◆ add() [4/5]

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

Add a Datum to this DataHolder.

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

◆ add() [5/5]

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

Add a CurveSet to this DataHolder.

Parameters
curveSetthe CurveSet to add

◆ getCurveSets()

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

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)
inherited

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 
)
inherited

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
inlinenoexceptinherited

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)
inlineinherited

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
inlineinherited

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
inlinenoexceptinherited

Get the user-defined content of the object.

Returns
the user-defined content

◆ getUserDefinedContent() [2/2]

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

Get the user-defined content of the object.

Returns
the user-defined content

◆ setUserDefinedContent()

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

Set the user-defined content of the object.

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

Member Data Documentation

◆ defaultCurveOrder

CurveSet::CurveOrder axom::sina::Record::defaultCurveOrder
static

An enum member representing the default ordering of Curves within CurveSets.


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