9 #ifndef _DIADES__SDMDL_EXPERIMENTAL__ASSIGNMENT__HH__ 10 #define _DIADES__SDMDL_EXPERIMENTAL__ASSIGNMENT__HH__ 18 namespace Experimental
54 return "Sdmdl::Experimental::Assignment";
106 return (_variable.size()==1) && (_value.size()==1)
107 && (!_variable[0].
get().isNull()) && (!_value[0].
get().isNull())
108 && (_variable[0].
get().contains(_value[0].
get()));
123 _variable.push_back(var);
124 _value.push_back(val);
136 _variable.emplace_back(assignment.
variable());
138 if(assignment.
_value.size()==1)
140 _value.emplace_back(assignment.
value());
151 if(assignment._variable.size()==1)
153 _variable.emplace_back(assignment.variable());
155 if(assignment._value.size()==1)
157 _value.emplace_back(assignment.value());
187 _variable.push_back(var);
204 if((_variable.size()==1) && (!_variable[0].
get().isNull()))
206 if(!val.
isNull() && _variable[0].get().contains(val))
209 _value.push_back(val);
224 return _variable[0].get();
236 return _value[0].get();
253 _variable.push_back(assign.
variable());
256 if(assign.
_value.size()==1)
258 _value.push_back(assign.
value());
307 os <<
"INVALID_ASSIGNMENT";
std::reference_wrapper< Value const > ConstValReference
const Value & defaultValue() const
friend ostream & operator<<(ostream &os, const Assignment &assign)
Assignment(const Assignment &&assignment)
std::reference_wrapper< Variable const > ConstVarReference
Assignment & operator=(const Assignment &assign)
std::vector< ConstValReference > ValVector
void setVariable(const Variable &var)
#define require(Exception, expr, message)
Namespace of the Diades project.
std::vector< ConstVarReference > VarVector
const Variable & variable() const
const Value & value() const
Assignment(const Assignment &assignment)
Assignment(const Variable &var, const Value &val)
bool operator==(const Assignment &assignment) const
void setValue(const Value &val)