Version: SMASH-1.5
smash::ExperimentBase Class Referenceabstract

#include <experiment.h>

Non-template interface to Experiment<Modus>.

This class allows to call into the public interface of Experiment<Modus> without the need to know the specific Modus. The interface is meant for main() to set up the experiment and then run takes over.

Definition at line 82 of file experiment.h.

Inheritance diagram for smash::ExperimentBase:
[legend]

Classes

struct  InvalidModusRequest
 Exception class that is thrown if an invalid modus is requested from the Experiment factory. More...
 

Public Member Functions

 ExperimentBase ()=default
 
virtual ~ExperimentBase ()=default
 The virtual destructor avoids undefined behavior when destroying derived objects. More...
 
virtual void run ()=0
 Runs the experiment. More...
 

Static Public Member Functions

static std::unique_ptr< ExperimentBasecreate (Configuration config, const bf::path &output_path)
 Factory method that creates and initializes a new Experiment<Modus>. More...
 

Constructor & Destructor Documentation

◆ ExperimentBase()

smash::ExperimentBase::ExperimentBase ( )
default

◆ ~ExperimentBase()

virtual smash::ExperimentBase::~ExperimentBase ( )
virtualdefault

The virtual destructor avoids undefined behavior when destroying derived objects.

Member Function Documentation

◆ create()

static std::unique_ptr<ExperimentBase> smash::ExperimentBase::create ( Configuration  config,
const bf::path &  output_path 
)
static

Factory method that creates and initializes a new Experiment<Modus>.

This function creates a new Experiment object. The Modus template argument is determined by the config argument.

Parameters
[in]configThe configuration object that sets all initial conditions of the experiment.
[in]output_pathThe directory where the output files are written.
Returns
An owning pointer to the Experiment object, using the ExperimentBase interface.
Exceptions
InvalidModusRequestThis exception is thrown if the Modus string in the config object does not contain a valid string.

Most of the Configuration values are read starting from this function. The configuration itself is documented in General

Here is the caller graph for this function:

◆ run()

virtual void smash::ExperimentBase::run ( )
pure virtual

Runs the experiment.

The constructor does the setup of the experiment. The run function executes the complete experiment.

Implemented in smash::Experiment< Modus >.


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