task-command.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * Florent Lamiraux
4  *
5  * CNRS
6  *
7  */
8 
9 #ifndef TASK_COMMAND_H
10 #define TASK_COMMAND_H
11 
14 #include <dynamic-graph/command.h>
15 
16 #include <boost/assign/list_of.hpp>
17 
18 namespace dynamicgraph {
19 namespace sot {
20 namespace command {
21 namespace task {
22 using ::dynamicgraph::command::Command;
23 using ::dynamicgraph::command::Value;
24 
25 // Command ListFeatures
26 class ListFeatures : public Command {
27  public:
28  virtual ~ListFeatures() {}
32  ListFeatures(Task &entity, const std::string &docstring)
33  : Command(entity, std::vector<Value::Type>(), docstring) {}
34  virtual Value doExecute() {
35  typedef Task::FeatureList_t FeatureList_t;
36  Task &task = static_cast<Task &>(owner());
37  const FeatureList_t &fl = task.getFeatureList();
38  std::string result("[");
39  for (FeatureList_t::const_iterator it = fl.begin(); it != fl.end(); it++) {
40  result += "'" + (*it)->getName() + "',";
41  }
42  result += "]";
43  return Value(result);
44  }
45 }; // class ListFeatures
46 } // namespace task
47 } // namespace command
48 } /* namespace sot */
49 } /* namespace dynamicgraph */
50 
51 #endif // TASK_COMMAND_H
dynamicgraph::sot::Task::FeatureList_t
std::list< FeatureAbstract * > FeatureList_t
Definition: task.hh:74
dynamicgraph
command-getter.h
dynamicgraph::sot::command::task::ListFeatures
Definition: task-command.h:26
command-setter.h
dynamicgraph::sot::command::task::ListFeatures::doExecute
virtual Value doExecute()
Definition: task-command.h:34
dynamicgraph::sot::Task::getFeatureList
FeatureList_t & getFeatureList(void)
Definition: task.hh:89
dynamicgraph::command::Command
dynamicgraph::sot::command::task::ListFeatures::~ListFeatures
virtual ~ListFeatures()
Definition: task-command.h:28
dynamicgraph::sot::command::task::ListFeatures::ListFeatures
ListFeatures(Task &entity, const std::string &docstring)
Definition: task-command.h:32
dynamicgraph::sot::Task
Class that defines the basic elements of a task.
Definition: task.hh:72
Type
Eigen::Block< Mat > Type
command.h
dynamicgraph::command::Value
dynamicgraph::command::Command::owner
Entity & owner()


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31