11 #include <QtCore/QMutexLocker>
26 : PausableThread(
lmf::PausableThread::_run,parent),
27 _ringbuffer(ringbuffer),
47 if(rbItem->element->id())
80 throw logic_error(
"Workers::reference(): The instance has not yet been created");
93 for (
size_t i=0;i<
_workers.size();++i)
99 for (
size_t i=0;i<
_workers.size();++i)
105 for (
size_t i=0;i<
_workers.size();++i)
107 for (
size_t i=0;i<
_workers.size();++i)
113 for (
size_t i=0;i<
_workers.size();++i)
119 for (
size_t i=0;i<
_workers.size();++i)
121 for (
size_t i=0;i<
_workers.size();++i)
128 for (
size_t i=0;i<
_workers.size();++i)
135 for (
size_t i=0;i<
_workers.size();++i)
136 running = running &&
_workers[i]->isRunning();
file contains declaration of class Worker and Workers
Ratemeter & _ratemeter
the ratemeter to measure the analysis rate
void rethrowException()
rethrow the exceptions thrown in the workers
class calculating a rate in Hz.
file contains declaration of class calculating a rate
status_t _status
the internal status of the thread
Workers(RingBuffer< CASSEvent > &rb, Ratemeter &ratemeter, QObject *parent=0)
constructor.
ProcessorManager & _process
the processors
std::tr1::shared_ptr< Worker > shared_pointer
a shared pointer of this
QMutex lock
a lock to be used by functions that are using this worker
std::tr1::shared_ptr< Workers > shared_pointer
a shared pointer of this class
container and call handler for all registered processors.
static shared_pointer _instance
the instance of this class
void pause()
pause the threads.
A Ringbuffer, handles communication between Input and Worker Threads.
static shared_pointer instance()
return the already created instance of this
RingBuffer< CASSEvent > & _ringbuffer
the ringbuffer
static shared_pointer::element_type & reference()
return a reference to the instance itselve if it exists
Worker(RingBuffer< CASSEvent > &rb, Ratemeter &ratemeter, QObject *parent=0)
constructor.
buffer_t::iterator iter_type
type of the interator over the elements of the container
void resume()
resumes the threads
control_t _control
the internal control status of the thread
contains the manager for the processors
void count(double increase=1.)
increase the counts
std::vector< Worker::shared_pointer > _workers
container of workers
static QMutex _mutex
mutex to protect the creation of the signelton
void end()
will set the flags to end the threads
const size_t NbrOfWorkers
global variable to set the number of worker threads
void start()
starts the threads
static shared_pointer instance(RingBuffer< CASSEvent > &rb, Ratemeter &ratemeter, QObject *parent=0)
create and return an instance of this singleton
void pausePoint()
point where the thread will be paused
bool running() const
check if all workers are still running
contains a logger for cass
void runthis()
start the thread.