kyotocabinet::TaskQueue Class Reference

Task queue device. More...

#include <kcthread.h>

List of all members.

Classes

class  Task
 Interface of a task. More...
class  WorkerThread
 Implementation of the worker thread.

Public Member Functions

 TaskQueue ()
 Default Constructor.
virtual ~TaskQueue ()
 Destructor.
virtual void do_task (Task *task)=0
 Process a task.
void start (size_t thnum)
 Start the task queue.
void finish ()
 Finish the task queue.
int64_t add_task (Task *task)
 Add a task.
int64_t count ()
 Get the number of tasks in the queue.

Detailed Description

Task queue device.


Constructor & Destructor Documentation

kyotocabinet::TaskQueue::TaskQueue (  ) 

Default Constructor.

virtual kyotocabinet::TaskQueue::~TaskQueue (  )  [virtual]

Destructor.


Member Function Documentation

virtual void kyotocabinet::TaskQueue::do_task ( Task task  )  [pure virtual]

Process a task.

Parameters:
task a task object.
void kyotocabinet::TaskQueue::start ( size_t  thnum  ) 

Start the task queue.

Parameters:
thnum the number of worker threads.
void kyotocabinet::TaskQueue::finish (  ) 

Finish the task queue.

Note:
This function blocks until all tasks in the queue are popped.
int64_t kyotocabinet::TaskQueue::add_task ( Task task  ) 

Add a task.

Parameters:
task a task object.
Returns:
the number of tasks in the queue.
int64_t kyotocabinet::TaskQueue::count (  ) 

Get the number of tasks in the queue.

Returns:
the number of tasks in the queue.
Generated on Sun Dec 19 12:53:11 2010 for Kyoto Cabinet by  doxygen 1.6.3