Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
WithFallback Class Reference

Tries a primary contour extractor and falls back to another extractor on failure. More...

#include <WithFallback.h>

Inheritance diagram for WithFallback:
Collaboration diagram for WithFallback:

Public Member Functions

 WithFallback (std::shared_ptr< IContourExtractor > primary, std::shared_ptr< IContourExtractor > fallback)
 Constructs a fallback contour extractor wrapper.
 
Contour extract (const ScalarField2D &field, const ContourRequest &cr) override
 Extracts a contour using the primary extractor, then fallback if needed.
 
- Public Member Functions inherited from IContourExtractor
virtual ~IContourExtractor ()=default
 

Detailed Description

Tries a primary contour extractor and falls back to another extractor on failure.

The wrapper is intended to make contour production more robust when a fast or preferred extraction method can occasionally fail. The fallback is used when the primary extractor throws an exception or returns a contour marked as unsuccessful.

Definition at line 52 of file WithFallback.h.

Constructor & Destructor Documentation

◆ WithFallback()

WithFallback::WithFallback ( std::shared_ptr< IContourExtractor primary,
std::shared_ptr< IContourExtractor fallback 
)
inline

Constructs a fallback contour extractor wrapper.

Parameters
primaryExtractor attempted first.
fallbackExtractor used if the primary fails or returns an unsuccessful contour.

Definition at line 61 of file WithFallback.h.

Member Function Documentation

◆ extract()

Contour WithFallback::extract ( const ScalarField2D field,
const ContourRequest cr 
)
inlineoverridevirtual

Extracts a contour using the primary extractor, then fallback if needed.

Parameters
fieldScalar field from which to extract the contour.
crContour extraction request.
Returns
Contour produced by the primary extractor when successful, otherwise by the fallback extractor.
Exceptions
std::exceptionpropagated from the fallback extractor if fallback extraction also fails.

Implements IContourExtractor.

Definition at line 75 of file WithFallback.h.


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