NEML2 2.0.0
Loading...
Searching...
No Matches
Parser Class Referenceabstract

A parser is responsible for parsing an input file into a collection of options which can be used by the Factory to manufacture corresponding objects. More...

Detailed Description

A parser is responsible for parsing an input file into a collection of options which can be used by the Factory to manufacture corresponding objects.

#include <Parser.h>

Inheritance diagram for Parser:

Public Member Functions

 Parser ()=default
 
 Parser (const Parser &)=default
 
 Parser (Parser &&) noexcept=default
 
Parseroperator= (const Parser &)=default
 
Parseroperator= (Parser &&) noexcept=default
 
virtual ~Parser ()=default
 
virtual OptionCollection parse (const std::filesystem::path &filename, const std::string &additional_input="") const =0
 Deserialize a file.
 

Static Public Attributes

static const std::vector< std::string > sections
 Known top-level sections in the input file.
 

Constructor & Destructor Documentation

◆ Parser() [1/3]

Parser ( )
default

◆ Parser() [2/3]

Parser ( const Parser & )
default

◆ Parser() [3/3]

Parser ( Parser && )
defaultnoexcept

◆ ~Parser()

virtual ~Parser ( )
virtualdefault

Member Function Documentation

◆ operator=() [1/2]

Parser & operator= ( const Parser & )
default

◆ operator=() [2/2]

Parser & operator= ( Parser && )
defaultnoexcept

◆ parse()

virtual OptionCollection parse ( const std::filesystem::path & filename,
const std::string & additional_input = "" ) const
pure virtual

Deserialize a file.

Parameters
filenameName/path of the input file.
additional_inputAdditional content of the input file not included in the input file itself, e.g., from command line.
Returns
OptionCollection The extracted object options.

Implemented in HITParser.

Member Data Documentation

◆ sections

const std::vector< std::string > sections
static
Initial value:
= {
"Tensors", "Solvers", "Data", "Models", "Drivers"}

Known top-level sections in the input file.