7 #ifndef DYNAMIC_GRAPH_COMMAND_SETTER_T_CPP 8 #define DYNAMIC_GRAPH_COMMAND_SETTER_T_CPP 12 #include <boost/assign/list_of.hpp> 41 const std::string &docString)
42 :
Command(entity, boost::assign::list_of(
Value::BOOL), docString),
49 bool value = values[0].value();
50 E &entity =
static_cast<E &
>(
owner());
75 const std::string &docString)
76 :
Command(entity, boost::assign::list_of(
Value::UNSIGNED), docString),
83 unsigned value = values[0].value();
84 E &entity =
static_cast<E &
>(
owner());
109 const std::string &docString)
110 :
Command(entity, boost::assign::list_of(
Value::INT), docString),
117 int value = values[0].value();
118 E &entity =
static_cast<E &
>(
owner());
143 const std::string &docString)
144 :
Command(entity, boost::assign::list_of(
Value::FLOAT), docString),
151 float value = values[0].value();
152 E &entity =
static_cast<E &
>(
owner());
177 const std::string &docString)
178 :
Command(entity, boost::assign::list_of(
Value::DOUBLE), docString),
185 double value = values[0].value();
186 E &entity =
static_cast<E &
>(
owner());
211 const std::string &docString)
212 :
Command(entity, boost::assign::list_of(
Value::STRING), docString),
219 std::string value = values[0].value();
220 E &entity =
static_cast<E &
>(
owner());
245 const std::string &docString)
246 :
Command(entity, boost::assign::list_of(
Value::VECTOR), docString),
253 Vector value = values[0].value();
254 E &entity =
static_cast<E &
>(
owner());
279 const std::string &docString)
280 :
Command(entity, boost::assign::list_of(
Value::MATRIX), docString),
287 Matrix value = values[0].value();
288 E &entity =
static_cast<E &
>(
owner());
296 #endif // DYNAMIC_GRAPH_COMMAND_SETTER_T_CPP
This class implements a variant design pattern to handle basic types in Command.
SetterMethod setterMethod_
Setter(E &entity, SetterMethod setterMethod, const std::string &docString)
Constructor.
SetterMethod setterMethod_
SetterMethod setterMethod_
SetterMethod setterMethod_
void(E::* SetterMethod)(const T &)
Pointer to method that sets parameter of type T.
SetterMethod setterMethod_
SetterMethod setterMethod_
SetterMethod setterMethod_
Entity & owner()
Get a reference to the Entity owning this command.
virtual Value doExecute()
Specific action performed by the command.
const std::vector< Value > & getParameterValues() const
Get parameter values.
SetterMethod setterMethod_
SetterMethod setterMethod_