Template Struct variable_map< bool >

Struct Documentation

template<>
struct blackbird::variable_map<bool>

get and set boolean values in the variable map

Public Static Functions

static inline 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

Parameters
  • V – Blackbird Visitor

  • key – variable name

Throws
  • 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

Returns

integer value

static inline 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 inline 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”)

Throws

invalid_argument – val is not a valid boolean variable