| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Attributes | List of all members
boost::threadpool::lifo_scheduler< Task > Class Template Reference

SchedulingPolicy which implements LIFO ordering. More...

`#include <src/threadpool/boost/threadpool/scheduling_policies.hpp>`

Collaboration diagram for boost::threadpool::lifo_scheduler< Task >:
[legend]

## Public Types
typedef Task | task_type
| Indicates the scheduler's task type. More...

## Public Member Functions
bool | push (task_type const &task)
| Adds a new task to the scheduler. More...
void | pop ()
| Removes the task which should be executed next. More...
task_type const & | top () const
| Gets the task which should be executed next. More...
size_t | size () const
| Gets the current number of tasks in the scheduler. More...
bool | empty () const
| Checks if the scheduler is empty. More...
void | clear ()
| Removes all tasks from the scheduler. More...

## Protected Attributes
std::deque< task_type > | m_container
| Internal task container. More...

## 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.

## 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 | ( |  | ) |
| inline

Removes all tasks from the scheduler.

Definition at line 172 of file scheduling_policies.hpp.

173 {
174 m_container.clear();
175 }
boost::threadpool::lifo_scheduler::m_container
std::deque< task_type > m_container
Internal task container.
Definition: scheduling_policies.hpp:124
std::deque::clear
T clear(T...args)
template<typename Task = task_func>

bool boost::threadpool::lifo_scheduler< Task >::empty | ( |  | ) | const
| inline

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.

166 {
167 return m_container.empty();
168 }
std::deque::empty
T empty(T...args)
boost::threadpool::lifo_scheduler::m_container
std::deque< task_type > m_container
Internal task container.
Definition: scheduling_policies.hpp:124
template<typename Task = task_func>

void boost::threadpool::lifo_scheduler< Task >::pop | ( |  | ) |
| inline

Removes the task which should be executed next.

Definition at line 139 of file scheduling_policies.hpp.

140 {
141 m_container.pop_front();
142 }
boost::threadpool::lifo_scheduler::m_container
std::deque< task_type > m_container
Internal task container.
Definition: scheduling_policies.hpp:124
std::deque::pop_front
T pop_front(T...args)
template<typename Task = task_func>

bool boost::threadpool::lifo_scheduler< Task >::push | ( | task_type const & | task | ) |
| inline

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.

132 {
133 m_container.push_front(task);
134 return true;
135 }
boost::threadpool::lifo_scheduler::m_container
std::deque< task_type > m_container
Internal task container.
Definition: scheduling_policies.hpp:124
std::deque::push_front
T push_front(T...args)
template<typename Task = task_func>

size_t boost::threadpool::lifo_scheduler< Task >::size | ( |  | ) | const
| inline

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.

157 {
158 return m_container.size();
159 }
boost::threadpool::lifo_scheduler::m_container
std::deque< task_type > m_container
Internal task container.
Definition: scheduling_policies.hpp:124
std::deque::size
T size(T...args)
template<typename Task = task_func>

task_type const& boost::threadpool::lifo_scheduler< Task >::top | ( |  | ) | const
| inline

Gets the task which should be executed next.

Returns
  The task object to be executed.

Definition at line 147 of file scheduling_policies.hpp.

148 {
149 return m_container.front();
150 }
std::deque::front
T front(T...args)
boost::threadpool::lifo_scheduler::m_container
std::deque< task_type > m_container
Internal task container.
Definition: scheduling_policies.hpp:124

## 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.

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

- GaudiMTTools/src/threadpool/boost/threadpool/scheduling_policies.hpp