Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
JobScheduler Class Reference

#include <elm/sys/JobScheduler.h>

+ Inheritance diagram for JobScheduler:

Public Member Functions

 JobScheduler (void)
 
 JobScheduler (JobProducer &producer)
 
 ~JobScheduler (void)
 
JobProducerproducer (void) const
 
void setProducer (JobProducer &producer)
 
int threadCount (void) const
 
void setThreadCount (int count)
 
void start (void)
 
void stop (void)
 

Detailed Description

The job scheduler distributes a list of jobs on several thread until the jobs are ended.Thread management is transparent for the user and job result harvesting in exclusive way is also supported by the scheduler.

To get the list of jobs, an object extending JobProducer must be provided.

Constructor & Destructor Documentation

◆ JobScheduler() [1/2]

Constructor without producer.

Exceptions
SystemExceptionLack of OS resources.

◆ JobScheduler() [2/2]

JobScheduler ( JobProducer producer)

Constructor.

Parameters
producerProducer to use.
Exceptions
SystemExceptionLack of OS resources.

◆ ~JobScheduler()

Member Function Documentation

◆ producer()

JobProducer & producer ( void  ) const
inline

Get the current producer.

Returns
Current producer.

Referenced by JobScheduler::setProducer().

◆ setProducer()

void setProducer ( JobProducer producer)

Set the current producer.

Parameters
producerProducer to set.

References JobScheduler::producer().

◆ setThreadCount()

void setThreadCount ( int  count)

Set the number of threads.

Parameters
countNumber of threads.

References elm::count().

◆ start()

void start ( void  )

Start to process the jobs. This function will only when all jobs has been processed or a call to stop() has been performed.

References Thread::make().

◆ stop()

void stop ( void  )

Stop the job processing.

◆ threadCount()

int threadCount ( void  ) const
inline

Get the number of used threads.


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