SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleSourceGroup.cpp
Go to the documentation of this file.
1 
17 /*
18  * @file SimpleSourceGroup.cpp
19  * @author nikoapos
20  */
21 
23 
24 namespace SourceXtractor {
25 
27  return m_sources.begin();
28 }
29 
31  return m_sources.end();
32 }
33 
35  return m_sources.cbegin();
36 }
37 
39  return m_sources.cend();
40 }
41 
43  return m_sources.cbegin();
44 }
45 
47  return m_sources.cend();
48 }
49 
51  m_sources.emplace_back(SourceWrapper(std::move(source)));
52 }
53 
55  auto next_iter = m_sources.erase(pos);
56  return next_iter;
57 }
58 
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();
66 }
67 
68 const Property& SimpleSourceGroup::getProperty(const PropertyId& property_id) const {
69  return m_property_holder.getProperty(property_id);
70 }
71 
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
std::list< SourceWrapper >::iterator iterator
void merge(SourceGroupInterface &&other) override
unsigned int size() const override
T end(T...args)
Base class for all Properties. (has no actual content)
Definition: Property.h:33
iterator removeSource(iterator pos) override
const_iterator cend() const override
A bare bones implementation of SourceGroupInterface meant to be used to implement unit tests...
T erase(T...args)
const Property & getProperty(const PropertyId &property_id) const
Returns a reference to a Property if it is set, if not throws a PropertyNotFoundException.
T move(T...args)
Defines the interface used to group sources.
T size(T...args)
STL class.
Identifier used to set and retrieve properties.
Definition: PropertyId.h:40
T begin(T...args)
std::list< SourceWrapper >::const_iterator const_iterator
const_iterator cbegin() const override
const Property & getProperty(const PropertyId &property_id) const override
std::list< SourceWrapper > m_sources
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id)
Sets a property, overwriting it if necessary.
void addSource(std::unique_ptr< SourceInterface > source) override
T emplace_back(T...args)
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id) override