|
Honeycomb
0.1
Component-Model Framework
|
Base class of PeriodicTask_, returned by scheduler.
More...
#include <PeriodicTask.h>


Classes | |
| struct | Cancelled |
| Future result when cancelled. More... | |
Public Types | |
| typedef SharedPtr< PeriodicTask > | Ptr |
| typedef function< void()> | Func |
Public Member Functions | |
| virtual | ~PeriodicTask () |
| bool | active () const |
| Check if task is scheduled or executing. More... | |
| MonoClock::Duration | delay () const |
| Returns time remaining until task is due for execution (task is due at zero time or less) More... | |
| void | cancel () |
| Unschedule task from further execution. If the task is awaiting execution then its future will throw exception Cancelled. More... | |
| void | interrupt (const Exception::ConstPtr &e=new thread::Interrupted) |
| Request an interrupt in the executing task's thread. More... | |
| bool | interruptRequested () |
| Check whether an interrupt has been requested for the executing task's thread. More... | |
| void | setPriority (int priority) |
| Set task's thread execution scheduling priority. More... | |
| int | getPriority () const |
| Get task's thread execution scheduling priority. More... | |
| const Id & | id () const |
| Get id used for debug output. More... | |
| String | info () const |
| Get task info for prepending to a log record. More... | |
Public Member Functions inherited from honey::SharedObj< PeriodicTask > | |
| SharedObj (Alloc &&a=Alloc()) debug_if( | |
| Construct with allocator that is called to deallocate this shared object when all references have been released. More... | |
Static Public Member Functions | |
| static PeriodicTask & | current () |
| Get the current task object. Must be called from a task functor. More... | |
Protected Types | |
| enum | State { State::idle, State::wait, State::exec } |
Protected Member Functions | |
| PeriodicTask (PeriodicSched &sched, optional< MonoClock::Duration > period, optional< MonoClock::Duration > delay, const Id &id) | |
| virtual void | exec ()=0 |
| virtual void | readyFunctor (bool reset)=0 |
| virtual void | cancelFunctor ()=0 |
| void | operator() () |
| virtual void | trace (const String &file, int line, const String &msg) const |
| virtual bool | traceEnabled () const |
Protected Member Functions inherited from honey::SharedObj< PeriodicTask > | |
| void | finalize () |
| Destroys object. Called when strong reference count reaches 0. May be overridden to prevent destruction. More... | |
Protected Attributes | |
| PeriodicSched & | _sched |
| optional< MonoClock::Duration > | _period |
| optional< MonoClock::Duration > | _delay |
| Id | _id |
| Mutex | _lock |
| Ptr | _self |
| Atomic< State > | _state |
| Atomic< MonoClock::TimePoint > | _due |
| bool | _cancelled |
| Thread * | _thread |
| int | _priority |
Friends | |
| class | PeriodicSched |
| struct | mt::Funcptr< void()> |
Base class of PeriodicTask_, returned by scheduler.
| typedef function<void ()> honey::PeriodicTask::Func |
|
strongprotected |
|
inlinevirtual |
|
protected |
|
inline |
Check if task is scheduled or executing.
| void honey::PeriodicTask::cancel | ( | ) |
Unschedule task from further execution. If the task is awaiting execution then its future will throw exception Cancelled.
|
protectedpure virtual |
|
static |
Get the current task object. Must be called from a task functor.
|
inline |
Returns time remaining until task is due for execution (task is due at zero time or less)
|
protectedpure virtual |
|
inline |
Get task's thread execution scheduling priority.
|
inline |
Get id used for debug output.
| String honey::PeriodicTask::info | ( | ) | const |
Get task info for prepending to a log record.
|
inline |
Request an interrupt in the executing task's thread.
|
inline |
Check whether an interrupt has been requested for the executing task's thread.
|
protected |
|
protectedpure virtual |
|
inline |
Set task's thread execution scheduling priority.
|
protectedvirtual |
Reimplemented from honey::thread::Pool::Task.
|
inlineprotectedvirtual |
Reimplemented from honey::thread::Pool::Task.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.10