12 : identifier(utils::validateIdentifier(identifier)),
value(
value)
18 std::ostringstream oss;
20 <<
"identifier: '" <<
identifier <<
"', value: ";
22 oss <<
"<int> " << std::get<int>(
value);
24 oss <<
"<double> " << std::get<double>(
value);
26 oss <<
"<string> \"" << std::get<std::string>(
value) <<
"\"";
29 throw std::runtime_error(
"Invalid assignment value type");
38 return std::holds_alternative<int>(
value);
44 return std::holds_alternative<double>(
value);
50 return std::holds_alternative<std::string>(
value);
Assertion macros and utilities based on the PPK_ASSERT library.
Protocol assignment operation representation.
#define IRSOL_ASSERT_ERROR
Error-level assertion macro.
std::variant< int, double, std::string > protocol_value_t
Variant type representing protocol values that can be one of several types.
Utility functions for protocol string handling and validation in the irsol library.
std::string toString() const
Converts the assignment to a human-readable string.
Assignment(const std::string &identifier, irsol::types::protocol_value_t value)
Constructs an Assignment.
irsol::types::protocol_value_t value
The value assigned to the identifier (int, double, or string).
std::string identifier
The variable or parameter name being assigned.