SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
Partition.cpp
Go to the documentation of this file.
1
22
24
25namespace SourceXtractor {
26
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}
60
61} // SEFramework namespace
void receiveProcessSignal(const ProcessSourcesEvent &event) override
Definition Partition.cpp:57
std::vector< std::shared_ptr< PartitionStep > > m_steps
Definition Partition.h:72
Partition(std::vector< std::shared_ptr< PartitionStep > > steps)
Constructor - takes a vector of PartitionSteps to be applied in order.
Definition Partition.cpp:27
void receiveSource(std::unique_ptr< SourceInterface > source) override
Definition Partition.cpp:31
void sendProcessSignal(const ProcessSourcesEvent &event) const
void sendSource(std::unique_ptr< SourceInterface > source) const
T emplace_back(T... args)
T end(T... args)
T insert(T... args)
T make_move_iterator(T... args)
T move(T... args)
STL namespace.
Event received by SourceGrouping to request the processing of some of the Sources stored.