HOPS
HOPS class reference
Static Public Member Functions | List of all members
hops::MHO_PlotDataExtractor Class Reference

Utility class for extracting and processing plot data from JSON. More...

#include <MHO_PlotDataExtractor.hh>

Static Public Member Functions

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)
 

Detailed Description

Utility class for extracting and processing plot data from JSON.

Member Function Documentation

◆ 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
sizeSize 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_dictJSON object containing plot data
keyKey to extract
default_valueDefault 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_dictJSON object containing plot data
keyKey to extract
default_valueDefault 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_dictJSON object containing plot data
keyKey to extract
default_valueDefault 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_dictJSON object containing plot data
keyKey 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
valueValue to format
precisionNumber 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: