@@ -11,36 +11,48 @@ class Process
1111{
1212 friend class Scheduler ;
1313public:
14- Process (Scheduler &manager, ProcPriority priority, unsigned int period,
14+ Process (Scheduler &manager, ProcPriority priority, uint32_t period,
1515 int iterations=RUNTIME_FOREVER,
1616 int16_t overSchedThresh = OVERSCHEDULED_NO_WARNING);
1717
18- int getID ();
19- inline Scheduler &scheduler () { return _scheduler; }
18+ // /////////////////// PROCESS OPERATIONS /////////////////////////
2019 bool add (bool enableIfNot=false );
2120 bool disable ();
2221 bool enable ();
2322 bool destroy ();
2423
25- inline int32_t timeToNextRun () { return (_scheduledTS + _period) - _scheduler.getCurrTS (); }
26- inline uint32_t getScheduledTS () { return _scheduledTS; } // The ts the most recent iteration should of started
27- inline uint32_t getActualRunTS () { return _actualTS; }
24+ // /////////////////// GETTERS /////////////////////////
25+ inline Scheduler &scheduler () { return _scheduler; }
2826
27+ inline uint8_t getID () { return _sid; };
2928 inline bool isEnabled () { return _enabled; }
3029 inline bool isNotDestroyed () { return _scheduler.isNotDestroyed (*this ); }
30+
3131 inline int getIterations () { return _iterations; } // might return RUNTIME_FOREVER
3232 inline unsigned int getPeriod () { return _period; }
3333
34- inline void force () { _force = true ; }
34+ inline ProcPriority getPriority () { return _pLevel; }
35+
36+ inline int32_t timeToNextRun () { return (_scheduledTS + _period) - _scheduler.getCurrTS (); }
37+ inline uint32_t getActualRunTS () { return _actualTS; }
38+ inline uint32_t getScheduledTS () { return _scheduledTS; } // The ts the most recent iteration should of started
3539
36- inline void resetOverSchedWarning () { _pBehind = 0 ; }
3740 inline uint16_t getOverSchedThresh () { return _overSchedThresh; }
3841 inline uint16_t getCurrPBehind () { return _pBehind; }
3942
40- inline ProcPriority getPriority () { return _pLevel; }
43+ // /////////////////// SETTERS /////////////////////////
44+ inline void setIterations (int iterations) { _iterations = iterations; }
45+ inline void setPeriod (uint32_t period) { _period = period; }
46+ inline void force () { _force = true ; }
47+
48+ inline void resetOverSchedWarning () { _pBehind = 0 ; }
49+
4150
4251protected:
52+ // /////////////////// GETTERS /////////////////////////
4353 inline uint32_t getStartDelay () { return _actualTS - _scheduledTS; }
54+
55+ // /////////////////// VIRTUAL FUNCTIONS /////////////////////////
4456 // Fired on creation/destroy
4557 virtual void setup ();
4658 virtual void cleanup ();
0 commit comments