SpinParser  1.0
TaskFileParser.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 #include <string>
11 #include <set>
12 #include <boost/property_tree/ptree.hpp>
13 
16 struct Lattice;
17 struct ComputationStatus;
18 class FrgCore;
19 
24 {
25 public:
40  TaskFileParser(const std::string &taskFilePath, FrequencyDiscretization *&frequency, CutoffDiscretization *&cutoff, Lattice *&lattice, FrgCore *&frgCore, ComputationStatus &computationStatus);
41 
48  void writeTaskFile(const ComputationStatus &computationStatus);
49 
50 protected:
61  void _validateProperties(const boost::property_tree::ptree &tree, const std::string &node, const std::set<std::string> &requiredChildren, const std::set<std::string> &requiredAttributes, const std::set<std::string> &optionalChildren = {}, const std::set<std::string> &optionalAttributes = {}) const;
62 
71  void _validateRequiredChildren(const boost::property_tree::ptree &tree, const std::string &node, const std::set<std::string> &requiredChildren, const std::string &treePath = "") const;
72 
81  void _validateRequiredAttributes(const boost::property_tree::ptree &tree, const std::string &node, const std::set<std::string> &requiredAttributes, const std::string &treePath = "") const;
82 
91  void _validateOptionalChildren(const boost::property_tree::ptree &tree, const std::string &node, const std::set<std::string> &optionalChildren, const std::string &treePath = "") const;
92 
101  void _validateOptionalAttributes(const boost::property_tree::ptree &tree, const std::string &node, const std::set<std::string> &optionalAttributes, const std::string &treePath = "") const;
102 
103  boost::property_tree::ptree _taskFile;
104 };
TaskFileParser::_validateOptionalAttributes
void _validateOptionalAttributes(const boost::property_tree::ptree &tree, const std::string &node, const std::set< std::string > &optionalAttributes, const std::string &treePath="") const
Ensure that a given property tree contains a specific node and test that the node contains only attri...
Definition: TaskFileParser.cpp:415
TaskFileParser::_validateProperties
void _validateProperties(const boost::property_tree::ptree &tree, const std::string &node, const std::set< std::string > &requiredChildren, const std::set< std::string > &requiredAttributes, const std::set< std::string > &optionalChildren={}, const std::set< std::string > &optionalAttributes={}) const
Ensure that a given property tree contains a specific node with only known required or optional eleme...
Definition: TaskFileParser.cpp:376
FrgCore
Virtual implementation of a pf-FRG numerics core.
Definition: FrgCore.hpp:29
TaskFileParser::TaskFileParser
TaskFileParser(const std::string &taskFilePath, FrequencyDiscretization *&frequency, CutoffDiscretization *&cutoff, Lattice *&lattice, FrgCore *&frgCore, ComputationStatus &computationStatus)
Construct a new TaskFileParser object and parse the specified task file.
Definition: TaskFileParser.cpp:21
ComputationStatus
Computation status descriptor.
Definition: SpinParser.hpp:23
TaskFileParser::_validateRequiredChildren
void _validateRequiredChildren(const boost::property_tree::ptree &tree, const std::string &node, const std::set< std::string > &requiredChildren, const std::string &treePath="") const
Ensure that a given property tree contains a specific node and test that the node contains a list of ...
Definition: TaskFileParser.cpp:389
TaskFileParser::_validateRequiredAttributes
void _validateRequiredAttributes(const boost::property_tree::ptree &tree, const std::string &node, const std::set< std::string > &requiredAttributes, const std::string &treePath="") const
Ensure that a given property tree contains a specific node and test that the node contains a list of ...
Definition: TaskFileParser.cpp:397
TaskFileParser::writeTaskFile
void writeTaskFile(const ComputationStatus &computationStatus)
Write calculation status to the task file.
Definition: TaskFileParser.cpp:349
TaskFileParser::_validateOptionalChildren
void _validateOptionalChildren(const boost::property_tree::ptree &tree, const std::string &node, const std::set< std::string > &optionalChildren, const std::string &treePath="") const
Ensure that a given property tree contains a specific node and test that the node contains only child...
Definition: TaskFileParser.cpp:405
Lattice
Representation of a physical lattice, with symmetry information on two-point correlators.
Definition: Lattice.hpp:297
CutoffDiscretization
Representation of frequency axis cutoff discretization.
Definition: CutoffDiscretization.hpp:78
TaskFileParser
Task file parser routine. The object is bound to a single task file, which it initially reads and par...
Definition: TaskFileParser.hpp:23
TaskFileParser::_taskFile
boost::property_tree::ptree _taskFile
Internal property tree representation of the parsed task file.
Definition: TaskFileParser.hpp:103
FrequencyDiscretization
Discretization of Matsubara frequency space.
Definition: FrequencyDiscretization.hpp:164