SourceXtractorPlusPlus  0.13
Please provide a description of the project.
Public Member Functions | Private Attributes | List of all members
SourceXtractor::Partition Class Reference

For each Source it receives, applies PartitionSteps and outputs one or more Sources. More...

#include <Partition.h>

Inheritance diagram for SourceXtractor::Partition:
[legend]
Collaboration diagram for SourceXtractor::Partition:
[legend]

Public Member Functions

virtual ~Partition ()=default
 Destructor. More...
 
 Partition (std::vector< std::shared_ptr< PartitionStep >> steps)
 Constructor - takes a vector of PartitionSteps to be applied in order. More...
 
virtual void handleMessage (const std::shared_ptr< SourceInterface > &source) override
 Handles a Source (applies PartitionSteps) and notifies the Observers for every Source in the final result. More...
 
- Public Member Functions inherited from SourceXtractor::Observer< std::shared_ptr< SourceInterface > >
virtual ~Observer ()=default
 
- Public Member Functions inherited from SourceXtractor::Observable< std::shared_ptr< SourceInterface > >
virtual ~Observable ()=default
 Destructor. More...
 
virtual void addObserver (std::shared_ptr< Observer< std::shared_ptr< SourceInterface > >> observer)
 Adds an Observer that will be notified when notify Observers is called. More...
 
virtual void removeObserver (std::shared_ptr< Observer< std::shared_ptr< SourceInterface > >> observer)
 Removes a previously added Observer from the list of Observers to notify. More...
 

Private Attributes

std::vector< std::shared_ptr< PartitionStep > > m_steps
 

Additional Inherited Members

- Protected Member Functions inherited from SourceXtractor::Observable< std::shared_ptr< SourceInterface > >
void notifyObservers (const std::shared_ptr< SourceInterface > &message) const
 

Detailed Description

For each Source it receives, applies PartitionSteps and outputs one or more Sources.

The first PartitionStep is applied to the Source that was received. Each subsequent PartitionStep is applied to the Source(s) produced by the previous step. The Sources resulting from the last step are notified to the Observers one by one.

Definition at line 57 of file Partition.h.

Constructor & Destructor Documentation

◆ ~Partition()

virtual SourceXtractor::Partition::~Partition ( )
virtualdefault

Destructor.

◆ Partition()

SourceXtractor::Partition::Partition ( std::vector< std::shared_ptr< PartitionStep >>  steps)

Constructor - takes a vector of PartitionSteps to be applied in order.

Definition at line 27 of file Partition.cpp.

References std::move().

Here is the call graph for this function:

Member Function Documentation

◆ handleMessage()

void SourceXtractor::Partition::handleMessage ( const std::shared_ptr< SourceInterface > &  source)
overridevirtual

Handles a Source (applies PartitionSteps) and notifies the Observers for every Source in the final result.

Implements SourceXtractor::Observer< std::shared_ptr< SourceInterface > >.

Definition at line 31 of file Partition.cpp.

References std::vector< T >::end(), std::vector< T >::insert(), m_steps, std::move(), and SourceXtractor::Observable< std::shared_ptr< SourceInterface > >::notifyObservers().

Here is the call graph for this function:

Member Data Documentation

◆ m_steps

std::vector<std::shared_ptr<PartitionStep> > SourceXtractor::Partition::m_steps
private

Definition at line 73 of file Partition.h.

Referenced by handleMessage().


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