Gromacs  2025-dev-20241003-bd59e46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Friends
gmx::ModularSimulatorAlgorithmBuilder Class Referencefinal

#include <gromacs/modularsimulator/simulatoralgorithm.h>

Description

Builder for ModularSimulatorAlgorithm objects.

This builds a ModularSimulatorAlgorithm.

Users can add elements and define their call order by calling the templated add<Element> function. Note that only elements that have a static getElementPointerImpl factory method can be built in that way.

Note that each ModularSimulatorAlgorithmBuilder can only be used to build one ModularSimulatorAlgorithm object, i.e. build() can only be called once. During the call to build, all elements and other infrastructure objects will be moved to the built ModularSimulatorAlgorithm object, such that further use of the builder would not make sense. Any access to the build or add<> methods after the first call to build() will result in an exception being thrown.

Public Member Functions

 ModularSimulatorAlgorithmBuilder (compat::not_null< LegacySimulatorData * > legacySimulatorData, std::unique_ptr< ReadCheckpointDataHolder > checkpointDataHolder)
 Constructor.
 
ModularSimulatorAlgorithm build ()
 Build algorithm.
 
template<typename Element , typename... Args>
void add (Args &&...args)
 Add element to the modular simulator algorithm builder. More...
 

Friends

class ModularSimulatorAlgorithmBuilderHelper
 Allow access from helper.
 

Member Function Documentation

template<typename Element , typename... Args>
void gmx::ModularSimulatorAlgorithmBuilder::add ( Args &&...  args)

Add element to the modular simulator algorithm builder.

This function has a general implementation, which will call the getElementPointer(...) factory function.

Template Parameters
ElementThe element type
ArgsA variable number of argument types
Parameters
argsA variable number of arguments

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