|
SourceXtractorPlusPlus
0.17
SourceXtractor++, the next generation SExtractor
|
#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 | stopThreads () override |
| void | synchronizeThreads () override |
Public Member Functions inherited from SourceXtractor::Measurement | |
| virtual | ~Measurement ()=default |
Public Member Functions inherited from SourceXtractor::Observer< std::shared_ptr< SourceGroupInterface > > | |
| virtual | ~Observer ()=default |
Public Member Functions inherited from SourceXtractor::Observable< std::shared_ptr< SourceGroupInterface > > | |
| 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 | |
Protected Member Functions inherited from SourceXtractor::Observable< std::shared_ptr< SourceGroupInterface > > | |
| 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 78 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 117 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 101 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.

|
overridevirtual |
Implements SourceXtractor::Measurement.
Definition at line 53 of file MultithreadedMeasurement.cpp.
References Euclid::ThreadPool::activeThreads(), Euclid::ThreadPool::block(), Euclid::ThreadPool::checkForException(), SourceXtractor::logger, m_output_queue, m_output_queue_mutex, m_thread_pool, and std::this_thread::sleep_for().

|
private |
Definition at line 66 of file MultithreadedMeasurement.h.
Referenced by outputThreadStatic().
|
private |
Definition at line 65 of file MultithreadedMeasurement.h.
Referenced by handleMessage().
|
private |
Definition at line 66 of file MultithreadedMeasurement.h.
Referenced by outputThreadLoop(), and stopThreads().
|
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(), outputThreadLoop(), and synchronizeThreads().
|
private |
Definition at line 70 of file MultithreadedMeasurement.h.
Referenced by handleMessage(), outputThreadLoop(), and synchronizeThreads().
|
private |
Definition at line 63 of file MultithreadedMeasurement.h.
Referenced by startThreads(), stopThreads(), and ~MultithreadedMeasurement().
|
private |
Definition at line 71 of file MultithreadedMeasurement.h.
|
private |
Definition at line 61 of file MultithreadedMeasurement.h.
Referenced by handleMessage().
|
private |
Definition at line 62 of file MultithreadedMeasurement.h.
Referenced by handleMessage(), outputThreadLoop(), stopThreads(), and synchronizeThreads().