Honeycomb
0.1
Component-Model Framework
|
Holds a functor and period information, returned by scheduler. More...
#include <PeriodicTask.h>
Public Types | |
typedef SharedPtr< PeriodicTask_ > | Ptr |
Public Types inherited from honey::PeriodicTask | |
typedef SharedPtr< PeriodicTask > | Ptr |
typedef function< void()> | Func |
Public Member Functions | |
Future< Result > | future () |
Get future from which delayed result can be retrieved. More... | |
Public Member Functions inherited from honey::PeriodicTask | |
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 () |
Wrapper for PeriodicTask::current() More... | |
Static Public Member Functions inherited from honey::PeriodicTask | |
static PeriodicTask & | current () |
Get the current task object. Must be called from a task functor. More... | |
Friends | |
class | PeriodicSched |
Additional Inherited Members | |
Protected Types inherited from honey::PeriodicTask | |
enum | State { State::idle, State::wait, State::exec } |
Protected Member Functions inherited from honey::PeriodicTask | |
PeriodicTask (PeriodicSched &sched, optional< MonoClock::Duration > period, optional< MonoClock::Duration > delay, const Id &id) | |
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 inherited from honey::PeriodicTask | |
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 |
Holds a functor and period information, returned by scheduler.
typedef SharedPtr<PeriodicTask_> honey::PeriodicTask_< Result >::Ptr |
|
inlinestatic |
Wrapper for PeriodicTask::current()
|
inline |
Get future from which delayed result can be retrieved.
future::FutureAlreadyRetrieved | if future() has been called more than once per task execution |
|
friend |