SourceXtractorPlusPlus  0.13
Please provide a description of the project.
SourceGroupWithOnDemandProperties.h
Go to the documentation of this file.
1 
23 #ifndef _SEFRAMEWORK_SOURCE_SOURCEGROUP_H
24 #define _SEFRAMEWORK_SOURCE_SOURCEGROUP_H
25 
26 #include <set>
27 #include <iterator>
28 #include <type_traits>
29 
34 
35 namespace SourceXtractor {
36 
43 
44 public:
45 
47 
52 
53  iterator begin() override;
54 
55  iterator end() override;
56 
57  const_iterator cbegin() override;
58 
59  const_iterator cend() override;
60 
61  const_iterator begin() const override;
62 
63  const_iterator end() const override;
64 
65  void addSource(std::shared_ptr<SourceInterface> source) override;
66 
67  iterator removeSource(iterator pos) override;
68 
69  void merge(const SourceGroupInterface& other) override;
70 
71  unsigned int size() const override;
72 
75 
76 protected:
77 
78  const Property& getProperty(const PropertyId& property_id) const override;
79 
80  void setProperty(std::unique_ptr<Property> property, const PropertyId& property_id) override;
81 
82 private:
83 
84  class EntangledSource;
88 
89  void clearGroupProperties();
90 
91 }; /* End of SourceGroup class */
92 
93 
94 
96 
97 public:
98 
100 
101  virtual ~EntangledSource() = default;
102 
103  const Property& getProperty(const PropertyId& property_id) const override;
104 
105  void setProperty(std::unique_ptr<Property> property, const PropertyId& property_id) override;
106 
107  bool operator<(const EntangledSource& other) const;
108 
109 private:
110 
114 
117 
118 };
119 
120 } /* namespace SourceXtractor */
121 
122 #endif
SourceXtractor::SourceGroupWithOnDemandProperties::merge
void merge(const SourceGroupInterface &other) override
Definition: SourceGroupWithOnDemandProperties.cpp:67
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::EntangledSource
EntangledSource(std::shared_ptr< SourceInterface > source, SourceGroupWithOnDemandProperties &group)
Definition: EntangledSource.cpp:27
std::shared_ptr< TaskProvider >
std::list< SourceWrapper >
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition: Property.h:33
SourceGroupInterface.h
SourceInterface.h
SourceXtractor::SourceGroupWithOnDemandProperties
A SourceGroupInterface implementation which used a TaskProvider to compute missing properties.
Definition: SourceGroupWithOnDemandProperties.h:42
SourceXtractor::PropertyHolder
A class providing a simple implementation of a container of properties.
Definition: PropertyHolder.h:43
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::m_group
SourceGroupWithOnDemandProperties & m_group
Definition: SourceGroupWithOnDemandProperties.h:113
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::m_property_holder
PropertyHolder m_property_holder
Definition: SourceGroupWithOnDemandProperties.h:111
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::m_source
std::shared_ptr< SourceInterface > m_source
Definition: SourceGroupWithOnDemandProperties.h:112
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::getProperty
const Property & getProperty(const PropertyId &property_id) const override
Definition: EntangledSource.cpp:40
SourceXtractor::SourceGroupWithOnDemandProperties::addSource
void addSource(std::shared_ptr< SourceInterface > source) override
Definition: SourceGroupWithOnDemandProperties.cpp:56
SourceXtractor::SourceGroupWithOnDemandProperties::removeSource
iterator removeSource(iterator pos) override
Definition: SourceGroupWithOnDemandProperties.cpp:61
SourceXtractor::PropertyId
Identifier used to set and retrieve properties.
Definition: PropertyId.h:40
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::SourceGroupWithOnDemandProperties::end
iterator end() override
Definition: SourceGroupWithOnDemandProperties.cpp:36
SourceXtractor::SourceGroupWithOnDemandProperties::m_task_provider
std::shared_ptr< TaskProvider > m_task_provider
Definition: SourceGroupWithOnDemandProperties.h:87
SourceXtractor::SourceGroupWithOnDemandProperties::getProperty
virtual const Property & getProperty(const PropertyId &property_id) const=0
SourceXtractor::SourceGroupWithOnDemandProperties::m_property_holder
PropertyHolder m_property_holder
Definition: SourceGroupWithOnDemandProperties.h:86
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource
Definition: SourceGroupWithOnDemandProperties.h:95
SourceXtractor::SourceGroupWithOnDemandProperties::size
unsigned int size() const override
Definition: SourceGroupWithOnDemandProperties.cpp:107
SourceXtractor::SourceGroupInterface::const_iterator
std::list< SourceWrapper >::const_iterator const_iterator
Definition: SourceGroupInterface.h:82
TaskProvider.h
SourceXtractor::SourceGroupInterface
Defines the interface used to group sources.
Definition: SourceGroupInterface.h:37
PropertyHolder.h
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::setProperty
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id) override
Definition: EntangledSource.cpp:79
SourceXtractor::SourceGroupWithOnDemandProperties::setProperty
virtual void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id)=0
SourceXtractor::SourceGroupWithOnDemandProperties::cend
const_iterator cend() override
Definition: SourceGroupWithOnDemandProperties.cpp:44
SourceXtractor::SourceGroupWithOnDemandProperties::clearGroupProperties
void clearGroupProperties()
Definition: SourceGroupWithOnDemandProperties.cpp:100
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition: SourceInterface.h:57
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::operator<
bool operator<(const EntangledSource &other) const
Definition: EntangledSource.cpp:83
SourceXtractor::SourceGroupInterface::iterator
std::list< SourceWrapper >::iterator iterator
Definition: SourceGroupInterface.h:81
SourceXtractor::SourceGroupWithOnDemandProperties::m_sources
std::list< SourceWrapper > m_sources
Definition: SourceGroupWithOnDemandProperties.h:84
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition: SourceInterface.h:46
SourceXtractor::SourceGroupWithOnDemandProperties::cbegin
const_iterator cbegin() override
Definition: SourceGroupWithOnDemandProperties.cpp:40
SourceXtractor::SourceGroupWithOnDemandProperties::begin
iterator begin() override
Definition: SourceGroupWithOnDemandProperties.cpp:32
std::unique_ptr
STL class.
SourceXtractor::SourceGroupWithOnDemandProperties::SourceGroupWithOnDemandProperties
SourceGroupWithOnDemandProperties(std::shared_ptr< TaskProvider > task_provider)
Definition: SourceGroupWithOnDemandProperties.cpp:28
SourceXtractor::SourceGroupWithOnDemandProperties::~SourceGroupWithOnDemandProperties
virtual ~SourceGroupWithOnDemandProperties()=default
Destructor.
SourceXtractor::SourceGroupWithOnDemandProperties::EntangledSource::~EntangledSource
virtual ~EntangledSource()=default
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition: SourceInterface.h:72