OpenSDN source code
cass::cql::impl::WorkerTask Class Reference
Inheritance diagram for cass::cql::impl::WorkerTask:
Collaboration diagram for cass::cql::impl::WorkerTask:

Public Types

typedef boost::function< void(void)> FunctionPtr
 
- Public Types inherited from Task
enum  State { INIT , WAIT , RUN }
 Task states. More...
 
enum  TbbState { TBB_INIT , TBB_ENQUEUED , TBB_EXEC , TBB_DONE }
 

Public Member Functions

 WorkerTask (FunctionPtr func, int task_id, int task_instance)
 
bool Run ()
 Code to execute. Returns true if task is completed. Return false to reschedule the task. More...
 
std::string Description () const
 
- Public Member Functions inherited from Task
 Task (int task_id, int task_instance)
 
 Task (int task_id)
 
virtual ~Task ()
 
virtual 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...
 
State GetState () const
 
int GetTaskId () const
 
int GetTaskInstance () const
 
uint64_t GetSeqno () const
 
bool task_cancelled () const
 
uint64_t enqueue_time () const
 
uint64_t schedule_time () const
 
uint32_t execute_delay () const
 
uint32_t schedule_delay () const
 

Private Attributes

FunctionPtr func_
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 1828 of file cql_if.cc.

Member Typedef Documentation

◆ FunctionPtr

typedef boost::function<void(void)> cass::cql::impl::WorkerTask::FunctionPtr

Definition at line 1830 of file cql_if.cc.

Constructor & Destructor Documentation

◆ WorkerTask()

cass::cql::impl::WorkerTask::WorkerTask ( FunctionPtr  func,
int  task_id,
int  task_instance 
)
inline

Definition at line 1831 of file cql_if.cc.

Member Function Documentation

◆ Description()

std::string cass::cql::impl::WorkerTask::Description ( ) const
inlinevirtual

Implements Task.

Definition at line 1839 of file cql_if.cc.

◆ Run()

bool cass::cql::impl::WorkerTask::Run ( )
inlinevirtual

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

Implements Task.

Definition at line 1835 of file cql_if.cc.

Member Data Documentation

◆ func_

FunctionPtr cass::cql::impl::WorkerTask::func_
private

Definition at line 1843 of file cql_if.cc.


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