Reaktoro  v2.13.0
A unified framework for modeling chemically reactive systems

Used to store and retrieve model parameters. More...

#include <Params.hpp>

Public Member Functions

 Params ()
 Construct a default Params object.
 
 Params (Data const &params)
 Construct a Params object with given parameters as Data object.
 
auto data () const -> Data const &
 Return the underlying Data object of this Params object.
 
auto append (Params const &other) -> Params &
 Append another Params object into this.
 
auto append (Data const &other) -> Params &
 Append a Data object containing parameters into this Params object.
 
auto operator+= (Params const &other) -> Params &
 Append another Params object into this.
 
auto operator[] (String const &name) const -> Data const &
 Return the set of parameters with given name.
 

Static Public Member Functions

static auto fromFile (String const &path) -> Params
 Return a Params object constructed with a given local file. More...
 
static auto fromEmbeddedFile (String const &path) -> Params
 Return a Params object constructed with a given embedded file. More...
 
static auto fromStringYAML (String const &text) -> Params
 Return a Params object constructed with given parameters text contents in YAML format. More...
 
static auto fromStringJSON (String const &text) -> Params
 Return a Params object constructed with given parameters text contents in JSON format. More...
 
static auto embedded (String const &path) -> Params
 Return parameters with the given file path within the virtual directory of embedded resources (equivalent to fromEmbeddedFile).
 
static auto local (String const &path) -> Params
 Return parameters with the given local file path (equivalent to fromFile).
 

Detailed Description

Used to store and retrieve model parameters.

Member Function Documentation

◆ fromFile()

static auto fromFile ( String const &  path) -> Params
static

Return a Params object constructed with a given local file.

Warning
An exception is thrown if path does not point to a valid local parameters file.
Parameters
pathThe path, including file name, to the local parameters file.

◆ fromEmbeddedFile()

static auto fromEmbeddedFile ( String const &  path) -> Params
static

Return a Params object constructed with a given embedded file.

Warning
An exception is thrown if path does not point to a valid embedded parameters file.
Parameters
pathThe path, including file name, to the embedded parameters file.

◆ fromStringYAML()

static auto fromStringYAML ( String const &  text) -> Params
static

Return a Params object constructed with given parameters text contents in YAML format.

Parameters
textThe text contents of the parameters as a string.

◆ fromStringJSON()

static auto fromStringJSON ( String const &  text) -> Params
static

Return a Params object constructed with given parameters text contents in JSON format.

Parameters
textThe text contents of the parameters as a string.

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