Main Page | Class List | File List | Class Members

Rha::SimpleScheduler< E > Class Template Reference

Scheduler implementation class. More...

#include <SimpleScheduler.hpp>

List of all members.

Public Types

typedef SimpleScheduler< E > OfType
typedef E::Task Task
typedef E::Queue Queue
typedef E Executor

Public Member Functions

 SimpleScheduler ()
 Constructs SimpleScheduler with default implementation of Queue and Executor.

 SimpleScheduler (const Queue &queue)
 Constructs SimpleScheduler using passed Queue and default Executor.

 SimpleScheduler (const Executor &exec)
 Constructs SimpleScheduler using passed Executor and default Queue.

 SimpleScheduler (const Queue &queue, const Executor &exec)
 Constructs SimpleScheduler using passed Queue and Executor.

 ~SimpleScheduler () throw ()
 Destructs instance of SimpleScheduler object.

SimpleScheduler< E > & push (const Task &task)
 Schedules a task for execution.

SimpleScheduler< E > & operator<< (const Task &task)
 Schedules a task for execution (synonym for push).


Detailed Description

template<class E>
class Rha::SimpleScheduler< E >

Scheduler implementation class.

Use Scheduler class to create objects that will serve as task schedulers. Scheduler uses two other sub-components, Queue and Executor, to carry out queuing and execution of scheduled tasks.

Attention:
Copying instances of Scheduler class is not supported.


Constructor & Destructor Documentation

template<class E>
SimpleScheduler::SimpleScheduler const Queue &  queue  ) 
 

Constructs SimpleScheduler using passed Queue and default Executor.

Parameters:
queue a queue object to use by the SimpleScheduler when queuing new tasks.

template<class E>
SimpleScheduler::SimpleScheduler const Executor &  exec  ) 
 

Constructs SimpleScheduler using passed Executor and default Queue.

Parameters:
exec an executor object to use for managing threads and assignment of tasks to threads.

template<class E>
SimpleScheduler::SimpleScheduler const Queue &  queue,
const Executor &  exec
 

Constructs SimpleScheduler using passed Queue and Executor.

Parameters:
queue a queue object to use by the SimpleScheduler when queuing new tasks.
exec an executor object to use for managing threads and assignment of tasks to threads.

template<class E>
SimpleScheduler::~SimpleScheduler  )  throw ()
 

Destructs instance of SimpleScheduler object.

Shuts down the Queue and Executor. When it's finished, all tasks are removed from the queue and no threads are running.

Attention:
Declared as non-virtual to discourage inheritance.


Member Function Documentation

template<class E>
SimpleScheduler< E > & SimpleScheduler::operator<< const Task &  task  )  [inline]
 

Schedules a task for execution (synonym for push).

Parameters:
task task to be scheduled and executed asynchronously

template<class E>
SimpleScheduler< E > & SimpleScheduler::push const Task &  task  )  [inline]
 

Schedules a task for execution.

Parameters:
task task to be scheduled and executed asynchronously


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