Template Struct variable_map< bool >

Struct Documentation

template<>
struct variable_map<bool>

get and set boolean values in the variable map

Public Static Functions

static bool getVal(Visitor *V, std::string key)

Get value from the variable map corresponding to a name, and attempt to convert it into an bool

Return
integer value
Parameters
  • V: Blackbird Visitor
  • key: variable name
Exceptions
  • invalid_argument: Cannot convert a complex variable to an bool
  • invalid_argument: Cannot convert a int variable to an bool
  • invalid_argument: Cannot convert a float variable to an bool
  • invalid_argument: Cannot convert a string variable to an bool
  • invalid_argument: Variable key not defined

static void setVal(Visitor *V, std::string key, bool val)

Set a bool value in the variable map corresponding to a name

Parameters
  • V: Blackbird Visitor
  • key: variable name
  • val: variable value

static void setVal(Visitor *V, std::string key, std::string val)

Set a string value representing a boolean in the variable map corresponding to a name

Parameters
  • V: Blackbird Visitor
  • key: variable name
  • val: variable value (either “True” or “False”)
Exceptions
  • invalid_argument: val is not a valid boolean variable