distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
RunnableThread.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_RUNNABLETHREAD_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_RUNNABLETHREAD_HPP_
14 
15 #include "distortos/Thread.hpp"
16 
17 namespace distortos
18 {
19 
20 namespace internal
21 {
22 
24 class RunnableThread : public Thread
25 {
26  friend void threadExiter(RunnableThread&);
27  friend void threadRunner(RunnableThread&);
28 
29 protected:
30 
37  virtual void exit0Hook() = 0;
38 
45  virtual void exit1Hook() = 0;
46 
51  virtual void run() = 0;
52 };
53 
54 } // namespace internal
55 
56 } // namespace distortos
57 
58 #endif // INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_RUNNABLETHREAD_HPP_
RunnableThread class defines additional interface functions required for the thread to be actually ru...
Definition: RunnableThread.hpp:24
virtual void exit1Hook()=0
Thread's "exit 1" hook function.
virtual void exit0Hook()=0
Thread's "exit 0" hook function.
Top-level namespace of distortos project.
Definition: buttons.hpp:33
virtual void run()=0
Thread's "run" function.
friend void threadExiter(RunnableThread &)
Thread "exiter" function.
Definition: threadExiter.cpp:31
Thread class header.
friend void threadRunner(RunnableThread &)
Thread runner function - entry point of threads.
Definition: threadRunner.cpp:27
Thread class is a pure abstract interface for threads.
Definition: Thread.hpp:34