gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::IniParser::IniFile Class Reference

Main inifile class. More...

#include <yaml_parser.hpp>

Inheritance diagram for Gambit::IniParser::IniFile:
Collaboration diagram for Gambit::IniParser::IniFile:

Public Member Functions

virtual void readFile (str filename)
 Read in the YAML file. More...
 
const ObservablesTypegetObservables () const
 Getters for private observable and rules entries. More...
 
const ObservablesTypegetRules () const
 
- Public Member Functions inherited from Gambit::IniParser::Parser
YAML::Node getParametersNode () const
 Getters for key/value section. More...
 
YAML::Node getPriorsNode () const
 
YAML::Node getPrinterNode () const
 
YAML::Node getScannerNode () const
 
YAML::Node getLoggerNode () const
 
YAML::Node getKeyValuePairNode () const
 
template<typename... args>
bool hasKey (args... keys) const
 
template<typename TYPE , typename... args>
TYPE getValue (args... keys) const
 
template<typename TYPE , typename... args>
TYPE getValueOrDef (TYPE def, const args &... keys) const
 
template<typename TYPE >
TYPE getModelParameterEntry (str model, str param, str key) const
 Getters for model/parameter section. More...
 
bool hasModelParameterEntry (str model, str param, str key) const
 Getters for model/parameter section. More...
 
const std::set< strgetModelNames () const
 Return list of model names (without "adhoc" model!) More...
 
const std::vector< strgetModelParameters (str model) const
 
const Options getOptions (str key) const
 Getter for options. More...
 

Private Attributes

ObservablesType observables
 
ObservablesType rules
 

Additional Inherited Members

- Protected Member Functions inherited from Gambit::IniParser::Parser
YAML::Node filename_to_node (str)
 Read in the actual YAML file. More...
 
void basicParse (YAML::Node, str)
 Do the basic parsing of the YAML file. More...
 

Detailed Description

Main inifile class.

Definition at line 89 of file yaml_parser.hpp.

Member Function Documentation

◆ getObservables()

const ObservablesType & Gambit::IniParser::IniFile::getObservables ( ) const

◆ getRules()

◆ readFile()

void Gambit::IniParser::IniFile::readFile ( str  filename)
virtual

Read in the YAML file.

Reimplemented from Gambit::IniParser::Parser.

Definition at line 33 of file yaml_parser.cpp.

References Gambit::IniParser::Parser::basicParse(), Gambit::IniParser::Parser::filename_to_node(), Gambit::IniParser::Parser::getKeyValuePairNode(), Gambit::IniParser::Parser::getLoggerNode(), Gambit::IniParser::Parser::getPrinterNode(), Gambit::IniParser::Parser::getScannerNode(), Gambit::IniParser::Parser::logNode, observables, Gambit::IniParser::Parser::printerNode, and rules.

Referenced by main().

34  {
35 
36  // Perform the basic read and parse operations defined by the parent.
37  YAML::Node root = filename_to_node(filename);
38  basicParse(root,filename);
39 
40  // Get the observables and rules sections
41  YAML::Node outputNode = root["ObsLikes"];
42  YAML::Node rulesNode = root["Rules"];
43 
44  // Read likelihood/observables
45  for(YAML::const_iterator it=outputNode.begin(); it!=outputNode.end(); ++it)
46  {
47  observables.push_back((*it).as<Types::Observable>());
48  }
49 
50  // Read rules
51  for(YAML::const_iterator it=rulesNode.begin(); it!=rulesNode.end(); ++it)
52  {
53  rules.push_back((*it).as<Types::Observable>());
54  }
55 
56  // Read KeyValue section, find the default path entry, and pass this on
57  // to the Scanner, Logger, and Printer nodes
58  YAML::Node keyvalue = getKeyValuePairNode();
59  YAML::Node scanNode = getScannerNode();
60  YAML::Node printerNode = getPrinterNode();
61  YAML::Node logNode = getLoggerNode();
62 
63  }
YAML::Node filename_to_node(str)
Read in the actual YAML file.
ObservablesType observables
YAML::Node getPrinterNode() const
YAML::Node getScannerNode() const
YAML::Node getLoggerNode() const
void basicParse(YAML::Node, str)
Do the basic parsing of the YAML file.
YAML::Node getKeyValuePairNode() const
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ observables

ObservablesType Gambit::IniParser::IniFile::observables
private

Definition at line 104 of file yaml_parser.hpp.

Referenced by getObservables(), and readFile().

◆ rules

ObservablesType Gambit::IniParser::IniFile::rules
private

Definition at line 105 of file yaml_parser.hpp.

Referenced by getRules(), and readFile().


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