Modular simulator: Separate trajectory element and signaller
authorPascal Merz <pascal.merz@me.com>
Thu, 18 Jun 2020 18:53:59 +0000 (18:53 +0000)
committerPascal Merz <pascal.merz@me.com>
Thu, 18 Jun 2020 18:53:59 +0000 (18:53 +0000)
commit377cd00d83f3b4ec2618462bb86d60765bb6c26d
treea2730f170d7fd04c9fc2b7193614d6a782b54610
parent99f30ce89a3a830fd3e75f10eb86c8febcbb8c2a
Modular simulator: Separate trajectory element and signaller

The trajectory element implemented both the ISimulatorElement and
the ISignaller interface. It was both signalling its clients that a
trajectory writing step was about to occur during task list creation,
and actually performing trajectory writing during the simulation.

In general, the tasks of signallers and elements, their call site in
the code, and their build and ownership procedures are all significantly
different. The dual nature of the trajectory element makes this
differentiation less clear, and requires some workarounds. Additionally,
separating the trajectory element in separate element and a signaller
requires no changes on client side, since all clients of the trajectory
element with integrated signaller already implemented two interfaces,
ITrajectorySignallerClient and ITrajectoryWriterClient.

The current change hence splits the current trajectory element into
a pure element and a pure signaller. This will make subsequent changes,
especially the introduction of a builder approach much easier. It also
removes support for combined elements and signallers: It renames the setup
method of the ISignaller interface from `signallerSetup` to `setup`, as
this differentiation was only used for classes implementing both element
and signaller interfaces. It also simplifies the handling of signallers
in ModularSimulator, as having a separate ownership and call list is not
needed anymore.

Refs #3437
src/gromacs/modularsimulator/modularsimulator.cpp
src/gromacs/modularsimulator/modularsimulator.h
src/gromacs/modularsimulator/modularsimulatorinterfaces.h
src/gromacs/modularsimulator/signallers.cpp
src/gromacs/modularsimulator/signallers.h
src/gromacs/modularsimulator/trajectoryelement.cpp
src/gromacs/modularsimulator/trajectoryelement.h