SourceXtractorPlusPlus  0.12
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Output.h
Go to the documentation of this file.
1 
17 /*
18  * Output.h
19  *
20  * Created on: Jun 23, 2016
21  * Author: mschefer
22  */
23 
24 #ifndef _SEFRAMEWORK_PIPELINE_OUTPUT_H_
25 #define _SEFRAMEWORK_PIPELINE_OUTPUT_H_
26 
27 #include "SEUtils/Observable.h"
30 
31 namespace SourceXtractor {
32 
33 class Output :
34  public Observer<std::shared_ptr<SourceInterface>>,
35  public Observer<std::shared_ptr<SourceGroupInterface>> {
36 
37 public:
38 
39  virtual ~Output() = default;
40 
41  virtual void handleMessage(const std::shared_ptr<SourceInterface>& source) override {
42  outputSource(*source);
43  }
44 
45  virtual void handleMessage(const std::shared_ptr<SourceGroupInterface>& source_group) override {
46  for (auto& source : *source_group) {
47  outputSource(source);
48  }
49  }
50 
51  virtual void outputSource(const SourceInterface& source) = 0;
52 
54  virtual size_t flush() = 0;
55 };
56 
57 }
58 
59 #endif /* _SEFRAMEWORK_PIPELINE_OUTPUT_H_ */
virtual size_t flush()=0
virtual void outputSource(const SourceInterface &source)=0
virtual void handleMessage(const std::shared_ptr< SourceGroupInterface > &source_group) override
Definition: Output.h:45
virtual ~Output()=default
virtual void handleMessage(const std::shared_ptr< SourceInterface > &source) override
Definition: Output.h:41
Observer interface to be used with Observable to implement the Observer pattern.
Definition: Observable.h:38
The SourceInterface is an abstract &quot;source&quot; that has properties attached to it.