Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
honey::PeriodicTask_< Result > Class Template Reference

Holds a functor and period information, returned by scheduler. More...

#include <PeriodicTask.h>

Inheritance diagram for honey::PeriodicTask_< Result >:
Inheritance graph
[legend]
Collaboration diagram for honey::PeriodicTask_< Result >:
Collaboration graph
[legend]

Public Types

typedef SharedPtr< PeriodicTask_Ptr
 
- Public Types inherited from honey::PeriodicTask
typedef SharedPtr< PeriodicTaskPtr
 
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 Idid () 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 PeriodicTaskcurrent ()
 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
 

Detailed Description

template<class Result>
class honey::PeriodicTask_< Result >

Holds a functor and period information, returned by scheduler.

See also
PeriodicSched

Member Typedef Documentation

template<class Result >
typedef SharedPtr<PeriodicTask_> honey::PeriodicTask_< Result >::Ptr

Member Function Documentation

template<class Result >
static PeriodicTask_& honey::PeriodicTask_< Result >::current ( )
inlinestatic
template<class Result >
Future<Result> honey::PeriodicTask_< Result >::future ( )
inline

Get future from which delayed result can be retrieved.

Exceptions
future::FutureAlreadyRetrievedif future() has been called more than once per task execution

Friends And Related Function Documentation

template<class Result >
friend class PeriodicSched
friend

The documentation for this class was generated from the following file: