24 #ifndef SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_INTERFACE_H_ 25 #define SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_INTERFACE_H_ 31 #ifdef MESSAGE_SUPPORT 32 #include <corbo-communication/messages/tasks/tasks.pb.h> 63 using Ptr = std::shared_ptr<TaskInterface>;
76 const std::string& ns =
"") = 0;
92 virtual bool verify(
const Environment& environment, std::string* msg =
nullptr)
const = 0;
106 virtual void reset() = 0;
108 #ifdef MESSAGE_SUPPORT 109 virtual void toMessage(messages::Task& message)
const {}
112 virtual void fromMessage(
const messages::Task& message, std::stringstream* issues =
nullptr) {}
117 #define FACTORY_REGISTER_TASK(type) FACTORY_REGISTER_OBJECT(type, TaskInterface) 121 #endif // SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_INTERFACE_H_ virtual void performTask(Environment &environment, SignalTargetInterface *signal_target=nullptr, std::string *msg=nullptr, const std::string &ns="")=0
Perform task.
virtual ~TaskInterface()
Virtuel destructor.
Standard environment for control tasks.
virtual bool verify(const Environment &environment, std::string *msg=nullptr) const =0
Check if the environment and other settings satisfy all requirements for the given task...
std::shared_ptr< TaskInterface > Ptr
Interface class for signal targets.
virtual Ptr getInstance() const =0
Return a newly created shared instance of the implemented class.
virtual void reset()=0
Reset task state.
virtual void getAvailableSignals(const Environment &environment, SignalTargetInterface &signal_target, const std::string &ns="") const
Retrieve available signals from the task.
Interface class for tasks.