OpenDaVINCI  4.16.0
RealtimeRunnable.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_REALTIMERUNNABLE_H_
21 #define OPENDAVINCI_CORE_WRAPPER_REALTIMERUNNABLE_H_
22 
25 
26 namespace odcore {
27  namespace wrapper {
28 
29  using namespace std;
30 
75  private:
76  // Internal contants.
77  enum {
78  MICROSECOND = 1000, // 1000 nanoseconds are one microsecond.
79  MILLISECOND = 1000 * MICROSECOND, // 1000 microseconds are one millisecond.
80  SECOND = 1000 * MILLISECOND, // 1000 milliseconds are one second.
81 
82  REALTIME_PRIORITY = 49 // PREMPT_RT use 50 for kernel tasklets and interrupt handler.
83  };
84 
91 
97  RealtimeRunnable& operator=(const RealtimeRunnable &);
98 
99  protected:
105  RealtimeRunnable(const uint32_t &periodInMicroseconds);
106 
111  virtual void nextTimeSlice() = 0;
112 
113  public:
114  virtual ~RealtimeRunnable();
115 
116  private:
117  uint32_t m_periodInMicroseconds;
118 
119  virtual void run();
120  };
121 
122  }
123 } // odcore::wrapper
124 
125 #endif /*OPENDAVINCI_CORE_WRAPPER_REALTIMERUNNABLE_H_*/
Definition: RealtimeRunnable.h:74
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: Runnable.h:35