Utility class for extracting and processing plot data from JSON.
More...
#include <MHO_PlotDataExtractor.hh>
|
| static std::vector< double > | create_index_vector (size_t size) |
| | Creates an index vector (0, 1, 2, ..., size-1) More...
|
| |
| static double | extract_double (const mho_json &plot_dict, const std::string &key, double default_value=0.0) |
| | Extracts double value from JSON with fallback. More...
|
| |
| static int | extract_int (const mho_json &plot_dict, const std::string &key, int default_value=0) |
| | Extracts integer value from JSON with fallback. More...
|
| |
| static std::string | extract_string (const mho_json &plot_dict, const std::string &key, const std::string &default_value="") |
| | Extracts string value from JSON with fallback. More...
|
| |
| static std::vector< double > | extract_vector (const mho_json &plot_dict, const std::string &key) |
| | Extracts a vector of doubles from JSON plot dictionary. More...
|
| |
| static std::string | format_scientific (double value, int precision=3) |
| | Formats a double as scientific notation string. More...
|
| |
| static std::string | format_standard (double value, int minDigits, int roundPlaces) |
| |
Utility class for extracting and processing plot data from JSON.
◆ create_index_vector()
| std::vector< double > hops::MHO_PlotDataExtractor::create_index_vector |
( |
size_t |
size | ) |
|
|
static |
Creates an index vector (0, 1, 2, ..., size-1)
- Parameters
-
| size | Size of the index vector to create |
- Returns
- Vector containing sequential indices
◆ extract_double()
| double hops::MHO_PlotDataExtractor::extract_double |
( |
const mho_json & |
plot_dict, |
|
|
const std::string & |
key, |
|
|
double |
default_value = 0.0 |
|
) |
| |
|
static |
Extracts double value from JSON with fallback.
- Parameters
-
| plot_dict | JSON object containing plot data |
| key | Key to extract |
| default_value | Default value if key not found |
- Returns
- Double value
◆ extract_int()
| int hops::MHO_PlotDataExtractor::extract_int |
( |
const mho_json & |
plot_dict, |
|
|
const std::string & |
key, |
|
|
int |
default_value = 0 |
|
) |
| |
|
static |
Extracts integer value from JSON with fallback.
- Parameters
-
| plot_dict | JSON object containing plot data |
| key | Key to extract |
| default_value | Default value if key not found |
- Returns
- Integer value
◆ extract_string()
| std::string hops::MHO_PlotDataExtractor::extract_string |
( |
const mho_json & |
plot_dict, |
|
|
const std::string & |
key, |
|
|
const std::string & |
default_value = "" |
|
) |
| |
|
static |
Extracts string value from JSON with fallback.
- Parameters
-
| plot_dict | JSON object containing plot data |
| key | Key to extract |
| default_value | Default value if key not found |
- Returns
- String value
◆ extract_vector()
| std::vector< double > hops::MHO_PlotDataExtractor::extract_vector |
( |
const mho_json & |
plot_dict, |
|
|
const std::string & |
key |
|
) |
| |
|
static |
Extracts a vector of doubles from JSON plot dictionary.
- Parameters
-
| plot_dict | JSON object containing plot data |
| key | Key to extract from the JSON object |
- Returns
- Vector of doubles, empty if key not found
◆ format_scientific()
| std::string hops::MHO_PlotDataExtractor::format_scientific |
( |
double |
value, |
|
|
int |
precision = 3 |
|
) |
| |
|
static |
Formats a double as scientific notation string.
- Parameters
-
| value | Value to format |
| precision | Number of decimal places |
- Returns
- Formatted string
◆ format_standard()
| std::string hops::MHO_PlotDataExtractor::format_standard |
( |
double |
value, |
|
|
int |
minDigits, |
|
|
int |
roundPlaces |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: