SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEFramework
src
lib
Source
SimpleSourceGroup.cpp
Go to the documentation of this file.
1
17
/*
18
* @file SimpleSourceGroup.cpp
19
* @author nikoapos
20
*/
21
22
#include "
SEFramework/Source/SimpleSourceGroup.h
"
23
24
namespace
SourceXtractor
{
25
26
SimpleSourceGroup::iterator
SimpleSourceGroup::begin
() {
27
return
m_sources
.
begin
();
28
}
29
30
SimpleSourceGroup::iterator
SimpleSourceGroup::end
() {
31
return
m_sources
.
end
();
32
}
33
34
SimpleSourceGroup::const_iterator
SimpleSourceGroup::cbegin
()
const
{
35
return
m_sources
.
cbegin
();
36
}
37
38
SimpleSourceGroup::const_iterator
SimpleSourceGroup::cend
()
const
{
39
return
m_sources
.
cend
();
40
}
41
42
SimpleSourceGroup::const_iterator
SimpleSourceGroup::begin
()
const
{
43
return
m_sources
.
cbegin
();
44
}
45
46
SimpleSourceGroup::const_iterator
SimpleSourceGroup::end
()
const
{
47
return
m_sources
.
cend
();
48
}
49
50
void
SimpleSourceGroup::addSource
(
std::unique_ptr<SourceInterface>
source
) {
51
m_sources
.
emplace_back
(
SourceWrapper
(
std::move
(
source
)));
52
}
53
54
SourceGroupInterface::iterator
SimpleSourceGroup::removeSource
(
iterator
pos
) {
55
auto
next_iter
=
m_sources
.
erase
(
pos
);
56
return
next_iter
;
57
}
58
59
void
SimpleSourceGroup::merge
(
SourceGroupInterface
&&
other
) {
60
auto
&
other_group
=
dynamic_cast<
SimpleSourceGroup
&
>
(
other
);
61
for
(
auto
&
source
:
other_group
.m_sources) {
62
this->
m_sources
.
emplace_back
(
std::move
(
source
));
63
}
64
other_group
.m_sources.clear();
65
m_property_holder
.
clear
();
66
}
67
68
const
Property
&
SimpleSourceGroup::getProperty
(
const
PropertyId
&
property_id
)
const
{
69
return
m_property_holder
.
getProperty
(
property_id
);
70
}
71
72
void
SimpleSourceGroup::setProperty
(
std::unique_ptr<Property>
property
,
const
PropertyId
&
property_id
) {
73
m_property_holder
.
setProperty
(
std::move
(
property
),
property_id
);
74
}
75
76
unsigned
int
SimpleSourceGroup::size
()
const
{
77
return
m_sources
.
size
();
78
}
79
80
}
// SourceXtractor namespace
SimpleSourceGroup.h
std::list::begin
T begin(T... args)
SourceXtractor::PropertyHolder::clear
void clear()
Definition
PropertyHolder.cpp:48
SourceXtractor::PropertyHolder::getProperty
const Property & getProperty(const PropertyId &property_id) const
Returns a reference to a Property if it is set, if not throws a PropertyNotFoundException.
Definition
PropertyHolder.cpp:29
SourceXtractor::PropertyHolder::setProperty
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id)
Sets a property, overwriting it if necessary.
Definition
PropertyHolder.cpp:40
SourceXtractor::PropertyId
Identifier used to set and retrieve properties.
Definition
PropertyId.h:40
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition
Property.h:33
SourceXtractor::SimpleSourceGroup
A bare bones implementation of SourceGroupInterface meant to be used to implement unit tests.
Definition
SimpleSourceGroup.h:39
SourceXtractor::SimpleSourceGroup::removeSource
iterator removeSource(iterator pos) override
Definition
SimpleSourceGroup.cpp:54
SourceXtractor::SimpleSourceGroup::setProperty
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id) override
Definition
SimpleSourceGroup.cpp:72
SourceXtractor::SimpleSourceGroup::size
unsigned int size() const override
Definition
SimpleSourceGroup.cpp:76
SourceXtractor::SimpleSourceGroup::cbegin
const_iterator cbegin() const override
Definition
SimpleSourceGroup.cpp:34
SourceXtractor::SimpleSourceGroup::begin
iterator begin() override
Definition
SimpleSourceGroup.cpp:26
SourceXtractor::SimpleSourceGroup::merge
void merge(SourceGroupInterface &&other) override
Definition
SimpleSourceGroup.cpp:59
SourceXtractor::SimpleSourceGroup::cend
const_iterator cend() const override
Definition
SimpleSourceGroup.cpp:38
SourceXtractor::SimpleSourceGroup::m_sources
std::list< SourceWrapper > m_sources
Definition
SimpleSourceGroup.h:76
SourceXtractor::SimpleSourceGroup::getProperty
const Property & getProperty(const PropertyId &property_id) const override
Definition
SimpleSourceGroup.cpp:68
SourceXtractor::SimpleSourceGroup::m_property_holder
PropertyHolder m_property_holder
Definition
SimpleSourceGroup.h:77
SourceXtractor::SimpleSourceGroup::end
iterator end() override
Definition
SimpleSourceGroup.cpp:30
SourceXtractor::SimpleSourceGroup::addSource
void addSource(std::unique_ptr< SourceInterface > source) override
Definition
SimpleSourceGroup.cpp:50
SourceXtractor::SourceGroupInterface::SourceWrapper
Definition
SourceGroupInterface.h:45
SourceXtractor::SourceGroupInterface
Defines the interface used to group sources.
Definition
SourceGroupInterface.h:38
SourceXtractor::SourceGroupInterface::const_iterator
std::list< SourceWrapper >::const_iterator const_iterator
Definition
SourceGroupInterface.h:79
SourceXtractor::SourceGroupInterface::iterator
std::list< SourceWrapper >::iterator iterator
Definition
SourceGroupInterface.h:78
std::list::emplace_back
T emplace_back(T... args)
std::list::end
T end(T... args)
std::list::erase
T erase(T... args)
std::function
std::move
T move(T... args)
SourceXtractor
Definition
Aperture.h:30
std::list::size
T size(T... args)
Generated by
1.10.0