SourceXtractorPlusPlus
0.15
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEFramework
src
lib
Pipeline
Partition.cpp
Go to the documentation of this file.
1
23
#include "
SEFramework/Pipeline/Partition.h
"
24
25
namespace
SourceXtractor {
26
27
Partition::Partition
(
std::vector
<
std::shared_ptr<PartitionStep>
> steps)
28
: m_steps(std::
move
(steps)) {
29
}
30
31
void
Partition::handleMessage
(
const
std::shared_ptr<SourceInterface>
& source) {
32
// The input of the current step
33
std::vector<std::shared_ptr<SourceInterface>
> step_input_sources { source };
34
35
// Applies all the steps
36
for
(
const
auto
& step :
m_steps
) {
37
std::vector<std::shared_ptr<SourceInterface>
> step_output_sources;
38
// For each Source in pour input list
39
for
(
const
auto
& source : step_input_sources) {
40
// applies the current step
41
const
auto
partition_output = step->partition(source);
42
// then merges the result
43
step_output_sources.
insert
(step_output_sources.
end
(), partition_output.begin(), partition_output.end());
44
}
45
46
// the output of that step is then used as the input of the next
47
step_input_sources =
std::move
(step_output_sources);
48
}
49
50
// Observers are then notified of the output of the last step
51
for
(
const
auto
& source : step_input_sources) {
52
notifyObservers
(source);
53
}
54
}
55
56
}
// SEFramework namespace
std::shared_ptr
SourceXtractor::Observable< std::shared_ptr< SourceInterface > >::notifyObservers
void notifyObservers(const std::shared_ptr< SourceInterface > &message) const
Definition:
Observable.h:71
std::vector::end
T end(T...args)
SourceXtractor::Partition::m_steps
std::vector< std::shared_ptr< PartitionStep > > m_steps
Definition:
Partition.h:73
SourceXtractor::Partition::Partition
Partition(std::vector< std::shared_ptr< PartitionStep >> steps)
Constructor - takes a vector of PartitionSteps to be applied in order.
Definition:
Partition.cpp:27
SourceXtractor::Partition::handleMessage
virtual void handleMessage(const std::shared_ptr< SourceInterface > &source) override
Handles a Source (applies PartitionSteps) and notifies the Observers for every Source in the final re...
Definition:
Partition.cpp:31
std::move
T move(T...args)
std::vector::insert
T insert(T...args)
std::vector
STL class.
Partition.h
Generated by
1.8.5