Helios++
Helios software for LiDAR simulations
NonVoidStepLoop< StepOutput, StepInput > Class Template Reference

Class extending StepLoop to support functions with non void return. More...

#include <NonVoidStepLoop.h>

Inheritance diagram for NonVoidStepLoop< StepOutput, StepInput >:
Collaboration diagram for NonVoidStepLoop< StepOutput, StepInput >:

Public Member Functions

 NonVoidStepLoop (int const stepInterval, std::function< StepOutput(StepInput ...)> f)
 Non void step loop constructor receiving interval and computation region function.
 
void handleStep (StepInput ... input) override
 Implementation of StepLoop::handleStep for computation regions which return something. More...
 
StepOutput retrieveOutput () const
 Obtain the output corresponding to the last time computation region was entered. More...
 
- Public Member Functions inherited from StepLoop< StepInput ... >
 StepLoop (int const stepInterval)
 Step loop constructor receiving interval and computation region function.
 
virtual bool doStep (StepInput ... input)
 Handle current loop iteration and advances to next one by calling StepLoop::nextStep. More...
 
virtual void nextStep ()
 Advances to current loop iteration, restarting the loop when as many steps as step interval have been done.
 
virtual int getStepInterval () const
 Obtain the step interval. More...
 
virtual void setStepInterval (int const stepInterval)
 Set the step interval. More...
 
virtual int getCurrentStep () const
 Obtain the current step of the step loop. More...
 
virtual void setCurrentStep (int const currentStep)
 Set the current step for the step loop. More...
 

Protected Attributes

std::function< StepOutput(StepInput ...)> f
 The function to be invoked when computation region has been reached.
 
StepOutput output
 The output obtained the last time that computation region was entered.
 
- Protected Attributes inherited from StepLoop< StepInput ... >
int stepInterval
 Specify how many simulation steps must elapse so the step loop enters its computation region. More...
 
int currentStep
 Stores the current step. More...
 

Detailed Description

template<typename StepOutput, typename ... StepInput>
class NonVoidStepLoop< StepOutput, StepInput >

Class extending StepLoop to support functions with non void return.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
StepOutputThe output type of function to be invoked when computation region is reached
See also
StepLoop

Member Function Documentation

◆ handleStep()

template<typename StepOutput , typename ... StepInput>
void NonVoidStepLoop< StepOutput, StepInput >::handleStep ( StepInput ...  input)
inlineoverridevirtual

Implementation of StepLoop::handleStep for computation regions which return something.

See also
StepLoop::handleStep

Implements StepLoop< StepInput ... >.

◆ retrieveOutput()

template<typename StepOutput , typename ... StepInput>
StepOutput NonVoidStepLoop< StepOutput, StepInput >::retrieveOutput ( ) const
inline

Obtain the output corresponding to the last time computation region was entered.

Returns
The output that was obtained the last time that computation region was entered
See also
NonVoidStepLoop::output

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