COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Job.hh>
Classes | |
class | Scheduler |
Public Member Functions | |
Job (Scheduler *scheduler) | |
void | expire_at (uint32_t time) |
void | expire_after (uint32_t time) |
uint32_t | expire_at () const |
int32_t | expire_after () const |
uint32_t | time () const |
bool | is_started () const |
bool | start () |
bool | stop () |
virtual void | on_expired () |
virtual void | on_event (uint8_t type, uint16_t value) |
virtual void | run () |
void | detach () |
Linkage * | succ () const |
Linkage * | pred () const |
void | attach (Linkage *pred) |
Protected Attributes | |
uint32_t | m_expires |
Scheduler * | m_scheduler |
Linkage * | m_succ |
Linkage * | m_pred |
Abstract job class for handling of scheduled functions. The time scale depends on the queue handler (scheduler). There are three levels of queues predefined. The time resolutions are; seconds (Clock), milli-seconds (Watchdog) and micro-seconds (RTT).
|
inline |
|
inlineinherited |
Attach given linkage as predecessor. Will check and detach if already attached.
[in] | pred | linkage to attach. |
Definition at line 71 of file Linkage.hh.
|
inlineinherited |
Detach this link. Unlink from any list.
Definition at line 125 of file Linkage.hh.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Default job event handler; execute the run() virtual member function on timeout event. Event is pushed by on_expired().
[in] | type | the type of event (Typically TIMEOUT_TYPE). |
[in] | value | the event value. |
Reimplemented from Event::Handler.
Reimplemented in ProtoThread, and Periodic.
|
inlinevirtual |
Job member function that is called Scheduler::dispatch() when the job time has expired. This function is normally called from an interrupt service routine. The default implementation will push a timeout event with the job as target. The default event handler will call the job run() virtual member function. Override this function if the job should be executed during the interrupt service routine.
|
inlineinherited |
Return predecessor in sequence.
Definition at line 60 of file Linkage.hh.
|
inlinevirtual |
|
inline |
|
inline |
|
inlineinherited |
|
inline |
|
protected |
|
protectedinherited |
Definition at line 94 of file Linkage.hh.
|
protectedinherited |
Double linked list pointers.
Definition at line 93 of file Linkage.hh.