SourceXtractorPlusPlus  0.14
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MultithreadedMeasurement.h
Go to the documentation of this file.
1 
17 /*
18  * Multithreadedmeasurement->h
19  *
20  * Created on: May 17, 2018
21  * Author: mschefer
22  */
23 
24 #ifndef _SEIMPLEMENTATION_OUTPUT_MULTITHREADEDMEASUREMENT_H_
25 #define _SEIMPLEMENTATION_OUTPUT_MULTITHREADEDMEASUREMENT_H_
26 
27 #include <atomic>
28 #include <thread>
29 #include <mutex>
30 #include <condition_variable>
31 #include <atomic>
34 
35 namespace SourceXtractor {
36 
38 public:
39 
42  : m_source_to_row(source_to_row),
43  m_thread_pool(thread_pool),
44  m_group_counter(0),
45  m_input_done(false), m_abort_raised(false) {}
46 
47  void handleMessage(const std::shared_ptr<SourceGroupInterface>& source_group) override;
48 
49  void startThreads() override;
50  void waitForThreads() override;
51 
52 public:
54 
55 private:
56  static void outputThreadStatic(MultithreadedMeasurement* measurement);
57  void outputThreadLoop();
58 
62 
64  std::atomic_bool m_input_done, m_abort_raised;
65 
69 };
70 
71 }
72 
73 #endif /* _SEIMPLEMENTATION_OUTPUT_MULTITHREADEDMEASUREMENT_H_ */
MultithreadedMeasurement(SourceToRowConverter source_to_row, const std::shared_ptr< Euclid::ThreadPool > &thread_pool)
STL class.
std::shared_ptr< Euclid::ThreadPool > m_thread_pool
std::unique_ptr< std::thread > m_output_thread
std::list< std::pair< int, std::shared_ptr< SourceGroupInterface > > > m_output_queue
STL class.
void handleMessage(const std::shared_ptr< SourceGroupInterface > &source_group) override
static void outputThreadStatic(MultithreadedMeasurement *measurement)