SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
Partition.h
SourceXtractor::Partition::receiveProcessSignal
void receiveProcessSignal(const ProcessSourcesEvent &event) override
Definition
Partition.cpp:57
SourceXtractor::Partition::m_steps
std::vector< std::shared_ptr< PartitionStep > > m_steps
Definition
Partition.h:72
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::receiveSource
void receiveSource(std::unique_ptr< SourceInterface > source) override
Definition
Partition.cpp:31
SourceXtractor::PipelineEmitter< SourceInterface >::sendProcessSignal
void sendProcessSignal(const ProcessSourcesEvent &event) const
Definition
PipelineStage.h:92
SourceXtractor::PipelineEmitter< SourceInterface >::sendSource
void sendSource(std::unique_ptr< SourceInterface > source) const
Definition
PipelineStage.h:85
std::function
std::make_move_iterator
T make_move_iterator(T... args)
std::move
T move(T... args)
SourceXtractor
Definition
Aperture.h:30
std
STL namespace.
SourceXtractor::ProcessSourcesEvent
Event received by SourceGrouping to request the processing of some of the Sources stored.
Definition
PipelineStage.h:33
std::vector
Generated by
1.10.0