Skip to content

Commit e0070fb

Browse files
committed
Add Task.hpp and Task.cpp, which are generated from the specification
1 parent 246808f commit e0070fb

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed

tasks/Task.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* Generated from orogen/lib/orogen/templates/tasks/Task.cpp */
2+
3+
#include "Task.hpp"
4+
5+
using namespace message_consumer;
6+
7+
Task::Task(std::string const& name, TaskCore::TaskState initial_state)
8+
: TaskBase(name, initial_state)
9+
{
10+
}
11+
12+
Task::Task(std::string const& name, RTT::ExecutionEngine* engine, TaskCore::TaskState initial_state)
13+
: TaskBase(name, engine, initial_state)
14+
{
15+
}
16+
17+
Task::~Task()
18+
{
19+
}
20+
21+
22+
23+
/// The following lines are template definitions for the various state machine
24+
// hooks defined by Orocos::RTT. See Task.hpp for more detailed
25+
// documentation about them.
26+
27+
// bool Task::configureHook()
28+
// {
29+
// if (! TaskBase::configureHook())
30+
// return false;
31+
// return true;
32+
// }
33+
// bool Task::startHook()
34+
// {
35+
// if (! TaskBase::startHook())
36+
// return false;
37+
// return true;
38+
// }
39+
// void Task::updateHook()
40+
// {
41+
// TaskBase::updateHook();
42+
// }
43+
// void Task::errorHook()
44+
// {
45+
// TaskBase::errorHook();
46+
// }
47+
// void Task::stopHook()
48+
// {
49+
// TaskBase::stopHook();
50+
// }
51+
// void Task::cleanupHook()
52+
// {
53+
// TaskBase::cleanupHook();
54+
// }
55+

tasks/Task.hpp

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/* Generated from orogen/lib/orogen/templates/tasks/Task.hpp */
2+
3+
#ifndef MESSAGE_CONSUMER_TASK_TASK_HPP
4+
#define MESSAGE_CONSUMER_TASK_TASK_HPP
5+
6+
#include "message_consumer/TaskBase.hpp"
7+
8+
namespace message_consumer {
9+
class Task : public TaskBase
10+
{
11+
friend class TaskBase;
12+
protected:
13+
14+
15+
16+
public:
17+
Task(std::string const& name = "message_consumer::Task", TaskCore::TaskState initial_state = Stopped);
18+
Task(std::string const& name, RTT::ExecutionEngine* engine, TaskCore::TaskState initial_state = Stopped);
19+
20+
~Task();
21+
22+
/** This hook is called by Orocos when the state machine transitions
23+
* from PreOperational to Stopped. If it returns false, then the
24+
* component will stay in PreOperational. Otherwise, it goes into
25+
* Stopped.
26+
*
27+
* It is meaningful only if the #needs_configuration has been specified
28+
* in the task context definition with (for example):
29+
*
30+
* task_context "TaskName" do
31+
* needs_configuration
32+
* ...
33+
* end
34+
*/
35+
// bool configureHook();
36+
37+
/** This hook is called by Orocos when the state machine transitions
38+
* from Stopped to Running. If it returns false, then the component will
39+
* stay in Stopped. Otherwise, it goes into Running and updateHook()
40+
* will be called.
41+
*/
42+
// bool startHook();
43+
44+
/** This hook is called by Orocos when the component is in the Running
45+
* state, at each activity step. Here, the activity gives the "ticks"
46+
* when the hook should be called.
47+
*
48+
* The error(), exception() and fatal() calls, when called in this hook,
49+
* allow to get into the associated RunTimeError, Exception and
50+
* FatalError states.
51+
*
52+
* In the first case, updateHook() is still called, and recover() allows
53+
* you to go back into the Running state. In the second case, the
54+
* errorHook() will be called instead of updateHook(). In Exception, the
55+
* component is stopped and recover() needs to be called before starting
56+
* it again. Finally, FatalError cannot be recovered.
57+
*/
58+
// void updateHook();
59+
60+
/** This hook is called by Orocos when the component is in the
61+
* RunTimeError state, at each activity step. See the discussion in
62+
* updateHook() about triggering options.
63+
*
64+
* Call recover() to go back in the Runtime state.
65+
*/
66+
// void errorHook();
67+
68+
/** This hook is called by Orocos when the state machine transitions
69+
* from Running to Stopped after stop() has been called.
70+
*/
71+
// void stopHook();
72+
73+
/** This hook is called by Orocos when the state machine transitions
74+
* from Stopped to PreOperational, requiring the call to configureHook()
75+
* before calling start() again.
76+
*/
77+
// void cleanupHook();
78+
};
79+
}
80+
81+
#endif
82+

0 commit comments

Comments
 (0)