SourceXtractorPlusPlus
0.19
SourceXtractor++, the next generation SExtractor
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::receiveSource
(
std::unique_ptr<SourceInterface>
input_source) {
32
// The input of the current step
33
std::vector<std::unique_ptr<SourceInterface>
> step_input_sources;
34
step_input_sources.
emplace_back
(
std::move
(input_source));
35
36
// Applies all the steps
37
for
(
const
auto
& step :
m_steps
) {
38
std::vector<std::unique_ptr<SourceInterface>
> step_output_sources;
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
}
57
void
Partition::receiveProcessSignal
(
const
ProcessSourcesEvent
& event) {
58
sendProcessSignal
(event);
59
}
60
61
}
// SEFramework namespace
std::shared_ptr
SourceXtractor::PipelineEmitter< SourceInterface >::sendProcessSignal
void sendProcessSignal(const ProcessSourcesEvent &event) const
Definition:
PipelineStage.h:92
SourceXtractor::Partition::receiveProcessSignal
void receiveProcessSignal(const ProcessSourcesEvent &event) override
Definition:
Partition.cpp:57
SourceXtractor::Partition::receiveSource
void receiveSource(std::unique_ptr< SourceInterface > source) override
Definition:
Partition.cpp:31
SourceXtractor::ProcessSourcesEvent
Event received by SourceGrouping to request the processing of some of the Sources stored...
Definition:
PipelineStage.h:33
std::make_move_iterator
T make_move_iterator(T...args)
std::vector::end
T end(T...args)
SourceXtractor::Partition::m_steps
std::vector< std::shared_ptr< PartitionStep > > m_steps
Definition:
Partition.h:71
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
std::move
T move(T...args)
std::vector::insert
T insert(T...args)
std::vector
STL class.
std::unique_ptr
STL class.
Partition.h
SourceXtractor::PipelineEmitter< SourceInterface >::sendSource
void sendSource(std::unique_ptr< SourceInterface > source) const
Definition:
PipelineStage.h:85
std::vector::emplace_back
T emplace_back(T...args)
Generated by
1.8.5