11 #ifndef WRENCH_UNITPARSER_H
12 #define WRENCH_UNITPARSER_H
14 #include <unordered_map>
34 class unit_scale :
public std::unordered_map<std::string, double> {
36 using std::unordered_map<std::string, double>::unordered_map;
38 explicit unit_scale(std::initializer_list<std::tuple<const std::string, double, int, bool>> generators);
42 static double parseValueWithUnit(std::string
string,
const unit_scale &units,
const char *default_unit);
57 #endif //WRENCH_UNITPARSER_H
static double parse_compute_speed(std::string string)
Given a string compute speed specification with units (e.g., "3f", "10Gf") return the size in bytes.
Definition: UnitParser.cpp:120
A class used to part string specification of values with units into a single value (e....
Definition: UnitParser.h:28
static double parse_size(std::string string)
Given a string size specification with units (e.g., "13Mb") return the size in bytes.
Definition: UnitParser.cpp:98