SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Partition.cpp
Go to the documentation of this file.
1 
24 
25 namespace SourceXtractor {
26 
28  : m_steps(std::move(steps)) {
29 }
30 
32  // The input of the current step
34  step_input_sources.emplace_back(std::move(input_source));
35 
36  // Applies all the steps
37  for (const auto& step : m_steps) {
39  // For each Source in pour input list
40  for (auto& source : step_input_sources) {
41  // applies the current step
42  auto partition_output = step->partition(std::move(source));
43  // then merges the result
44  step_output_sources.insert(step_output_sources.end(), std::make_move_iterator(partition_output.begin()),
45  std::make_move_iterator(partition_output.end()));
46  }
47 
48  // the output of that step is then used as the input of the next
49  step_input_sources = std::move(step_output_sources);
50  }
51 
52  // Observers are then notified of the output of the last step
53  for (auto& source : step_input_sources) {
54  sendSource(std::move(source));
55  }
56 }
58  sendProcessSignal(event);
59 }
60 
61 } // SEFramework namespace
void sendProcessSignal(const ProcessSourcesEvent &event) const
Definition: PipelineStage.h:92
void receiveProcessSignal(const ProcessSourcesEvent &event) override
Definition: Partition.cpp:57
void receiveSource(std::unique_ptr< SourceInterface > source) override
Definition: Partition.cpp:31
Event received by SourceGrouping to request the processing of some of the Sources stored...
Definition: PipelineStage.h:33
T make_move_iterator(T...args)
T end(T...args)
std::vector< std::shared_ptr< PartitionStep > > m_steps
Definition: Partition.h:71
Partition(std::vector< std::shared_ptr< PartitionStep >> steps)
Constructor - takes a vector of PartitionSteps to be applied in order.
Definition: Partition.cpp:27
T move(T...args)
T insert(T...args)
STL class.
STL class.
void sendSource(std::unique_ptr< SourceInterface > source) const
Definition: PipelineStage.h:85
T emplace_back(T...args)