parport
Task.hpp
Go to the documentation of this file.
1 #ifndef __PARPORT_TASK_TASK_HPP__
2 #define __PARPORT_TASK_TASK_HPP__
3 
4 #include "parport/TaskBase.hpp"
5 #include <parport.hh>
6 #include <rtt/InputPort.hpp>
7 #include <rtt/OutputPort.hpp>
8 
9 namespace parport
10 {
11  class Task : public TaskBase
12  {
13  friend class TaskBase;
14 
15  private:
16  struct PinMapping
17  {
18  std::string name;
19  int pin;
20  RTT::OutputPort<parport::StateChange>* output;
21  RTT::InputPort<parport::StateChange>* input;
22  };
23  typedef std::vector<PinMapping> PinMappings;
24  PinMappings m_pin_mappings;
25  protected:
26  ParportDriver *m_driver;
27 
28  bool watch_pin(std::string const &name, int pin);
29  public:
30  Task(std::string const& name = "parport::Task");
31  ~Task();
32 
46  bool configureHook();
47 
53  // bool startHook();
54 
74  void updateHook();
75 
82  // void errorHook();
83 
87  // void stopHook();
88 
93  // void cleanupHook();
94  };
95 }
96 
97 #endif /*__PARPORT_TASK_TASK_HPP__*/
98 
Task(std::string const &name="parport::Task")
Definition: Task.cpp:6
friend class TaskBase
Definition: Task.hpp:13
ParportDriver * m_driver
Definition: Task.hpp:26
Definition: parportTypes.hh:7
void updateHook()
This hook is called by Orocos when the state machine transitions from Stopped to Running.
Definition: Task.cpp:61
Definition: Task.hpp:11
~Task()
Definition: Task.cpp:11
bool configureHook()
This hook is called by Orocos when the state machine transitions from PreOperational to Stopped...
Definition: Task.cpp:48
bool watch_pin(std::string const &name, int pin)
Definition: Task.cpp:22