SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceGrouping.h
Go to the documentation of this file.
1
23#ifndef _SEFRAMEWORK_PIPELINE_SOURCEGROUPING_H
24#define _SEFRAMEWORK_PIPELINE_SOURCEGROUPING_H
25
26#include <list>
27#include <memory>
28#include <set>
29
34
35namespace SourceXtractor {
36
43public:
47 virtual ~SelectionCriteria() = default;
48
50 virtual bool mustBeProcessed(const SourceInterface& source) const = 0;
51};
52
59public:
60 bool mustBeProcessed(const SourceInterface& ) const override {
61 return true;
62 }
63};
64
71public:
75 virtual ~GroupingCriteria() = default;
76
78 virtual bool shouldGroup(const SourceInterface& first, const SourceInterface& second) const = 0;
79
81 virtual std::set<PropertyId> requiredProperties() const { return {}; }
82};
83
119
120
121} /* namespace SourceXtractor */
122
123
124#endif
Criteria used by SourceGrouping to determine if two sources should be grouped together.
virtual ~GroupingCriteria()=default
Destructor.
virtual bool shouldGroup(const SourceInterface &first, const SourceInterface &second) const =0
Determines if the two sources should be grouped together.
virtual std::set< PropertyId > requiredProperties() const
Return a set of used properties so they can be pre-fetched.
An implementation of SelectionCriteria that just marks all Sources as selected.
bool mustBeProcessed(const SourceInterface &) const override
Determines if the given Source must be processed or not.
Used to determine if a Source is selected for processing.
virtual ~SelectionCriteria()=default
Destructor.
virtual bool mustBeProcessed(const SourceInterface &source) const =0
Determines if the given Source must be processed or not.
SourceGrouping takes Source, groups them together according to its GroupingCriteria and stores them....
std::shared_ptr< SourceGroupFactory > m_group_factory
std::list< std::unique_ptr< SourceGroupInterface > > m_source_groups
virtual ~SourceGrouping()=default
Destructor.
void receiveSource(std::unique_ptr< SourceInterface > source) override
Handles a new Source.
std::set< PropertyId > requiredProperties() const
Returns the set of required properties to compute the grouping.
SourceGrouping(std::shared_ptr< GroupingCriteria > grouping_criteria, std::shared_ptr< SourceGroupFactory > group_factory, unsigned int hard_limit)
std::shared_ptr< GroupingCriteria > m_grouping_criteria
void receiveProcessSignal(const ProcessSourcesEvent &event) override
Handles a ProcessSourcesEvent to trigger the processing of some of the Sources stored in SourceGroupi...
The SourceInterface is an abstract "source" that has properties attached to it.
Event received by SourceGrouping to request the processing of some of the Sources stored.