SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::SimpleSourceGroup Class Reference

A bare bones implementation of SourceGroupInterface meant to be used to implement unit tests. More...

#include <SimpleSourceGroup.h>

Inheritance diagram for SourceXtractor::SimpleSourceGroup:
Collaboration diagram for SourceXtractor::SimpleSourceGroup:

Public Member Functions

virtual ~SimpleSourceGroup ()=default
iterator begin () override
iterator end () override
const_iterator cbegin () const override
const_iterator cend () const override
const_iterator begin () const override
const_iterator end () const override
void addSource (std::unique_ptr< SourceInterface > source) override
iterator removeSource (iterator pos) override
unsigned int size () const override
void merge (SourceGroupInterface &&other) override
template<typename PropertyType>
const PropertyType & getProperty (unsigned int index=0) const
 Convenience template method to call getProperty() with a more user-friendly syntax.
template<typename PropertyType, typename ... Args>
void setProperty (Args... args)
Public Member Functions inherited from SourceXtractor::SourceGroupInterface
template<typename SourceCollection>
void addAllSources (SourceCollection &&sources)
 Convenient method to add all the sources of a collection.
template<typename PropertyType>
const PropertyType & getProperty (unsigned int index=0) const
 Convenience template method to call getProperty() with a more user-friendly syntax.
virtual const PropertygetProperty (const PropertyId &property_id) const=0
template<typename PropertyType, typename ... Args>
void setProperty (Args... args)
virtual void setProperty (std::unique_ptr< Property > property, const PropertyId &property_id)=0
template<typename PropertyType, typename ... Args>
void setIndexedProperty (std::size_t index, Args... args)
 Convenience template method to call setProperty() with a more user-friendly syntax.

Protected Member Functions

const PropertygetProperty (const PropertyId &property_id) const override
void setProperty (std::unique_ptr< Property > property, const PropertyId &property_id) override
Protected Member Functions inherited from SourceXtractor::SourceInterface
virtual ~SourceInterface ()=default
 Destructor.
template<typename PropertyType>
const PropertyType & getProperty (unsigned int index=0) const
 Convenience template method to call getProperty() with a more user-friendly syntax.
template<typename PropertyType, typename ... Args>
void setIndexedProperty (std::size_t index, Args... args)
 Convenience template method to call setProperty() with a more user-friendly syntax.
template<typename PropertyType, typename ... Args>
void setProperty (Args... args)

Private Attributes

std::list< SourceWrapperm_sources
PropertyHolder m_property_holder

Additional Inherited Members

Public Types inherited from SourceXtractor::SourceGroupInterface
using iterator = std::list<SourceWrapper>::iterator
using const_iterator = std::list<SourceWrapper>::const_iterator

Detailed Description

A bare bones implementation of SourceGroupInterface meant to be used to implement unit tests.

Definition at line 39 of file SimpleSourceGroup.h.

Constructor & Destructor Documentation

◆ ~SimpleSourceGroup()

virtual SourceXtractor::SimpleSourceGroup::~SimpleSourceGroup ( )
virtualdefault

References SourceXtractor::SourceInterface::getProperty(), and SourceXtractor::SourceInterface::setProperty().

Here is the call graph for this function:

Member Function Documentation

◆ addSource()

void SourceXtractor::SimpleSourceGroup::addSource ( std::unique_ptr< SourceInterface > source)
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 50 of file SimpleSourceGroup.cpp.

References m_sources, and std::move().

Here is the call graph for this function:

◆ begin() [1/2]

SimpleSourceGroup::const_iterator SourceXtractor::SimpleSourceGroup::begin ( ) const
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 42 of file SimpleSourceGroup.cpp.

References m_sources.

◆ begin() [2/2]

SimpleSourceGroup::iterator SourceXtractor::SimpleSourceGroup::begin ( )
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 26 of file SimpleSourceGroup.cpp.

References m_sources.

◆ cbegin()

SimpleSourceGroup::const_iterator SourceXtractor::SimpleSourceGroup::cbegin ( ) const
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 34 of file SimpleSourceGroup.cpp.

References m_sources.

◆ cend()

SimpleSourceGroup::const_iterator SourceXtractor::SimpleSourceGroup::cend ( ) const
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 38 of file SimpleSourceGroup.cpp.

References m_sources.

◆ end() [1/2]

SimpleSourceGroup::const_iterator SourceXtractor::SimpleSourceGroup::end ( ) const
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 46 of file SimpleSourceGroup.cpp.

References m_sources.

◆ end() [2/2]

SimpleSourceGroup::iterator SourceXtractor::SimpleSourceGroup::end ( )
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 30 of file SimpleSourceGroup.cpp.

References m_sources.

◆ getProperty() [1/2]

const Property & SourceXtractor::SimpleSourceGroup::getProperty ( const PropertyId & property_id) const
overrideprotectedvirtual

Returns a reference to the requested property. The property may be computed if needed Throws a PropertyNotFoundException if the property cannot be provided.

Implements SourceXtractor::SourceInterface.

Definition at line 68 of file SimpleSourceGroup.cpp.

References m_property_holder.

◆ getProperty() [2/2]

template<typename PropertyType>
const PropertyType & SourceXtractor::SourceInterface::getProperty ( unsigned int index = 0) const
inline

Convenience template method to call getProperty() with a more user-friendly syntax.

Definition at line 57 of file SourceInterface.h.

◆ merge()

void SourceXtractor::SimpleSourceGroup::merge ( SourceGroupInterface && other)
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 59 of file SimpleSourceGroup.cpp.

References std::list< T >::clear(), m_property_holder, m_sources, and std::move().

Here is the call graph for this function:

◆ removeSource()

SourceGroupInterface::iterator SourceXtractor::SimpleSourceGroup::removeSource ( iterator pos)
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 54 of file SimpleSourceGroup.cpp.

References m_sources.

◆ setProperty() [1/2]

template<typename PropertyType, typename ... Args>
void SourceXtractor::SourceInterface::setProperty ( Args... args)
inline

Definition at line 72 of file SourceInterface.h.

◆ setProperty() [2/2]

void SourceXtractor::SimpleSourceGroup::setProperty ( std::unique_ptr< Property > property,
const PropertyId & property_id )
overrideprotectedvirtual

Implements SourceXtractor::SourceInterface.

Definition at line 72 of file SimpleSourceGroup.cpp.

References m_property_holder, and std::move().

Here is the call graph for this function:

◆ size()

unsigned int SourceXtractor::SimpleSourceGroup::size ( ) const
overridevirtual

Implements SourceXtractor::SourceGroupInterface.

Definition at line 76 of file SimpleSourceGroup.cpp.

References m_sources.

Member Data Documentation

◆ m_property_holder

PropertyHolder SourceXtractor::SimpleSourceGroup::m_property_holder
private

Definition at line 77 of file SimpleSourceGroup.h.

Referenced by getProperty(), merge(), and setProperty().

◆ m_sources

std::list<SourceWrapper> SourceXtractor::SimpleSourceGroup::m_sources
private

Definition at line 76 of file SimpleSourceGroup.h.

Referenced by addSource(), begin(), begin(), cbegin(), cend(), end(), end(), merge(), removeSource(), and size().


The documentation for this class was generated from the following files: