Task file parser routine. The object is bound to a single task file, which it initially reads and parses, and can thereafter write to.
More...
#include <TaskFileParser.hpp>
|
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 elements. Throw an Exception::Type::InitializationError if the requirements are not fulfilled. More...
|
|
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 required children. Throw an Exception::Type::InitializationError if the requirements are not fulfilled. More...
|
|
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 required attributes. Throw an Exception::Type::InitializationError if the requirements are not fulfilled. More...
|
|
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 children from a list of optional values. Throw an Exception::Type::InitializationError if the requirements are not fulfilled. More...
|
|
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 attributes from a list of optional values. Throw an Exception::Type::InitializationError if the requirements are not fulfilled. More...
|
|
|
boost::property_tree::ptree | _taskFile |
| Internal property tree representation of the parsed task file.
|
|
Task file parser routine. The object is bound to a single task file, which it initially reads and parses, and can thereafter write to.
◆ TaskFileParser()
Construct a new TaskFileParser object and parse the specified task file.
During the parsing process, the TaskFileParser will allocate and initialize (with parameters as specified in the task file) FrequencyDiscretization, CutoffDiscretization, and Lattice objects; The pointers to those objects are stored in frequency, cutoff, and lattice, respectively. Furthermore, it allocates the FrgCore (including the FrgCore::measurements) specified in the task file and writes it to frgCore. The computation status associated with the task file is also returned.
- Parameters
-
[in] | taskFilePath | Path to the task file to be parsed. |
[out] | frequency | Newly generated FrequencyDiscretization. |
[out] | cutoff | Newly generated CutoffDiscretization. |
[out] | lattice | Newly generated Lattice. |
[out] | frgCore | Newly generated FRG core. |
[out] | computationStatus | Computation status of the task associated with the task file. |
◆ _validateOptionalAttributes()
void TaskFileParser::_validateOptionalAttributes |
( |
const boost::property_tree::ptree & |
tree, |
|
|
const std::string & |
node, |
|
|
const std::set< std::string > & |
optionalAttributes, |
|
|
const std::string & |
treePath = "" |
|
) |
| const |
|
protected |
Ensure that a given property tree contains a specific node and test that the node contains only attributes from a list of optional values. Throw an Exception::Type::InitializationError if the requirements are not fulfilled.
- Parameters
-
tree | Property tree to test. |
node | Node to test. |
optionalAttributes | List of optional attributes of the node. |
treePath | Property path, which is prepended to the node name in a potential exception thrown.
|
◆ _validateOptionalChildren()
void TaskFileParser::_validateOptionalChildren |
( |
const boost::property_tree::ptree & |
tree, |
|
|
const std::string & |
node, |
|
|
const std::set< std::string > & |
optionalChildren, |
|
|
const std::string & |
treePath = "" |
|
) |
| const |
|
protected |
Ensure that a given property tree contains a specific node and test that the node contains only children from a list of optional values. Throw an Exception::Type::InitializationError if the requirements are not fulfilled.
- Parameters
-
tree | Property tree to test. |
node | Node to test. |
optionalChildren | List of optional children of the node. |
treePath | Property path, which is prepended to the node name in a potential exception thrown.
|
◆ _validateProperties()
void TaskFileParser::_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 |
|
protected |
Ensure that a given property tree contains a specific node with only known required or optional elements. Throw an Exception::Type::InitializationError if the requirements are not fulfilled.
- Parameters
-
tree | Property tree to test. |
node | Node to test. |
requiredChildren | List of required children of the node. |
requiredAttributes | List of required attributes of the node. |
optionalChildren | List of optional children of the node. |
optionalAttributes | List of optional attributes of the node. |
◆ _validateRequiredAttributes()
void TaskFileParser::_validateRequiredAttributes |
( |
const boost::property_tree::ptree & |
tree, |
|
|
const std::string & |
node, |
|
|
const std::set< std::string > & |
requiredAttributes, |
|
|
const std::string & |
treePath = "" |
|
) |
| const |
|
protected |
Ensure that a given property tree contains a specific node and test that the node contains a list of required attributes. Throw an Exception::Type::InitializationError if the requirements are not fulfilled.
- Parameters
-
tree | Property tree to test. |
node | Node to test. |
requiredAttributes | List of required attributes of the node. |
treePath | Property path, which is prepended to the node name in a potential exception thrown.
|
◆ _validateRequiredChildren()
void TaskFileParser::_validateRequiredChildren |
( |
const boost::property_tree::ptree & |
tree, |
|
|
const std::string & |
node, |
|
|
const std::set< std::string > & |
requiredChildren, |
|
|
const std::string & |
treePath = "" |
|
) |
| const |
|
protected |
Ensure that a given property tree contains a specific node and test that the node contains a list of required children. Throw an Exception::Type::InitializationError if the requirements are not fulfilled.
- Parameters
-
tree | Property tree to test. |
node | Node to test. |
requiredChildren | List of required children of the node. |
treePath | Property path, which is prepended to the node name in a potential exception thrown.
|
◆ writeTaskFile()
Write calculation status to the task file.
- Parameters
-
finalize | If set to true, the task status will be set to 'finished'. |
updateCheckpoint | If set to true, the last checkpoint time will be set to the current time. |
The documentation for this class was generated from the following files: