OpenSDN source code
Timer::TimerTask Class Reference
Inheritance diagram for Timer::TimerTask:
Collaboration diagram for Timer::TimerTask:

Public Member Functions

 TimerTask (TimerPtr timer, boost::system::error_code ec)
 
virtual ~TimerTask ()
 
virtual bool Run ()
 Code to execute in a task. Returns true if task is completed. Return false to reschedule the task. More...
 
void OnTaskCancel ()
 Called on task exit, if it is marked for cancellation. If the user wants to do any cleanup on task cancellation, then he/she can overload this function. More...
 
virtual std::string Description () const
 Gives a description of the task. More...
 
- Public Member Functions inherited from Task
 Task (int task_id, int task_data_id)
 Creates a new task with the given values of task code ID and task data ID. More...
 
 Task (int task_id)
 Creates a new task with the given value of task code ID and wildcard for task data ID. More...
 
virtual ~Task ()
 Destroys a task. More...
 
State state () const
 Returns a state value of a task. More...
 
int task_code_id () const
 Returns the code ID of this task. More...
 
int task_data_id () const
 Returns the data ID of this task. More...
 
uint64_t seqno () const
 Returns the sequence number of this task. More...
 
bool task_cancelled () const
 Returns true if the task has been canceled. More...
 
uint64_t enqueue_time () const
 Returns the time when the task was enqueued for execution. More...
 
uint64_t schedule_time () const
 Returns the time when the task execution was started. More...
 
uint32_t execute_delay () const
 Returns the threshold for the task execution duration. More...
 
uint32_t schedule_delay () const
 Returns the time threshold for time difference between moments when the task was started and when it was enqueue. More...
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (TimerTask)
 

Private Attributes

TimerPtr timer_
 
boost::system::error_code ec_
 

Additional Inherited Members

- Public Types inherited from Task
enum  State { INIT , WAIT , RUN }
 Task states. More...
 
enum  TbbState { TBB_INIT , TBB_ENQUEUED , TBB_EXEC , TBB_DONE }
 Describes states of a task according to TBB library. More...
 
- Static Public Member Functions inherited from Task
static TaskRunning ()
 Returns a pointer to the current task the code is executing under. More...
 
- Static Public Attributes inherited from Task
static const int kTaskInstanceAny = -1
 Specifies value for wildcard (any or *) task data ID. More...
 

Detailed Description

Definition at line 8 of file timer.cc.

Constructor & Destructor Documentation

◆ TimerTask()

Timer::TimerTask::TimerTask ( TimerPtr  timer,
boost::system::error_code  ec 
)
inline

Definition at line 10 of file timer.cc.

◆ ~TimerTask()

virtual Timer::TimerTask::~TimerTask ( )
inlinevirtual

Definition at line 14 of file timer.cc.

Member Function Documentation

◆ Description()

virtual std::string Timer::TimerTask::Description ( ) const
inlinevirtual

Gives a description of the task.

Implements Task.

Definition at line 72 of file timer.cc.

◆ DISALLOW_COPY_AND_ASSIGN()

Timer::TimerTask::DISALLOW_COPY_AND_ASSIGN ( TimerTask  )
private

◆ OnTaskCancel()

void Timer::TimerTask::OnTaskCancel ( )
inlinevirtual

Called on task exit, if it is marked for cancellation. If the user wants to do any cleanup on task cancellation, then he/she can overload this function.

Reimplemented from Task.

Definition at line 58 of file timer.cc.

◆ Run()

virtual bool Timer::TimerTask::Run ( )
inlinevirtual

Code to execute in a task. Returns true if task is completed. Return false to reschedule the task.

Implements Task.

Definition at line 19 of file timer.cc.

Here is the call graph for this function:

Member Data Documentation

◆ ec_

boost::system::error_code Timer::TimerTask::ec_
private

Definition at line 78 of file timer.cc.

◆ timer_

TimerPtr Timer::TimerTask::timer_
private

Definition at line 77 of file timer.cc.


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