NGen
Loading...
Searching...
No Matches
realization::config::Output Struct Reference

Parsed representation of a realization config's output settings. More...

#include <output.hpp>

+ Collaboration diagram for realization::config::Output:

Public Member Functions

 Output ()=default
 

Static Public Member Functions

static Output parse_block (const boost::property_tree::ptree &output_tree)
 Parse the modern "output" block sub-tree.
 
static Output parse_legacy (const boost::property_tree::ptree &realization_tree)
 Build from the deprecated top-level keys.
 
static Output from_realization (const boost::property_tree::ptree &realization_tree)
 Prefer the modern "output" block; otherwise fall back to legacy keys, then normalize the root (see normalize_root) so an Output built through this entry point exposes a trailing-slash directory.
 

Public Attributes

std::string root
 Output directory.
 
OutputDomain catchment
 
OutputDomain nexus
 
int precision = DEFAULT_PRECISION
 Global value precision for text output backends.
 
bool from_legacy_keys = false
 True when built from the deprecated top-level keys (used to warn).
 

Static Public Attributes

static constexpr int DEFAULT_PRECISION = 9
 Significant digits applied uniformly when a text backend (CSV) renders values.
 

Static Private Member Functions

static std::string normalize_root (const std::string &configured_root)
 Normalize a configured directory to a trailing-slash path, falling back to "./" when unset.
 

Detailed Description

Parsed representation of a realization config's output settings.

Modern form (preferred):

"output": {
"root": "/path/to/output/",
"catchment": { "enable": true, "format": "csv", "grouping": "per_feature" },
"nexus": { "enable": true, "format": "csv", "grouping": "per_feature" }
}

For backward compatibility, when no "output" block is present the deprecated top-level keys output_root / disable_catchment_output / per_formulation_nexus_files are honored instead (see from_realization).

Constructor & Destructor Documentation

◆ Output()

realization::config::Output::Output ( )
default

Member Function Documentation

◆ from_realization()

static Output realization::config::Output::from_realization ( const boost::property_tree::ptree & realization_tree)
inlinestatic

Prefer the modern "output" block; otherwise fall back to legacy keys, then normalize the root (see normalize_root) so an Output built through this entry point exposes a trailing-slash directory.

parse_block / parse_legacy return the raw root. Creating the directory is left to the caller (see create_output_directory) – parsing has no side effect.

References normalize_root(), realization::config::OUTPUT_CONFIG_KEY, parse_block(), parse_legacy(), and root.

Referenced by realization::Formulation_Manager::initialize_output_config().

◆ normalize_root()

static std::string realization::config::Output::normalize_root ( const std::string & configured_root)
inlinestaticprivate

Normalize a configured directory to a trailing-slash path, falling back to "./" when unset.

Pure: creating the directory is a separate side effect (see create_output_directory).

Referenced by from_realization().

◆ parse_block()

static Output realization::config::Output::parse_block ( const boost::property_tree::ptree & output_tree)
inlinestatic

Parse the modern "output" block sub-tree.

References catchment, DEFAULT_PRECISION, nexus, precision, and root.

Referenced by from_realization().

◆ parse_legacy()

static Output realization::config::Output::parse_legacy ( const boost::property_tree::ptree & realization_tree)
inlinestatic

Member Data Documentation

◆ catchment

OutputDomain realization::config::Output::catchment

◆ DEFAULT_PRECISION

int realization::config::Output::DEFAULT_PRECISION = 9
staticconstexpr

Significant digits applied uniformly when a text backend (CSV) renders values.

Referenced by parse_block().

◆ from_legacy_keys

bool realization::config::Output::from_legacy_keys = false

True when built from the deprecated top-level keys (used to warn).

Referenced by realization::Formulation_Manager::initialize_output_config(), and parse_legacy().

◆ nexus

◆ precision

int realization::config::Output::precision = DEFAULT_PRECISION

Global value precision for text output backends.

Referenced by realization::config::make_catchment_output_mgr(), and parse_block().

◆ root

std::string realization::config::Output::root

Output directory.

Built through from_realization this is the normalized root: a trailing-slash path ("./" when unset). The default constructor and the public parse_block / parse_legacy leave it as the raw configured value. Creating the directory on disk is a separate step – see create_output_directory – performed by the caller near where output is written, so config parsing has no filesystem side effect.

Referenced by from_realization(), realization::config::make_catchment_output_mgr(), parse_block(), and parse_legacy().


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