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

An object to convert Conduit Nodes into Records. More...

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

Public Types

using TypeLoader = std::function< std::unique_ptr< Record >(conduit::Node const &)>
 

Public Member Functions

void addTypeLoader (std::string const &type, TypeLoader loader)
 Add a function for loading records of the specified type. More...
 
std::unique_ptr< Recordload (conduit::Node const &recordAsNode) const
 Load a Record from its conduit Node representation. More...
 
bool canLoad (std::string const &type) const
 Check whether this loader can load records of the given type. More...
 

Detailed Description

An object to convert Conduit Nodes into Records.

A RecordLoader is used to convert conduit::Node instances which represent Sina Records into instances of their corresponding axom::sina::Record subclasses. For convenience, a RecordLoader capable of handling Records of all known types can be created using createRecordLoaderWithAllKnownTypes:

An object representing the top-level object of a Sina file.
Definition: Document.hpp:129
RecordLoader createRecordLoaderWithAllKnownTypes()
Create a RecordLoader which can load records of all known types.

Member Typedef Documentation

◆ TypeLoader

using axom::sina::RecordLoader::TypeLoader = std::function<std::unique_ptr<Record>(conduit::Node const &)>

A TypeLoader is a function which converts records of a specific type to their corresponding sub classes.

Member Function Documentation

◆ addTypeLoader()

void axom::sina::RecordLoader::addTypeLoader ( std::string const &  type,
TypeLoader  loader 
)

Add a function for loading records of the specified type.

Parameters
typethe type of records this function can load
loaderthe function which can load the records

◆ load()

std::unique_ptr<Record> axom::sina::RecordLoader::load ( conduit::Node const &  recordAsNode) const

Load a Record from its conduit Node representation.

Parameters
recordAsNodethe Record as a Node
Returns
the Record

◆ canLoad()

bool axom::sina::RecordLoader::canLoad ( std::string const &  type) const

Check whether this loader can load records of the given type.

Parameters
typethe type of the records to check
Returns
whether records of the given type can be loaded

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