18#ifndef BPMNOS_NUMBER_TYPE
19#define BPMNOS_NUMBER_REP int64_t
20#define BPMNOS_NUMBER_SCALE 16
21#define BPMNOS_NUMBER_TYPE cnl::scaled_integer< BPMNOS_NUMBER_REP, cnl::power<-BPMNOS_NUMBER_SCALE> >
28 return std::hash<BPMNOS_NUMBER_REP>()(cnl::unwrap(value));
36 return std::hash<BPMNOS_NUMBER_REP>()(cnl::unwrap(value));
40#define BPMNOS_NUMBER_PRECISION (1.0 / (1 << BPMNOS_NUMBER_SCALE))
43#ifndef BPMNOS_NUMBER_PRECISION
44#define BPMNOS_NUMBER_PRECISION 1e-6
51 typedef std::unordered_map< std::string, std::optional<number> >
ValueMap;
55 struct Values : std::vector<std::optional<number>> {
58 Values(std::initializer_list<std::optional<number>> init) :
std::vector<
std::optional<
number>>(init) {}
62 struct SharedValues : std::vector< std::reference_wrapper< std::optional<number> > > {
69 typedef std::unordered_map< std::string, std::variant< std::optional<number>, std::string > >
VariedValueMap;
71 double stod(
const std::string& str);
72 int stoi(
const std::string& str);
#define BPMNOS_NUMBER_TYPE
std::unordered_map< std::string, std::optional< number > > ValueMap
std::unordered_map< std::string, std::variant< std::optional< number >, std::string > > VariedValueMap
std::string to_string(number numericValue, const ValueType &type)
Converts a number to a string.
number to_number(const std::string &valueString, const ValueType &type)
Converts a string to a number.
BPMNOS_NUMBER_TYPE number
double stod(const std::string &str)
BPMNOS::Values mergeValues(const std::vector< BPMNOS::Values > &valueSets)
int stoi(const std::string &str)
std::variant< bool, int, double, std::string > Value
Values(std::initializer_list< std::optional< number > > init)
std::size_t operator()(const BPMNOS_NUMBER_TYPE &value) const
std::size_t operator()(const BPMNOS_NUMBER_TYPE &value) const