SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SourceXtractor::SimpleSource Class Reference

A trivial implementation of SourceInterface meant to be used in unit tests. More...

#include <SimpleSource.h>

Inheritance diagram for SourceXtractor::SimpleSource:
Inheritance graph
[legend]
Collaboration diagram for SourceXtractor::SimpleSource:
Collaboration graph
[legend]

Public Member Functions

virtual ~SimpleSource ()=default
 Destructor.
 
 SimpleSource (const SimpleSource &)=delete
 
SimpleSourceoperator= (const SimpleSource &)=delete
 
 SimpleSource (SimpleSource &&)=delete
 
SimpleSourceoperator= (SimpleSource &&)=delete
 
 SimpleSource ()
 Constructor.
 
template<typename PropertyType >
const PropertyTypegetProperty (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
 
- Public Member Functions inherited from SourceXtractor::SourceInterface
virtual ~SourceInterface ()=default
 Destructor.
 
template<typename PropertyType >
const PropertyTypegetProperty (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)
 

Protected Member Functions

const PropertygetProperty (const PropertyId &property_id) const override
 
void setProperty (std::unique_ptr< Property > property, const PropertyId &property_id) override
 

Private Attributes

PropertyHolder m_property_holder
 

Detailed Description

A trivial implementation of SourceInterface meant to be used in unit tests.

Unlike SourceWithOnDemandproperties, SimpleSource doesn't do any computation of properties but is instead just a simple container for properties.

Definition at line 41 of file SimpleSource.h.

Constructor & Destructor Documentation

◆ ~SimpleSource()

virtual SourceXtractor::SimpleSource::~SimpleSource ( )
virtualdefault

Destructor.

◆ SimpleSource() [1/3]

SourceXtractor::SimpleSource::SimpleSource ( const SimpleSource & )
delete

◆ SimpleSource() [2/3]

SourceXtractor::SimpleSource::SimpleSource ( SimpleSource && )
delete

◆ SimpleSource() [3/3]

SourceXtractor::SimpleSource::SimpleSource ( )
inline

Constructor.

Definition at line 55 of file SimpleSource.h.

Member Function Documentation

◆ getProperty() [1/3]

const Property & SourceXtractor::SimpleSource::getProperty ( const PropertyId & property_id) const
inlineoverrideprotectedvirtual

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 67 of file SimpleSource.h.

References SourceXtractor::PropertyHolder::getProperty(), and m_property_holder.

Here is the call graph for this function:

◆ getProperty() [2/3]

virtual const Property & SourceXtractor::SourceInterface::getProperty ( const PropertyId & property_id) const
virtual

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.

◆ getProperty() [3/3]

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.

◆ operator=() [1/2]

SimpleSource & SourceXtractor::SimpleSource::operator= ( const SimpleSource & )
delete

◆ operator=() [2/2]

SimpleSource & SourceXtractor::SimpleSource::operator= ( SimpleSource && )
delete

◆ setProperty() [1/3]

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

Definition at line 72 of file SourceInterface.h.

◆ setProperty() [2/3]

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

Implements SourceXtractor::SourceInterface.

Definition at line 71 of file SimpleSource.h.

References m_property_holder, std::move(), and SourceXtractor::PropertyHolder::setProperty().

Here is the call graph for this function:

◆ setProperty() [3/3]

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

Member Data Documentation

◆ m_property_holder

PropertyHolder SourceXtractor::SimpleSource::m_property_holder
private

Definition at line 76 of file SimpleSource.h.

Referenced by getProperty(), and setProperty().


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