20 const std::string &docstring)
28 const std::vector<Value::Type> ¶mTypes =
valueTypes();
30 if (values.size() != paramTypes.size()) {
32 "wrong number of parameters");
35 for (
unsigned int iParam = 0; iParam < values.size(); iParam++) {
36 if (values[iParam].type() != paramTypes[iParam]) {
38 ss <<
"argument " << iParam
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
This class implements a variant design pattern to handle basic types in Command.
Command(Entity &entity, const std::vector< Value::Type > &valueTypes, const std::string &docstring)
void setParameterValues(const std::vector< Value > &values)
Set parameter values.
virtual Value doExecute()=0
Specific action performed by the command.
std::vector< Value::Type > valueTypeVector_
Value execute()
Execute the command after checking parameters.
Abstract root class for all dynamic-graph exceptions.
static const std::vector< Value::Type > EMPTY_ARG
std::vector< Value > valueVector_
Entity & owner()
Get a reference to the Entity owning this command.
std::string getDocstring() const
Get documentation string.
const std::vector< Value > & getParameterValues() const
Get parameter values.
const std::vector< Value::Type > & valueTypes() const
Return the value type of all parameters.
static std::string typeName(Type type)
Return the name of the type.