F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TaskInterface.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Interfaces/TaskInterface.hpp
3 // \brief pure-virtual interface implemented by Os::Task implementations
4 // ======================================================================
5 #ifndef OS_INTERFACES_TASKINTERFACE_HPP_
6 #define OS_INTERFACES_TASKINTERFACE_HPP_
7 
9 
10 namespace Os {
11 
13  public:
15  TaskInterface() = default;
16 
18  virtual ~TaskInterface() = default;
19 
21  TaskInterface(const TaskInterface& other) = delete;
22 
24  TaskInterface& operator=(const TaskInterface& other) = delete;
25 
26  // =================
27  // Implementation functions (static) to be supplied by the linker
28  // =================
29 
30  // =================
31  // Implementation functions (instance) to be supplied by the Os::TaskInterface children
32  // =================
33 
35  virtual void onStart() = 0;
36 
43  virtual Status join() = 0;
44 
52  virtual void suspend(SuspensionType suspensionType) = 0;
53 
58  virtual void resume() = 0;
59 
67  virtual Status _delay(const Fw::TimeInterval& interval) = 0;
68 
78  virtual bool isCooperative() = 0;
79 
82  virtual TaskHandle* getHandle() = 0;
83 
90  virtual Status start(const Arguments& arguments) = 0;
91 };
92 
93 } // namespace Os
94 
95 #endif // OS_INTERFACES_TASKINTERFACE_HPP_
virtual ~TaskInterface()=default
default virtual destructor
Task handle representation.
virtual void resume()=0
resume a suspended task
virtual Status join()=0
block until the task has ended
virtual void onStart()=0
perform required task start actions
types and constants shared by users of Os::Task and by its implementations
virtual void suspend(SuspensionType suspensionType)=0
suspend the task given the suspension type
virtual Status start(const Arguments &arguments)=0
start the task
TaskInterface()=default
default constructor
virtual Status _delay(const Fw::TimeInterval &interval)=0
delay the currently scheduled task using the given architecture
virtual bool isCooperative()=0
determine if the task requires cooperative multitasking
TaskInterface & operator=(const TaskInterface &other)=delete
assignment operator is forbidden
virtual TaskHandle * getHandle()=0
return the underlying task handle (implementation specific)