threadpool Overview | Reference | Tutorial | Examples | Design
Reference Class List | Member Functions | Typedefs | File List

boost::threadpool::lifo_scheduler< Task > Class Template Reference

List of all members.

Detailed Description

template<typename Task = task_func>
class boost::threadpool::lifo_scheduler< Task >

SchedulingPolicy which implements LIFO ordering.

This container implements a LIFO scheduling policy. The last task to be added to the scheduler will be the first to be removed. LIFO stands for "last in, first out".

Parameters:
Task A function object which implements the operator()(void).

Definition at line 118 of file scheduling_policies.hpp.

Public Types

typedef Task task_type

Public Member Functions

void clear ()
bool empty () const
void pop ()
bool push (task_type const &task)
size_t size () const
task_type const & top () const

Protected Attributes

std::deque< task_typem_container


Member Typedef Documentation

template<typename Task = task_func>
typedef Task boost::threadpool::lifo_scheduler< Task >::task_type
 

Indicates the scheduler's task type.

Definition at line 121 of file scheduling_policies.hpp.


Member Function Documentation

template<typename Task = task_func>
void boost::threadpool::lifo_scheduler< Task >::clear  ) 
 

Removes all tasks from the scheduler.

Definition at line 172 of file scheduling_policies.hpp.

template<typename Task = task_func>
bool boost::threadpool::lifo_scheduler< Task >::empty  )  const
 

Checks if the scheduler is empty.

Returns:
true if the scheduler contains no tasks, false otherwise.
Remarks:
Is more efficient than size() == 0.

Definition at line 165 of file scheduling_policies.hpp.

template<typename Task = task_func>
void boost::threadpool::lifo_scheduler< Task >::pop  ) 
 

Removes the task which should be executed next.

Definition at line 139 of file scheduling_policies.hpp.

template<typename Task = task_func>
bool boost::threadpool::lifo_scheduler< Task >::push task_type const &  task  ) 
 

Adds a new task to the scheduler.

Parameters:
task The task object.
Returns:
true, if the task could be scheduled and false otherwise.

Definition at line 131 of file scheduling_policies.hpp.

template<typename Task = task_func>
size_t boost::threadpool::lifo_scheduler< Task >::size  )  const
 

Gets the current number of tasks in the scheduler.

Returns:
The number of tasks.
Remarks:
Prefer empty() to size() == 0 to check if the scheduler is empty.

Definition at line 156 of file scheduling_policies.hpp.

template<typename Task = task_func>
task_type const& boost::threadpool::lifo_scheduler< Task >::top  )  const
 

Gets the task which should be executed next.

Returns:
The task object to be executed.

Definition at line 147 of file scheduling_policies.hpp.


Member Data Documentation

template<typename Task = task_func>
std::deque<task_type> boost::threadpool::lifo_scheduler< Task >::m_container [protected]
 

Internal task container.

Definition at line 124 of file scheduling_policies.hpp.


Copyright © 2005-2008 Philipp Henkel Overview | Reference | Tutorial | Examples | Design

Hosted by SourceForge.net Logo