FOUND
Loading...
Searching...
No Matches
found::ModifyingPipeline< T, N > Class Template Reference

A ModifyingPipeline modifies a resource with a given set of stages. More...

#include <pipelines.hpp>

Inheritance diagram for found::ModifyingPipeline< T, N >:
Collaboration diagram for found::ModifyingPipeline< T, N >:

Public Member Functions

 ModifyingPipeline ()=default
 Constructs a ModifyingPipeline.
 
ModifyingPipelineAddStage (ModifyingStage< T > &stage)
 Adds a stage to this.
 
ModifyingPipelineComplete (ModifyingStage< T > &stage)
 Completes a pipeline with a stage.
 
Run (const T &input) override
 Executes this Modifying Pipeline.
 
- Public Member Functions inherited from found::Pipeline< Input, Output, N >
void DoAction () override
 Runs a Pipeline.
 
virtual Output Run (const Input &input)=0
 Runs this Pipeline.
 
- Public Member Functions inherited from found::FunctionStage< Input, Output >
 FunctionStage ()=default
 Constructs a new Stage.
 
virtual ~FunctionStage ()=default
 Destroys this.
 
Input & GetResource ()
 Returns the stored input of this.
 
Output *& GetProduct ()
 Returns the stored output of this.
 
- Public Member Functions inherited from found::Stage< const raw_type< Input > &, raw_type< Output > >
virtual raw_type< Output > Run (const raw_type< Input > & input)=0
 Runs this stage.
 

Additional Inherited Members

- Protected Member Functions inherited from found::Pipeline< Input, Output, N >
void AddStageHelper (Action &stage)
 Adds a stage to this pipeline.
 
void CompleteHelper (Action &stage)
 Completes a pipeline with a stage.
 
void DoActionHelper ()
 Runs the entire pipeline.
 
- Protected Attributes inherited from found::Pipeline< Input, Output, N >
Actionstages [N]
 The stages of this.
 
size_t size = 0
 The number of stages.
 
bool ready = false
 Whether we're complete.
 
std::optional< Output > finalProduct
 The final product. This is only sometimes used.
 
- Protected Attributes inherited from found::FunctionStage< Input, Output >
Input resource
 The stored input for this.
 
Output * product = nullptr
 The pointer to the stored output for this.
 

Detailed Description

template<typename T, size_t N = DEFAULT_NUM_STAGES>
class found::ModifyingPipeline< T, N >

A ModifyingPipeline modifies a resource with a given set of stages.

Parameters
TThe resource to modify
NThe number of stages that modify the resource

Member Function Documentation

◆ AddStage()

template<typename T , size_t N = DEFAULT_NUM_STAGES>
ModifyingPipeline & found::ModifyingPipeline< T, N >::AddStage ( ModifyingStage< T > &  stage)
inline

Adds a stage to this.

Parameters
stageThe ModifyingStage<T> to add to this
Returns
this, with the added stage

◆ Complete()

template<typename T , size_t N = DEFAULT_NUM_STAGES>
ModifyingPipeline & found::ModifyingPipeline< T, N >::Complete ( ModifyingStage< T > &  stage)
inline

Completes a pipeline with a stage.

Parameters
stageThe stage to add
Returns
this, with the completed pipeline
Precondition
This method is called when the number of registered stages is less than N

◆ Run()

template<typename T , size_t N = DEFAULT_NUM_STAGES>
T found::ModifyingPipeline< T, N >::Run ( const T &  input)
inlineoverride

Executes this Modifying Pipeline.

Parameters
inputThe input to modify
Returns
input, but modified by all the registered stages, in order

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