SourceXtractorPlusPlus 0.19.2
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
ProgressMediator.h
Go to the documentation of this file.
1
17/*
18 * ProgressMediator.h
19 *
20 * Created on: Sep 07, 2018
21 * Author: Alejandro Alvarez Ayllon
22 */
23
24#ifndef _SEMAIN_PROGRESSLISTENER_H
25#define _SEMAIN_PROGRESSLISTENER_H
26
29#include "SEUtils/Observable.h"
30#include <atomic>
31#include <mutex>
32
33namespace SourceXtractor {
34
38
39 ProgressInfo(const std::string &name, int done, int total): m_label(name), m_done(done), m_total(total) {}
40};
41
44
52public:
56
57 ~ProgressMediator() = default;
58
63
68
73
78
83
87 void done();
88
92 void update(void);
93
94private:
97
101
102 // Mediator serializes the notifications, so the observers do not need to worry about
103 // being called from multiple threads
105
106 // This is a set of internal classes that implement the Observer pattern for different stages.
107 class ProgressCounter;
108 class SourceCounter;
109 class GroupCounter;
110};
111
112} // end SourceXtractor
113
114#endif // _SEMAIN_PROGRESSLISTENER_H
Implements the Observer pattern. Notifications will be made using a message of type T.
Definition Observable.h:51
Observer interface to be used with Observable to implement the Observer pattern.
Definition Observable.h:38
std::shared_ptr< segmentation_observer_t > m_segmentation_listener
Observer< SourceGroupInterface > group_observer_t
SegmentationProgress m_segmentation_progress
Observer< SourceInterface > source_observer_t
Observer< SegmentationProgress > segmentation_observer_t
std::shared_ptr< group_observer_t > m_measurement_listener
std::shared_ptr< group_observer_t > & getDeblendingObserver(void)
std::shared_ptr< group_observer_t > m_deblending_listener
std::shared_ptr< segmentation_observer_t > & getSegmentationObserver(void)
std::shared_ptr< source_observer_t > m_detection_listener
std::shared_ptr< source_observer_t > & getDetectionObserver(void)
std::shared_ptr< group_observer_t > & getMeasurementObserver(void)
Observable< std::list< ProgressInfo > > ProgressObservable
Observable< bool > DoneObservable
ProgressInfo(const std::string &name, int done, int total)
Used to notify observers of the progress of the processing of the image.