SourceXtractorPlusPlus
0.16
Please provide a description of the project.
|
#include <MultithreadedMeasurement.h>
Public Types | |
using | SourceToRowConverter = std::function< Euclid::Table::Row(const SourceInterface &)> |
Public Member Functions | |
MultithreadedMeasurement (SourceToRowConverter source_to_row, const std::shared_ptr< Euclid::ThreadPool > &thread_pool, unsigned max_queue_size) | |
virtual | ~MultithreadedMeasurement () |
void | handleMessage (const std::shared_ptr< SourceGroupInterface > &source_group) override |
void | startThreads () override |
void | waitForThreads () override |
![]() | |
virtual | ~Measurement ()=default |
![]() | |
virtual | ~Observer ()=default |
![]() | |
virtual | ~Observable ()=default |
Destructor. More... | |
virtual void | addObserver (std::shared_ptr< Observer< std::shared_ptr< SourceGroupInterface > >> observer) |
Adds an Observer that will be notified when notify Observers is called. More... | |
virtual void | removeObserver (std::shared_ptr< Observer< std::shared_ptr< SourceGroupInterface > >> observer) |
Removes a previously added Observer from the list of Observers to notify. More... | |
Private Member Functions | |
void | outputThreadLoop () |
Static Private Member Functions | |
static void | outputThreadStatic (MultithreadedMeasurement *measurement) |
Private Attributes | |
SourceToRowConverter | m_source_to_row |
std::shared_ptr< Euclid::ThreadPool > | m_thread_pool |
std::unique_ptr< std::thread > | m_output_thread |
int | m_group_counter |
std::atomic_bool | m_input_done |
std::atomic_bool | m_abort_raised |
std::condition_variable | m_new_output |
std::list< std::pair< int, std::shared_ptr< SourceGroupInterface > > > | m_output_queue |
std::mutex | m_output_queue_mutex |
Euclid::Semaphore | m_semaphore |
Additional Inherited Members | |
![]() | |
void | notifyObservers (const std::shared_ptr< SourceGroupInterface > &message) const |
Definition at line 38 of file MultithreadedMeasurement.h.
using SourceXtractor::MultithreadedMeasurement::SourceToRowConverter = std::function<Euclid::Table::Row(const SourceInterface&)> |
Definition at line 41 of file MultithreadedMeasurement.h.
|
inline |
Definition at line 42 of file MultithreadedMeasurement.h.
|
virtual |
Definition at line 36 of file MultithreadedMeasurement.cpp.
References std::thread::join(), std::thread::joinable(), and m_output_thread.
|
overridevirtual |
Implements SourceXtractor::Observer< std::shared_ptr< SourceGroupInterface > >.
Definition at line 54 of file MultithreadedMeasurement.cpp.
References m_group_counter, m_new_output, m_output_queue, m_output_queue_mutex, m_source_to_row, m_thread_pool, std::condition_variable::notify_one(), and Euclid::ThreadPool::submit().
|
private |
Definition at line 93 of file MultithreadedMeasurement.cpp.
References Euclid::ThreadPool::activeThreads(), m_input_done, m_new_output, m_output_queue, m_output_queue_mutex, m_thread_pool, SourceXtractor::Observable< std::shared_ptr< SourceGroupInterface > >::notifyObservers(), Euclid::ThreadPool::queued(), Euclid::ThreadPool::running(), and std::condition_variable::wait_for().
Referenced by outputThreadStatic().
|
staticprivate |
Definition at line 77 of file MultithreadedMeasurement.cpp.
References e, SourceXtractor::logger, m_abort_raised, and outputThreadLoop().
Referenced by startThreads().
|
overridevirtual |
Implements SourceXtractor::Measurement.
Definition at line 42 of file MultithreadedMeasurement.cpp.
References m_output_thread, and outputThreadStatic().
|
overridevirtual |
Implements SourceXtractor::Measurement.
Definition at line 46 of file MultithreadedMeasurement.cpp.
References Euclid::ThreadPool::block(), std::thread::join(), SourceXtractor::logger, m_input_done, m_output_thread, and m_thread_pool.
|
private |
Definition at line 65 of file MultithreadedMeasurement.h.
Referenced by outputThreadStatic().
|
private |
Definition at line 64 of file MultithreadedMeasurement.h.
Referenced by handleMessage().
|
private |
Definition at line 65 of file MultithreadedMeasurement.h.
Referenced by outputThreadLoop(), and waitForThreads().
|
private |
Definition at line 67 of file MultithreadedMeasurement.h.
Referenced by handleMessage(), and outputThreadLoop().
|
private |
Definition at line 68 of file MultithreadedMeasurement.h.
Referenced by handleMessage(), and outputThreadLoop().
|
private |
Definition at line 69 of file MultithreadedMeasurement.h.
Referenced by handleMessage(), and outputThreadLoop().
|
private |
Definition at line 62 of file MultithreadedMeasurement.h.
Referenced by startThreads(), waitForThreads(), and ~MultithreadedMeasurement().
|
private |
Definition at line 70 of file MultithreadedMeasurement.h.
|
private |
Definition at line 60 of file MultithreadedMeasurement.h.
Referenced by handleMessage().
|
private |
Definition at line 61 of file MultithreadedMeasurement.h.
Referenced by handleMessage(), outputThreadLoop(), and waitForThreads().