Gromacs
2020.4
|
#include <gromacs/trajectoryanalysis/analysismodule.h>
Base class for thread-local data storage during trajectory analysis.
Thread-local storage of data handles and selections is implemented in this class; TrajectoryAnalysisModule instances can access the thread-local values in their TrajectoryAnalysisModule::analyzeFrame() method using dataHandle() and parallelSelection().
Public Member Functions | |
virtual void | finish ()=0 |
Performs any finishing actions after all frames have been processed. More... | |
AnalysisDataHandle | dataHandle (const AnalysisData &data) |
Returns a data handle for a given dataset. More... | |
Selection | parallelSelection (const Selection &selection) |
Returns a selection that corresponds to the given selection. More... | |
SelectionList | parallelSelections (const SelectionList &selections) |
Returns a set of selection that corresponds to the given selections. More... | |
Protected Member Functions | |
TrajectoryAnalysisModuleData (TrajectoryAnalysisModule *module, const AnalysisDataParallelOptions &opt, const SelectionCollection &selections) | |
Initializes thread-local storage for data handles and selections. More... | |
void | finishDataHandles () |
Calls finishData() on all data handles. More... | |
|
protected |
Initializes thread-local storage for data handles and selections.
[in] | module | Analysis module to use for data objects. |
[in] | opt | Data parallelization options. |
[in] | selections | Thread-local selection collection. |
std::bad_alloc | if out of memory. |
unspecified | Can throw any exception thrown by AnalysisData::startData(). |
Calls AnalysisData::startData() on all data objects registered with TrajectoryAnalysisModule::registerAnalysisDataset() in module
. The handles are accessible through dataHandle().
AnalysisDataHandle gmx::TrajectoryAnalysisModuleData::dataHandle | ( | const AnalysisData & | data | ) |
Returns a data handle for a given dataset.
[in] | data | Analysis data object. |
data
stored in this thread-local data.data
should have previously been registered with TrajectoryAnalysisModule::registerAnalysisDataset(). If data
has zero columns in all data sets, the returned data handle is invalid.
Does not throw.
|
pure virtual |
Performs any finishing actions after all frames have been processed.
unspecified | Implementation may throw exceptions to indicate errors. |
This function is called immediately before the destructor, after TrajectoryAnalysisModule::finishFrames(). Derived classes should implement any final operations that need to be done after successful analysis. All implementations should call finishDataHandles().
|
protected |
Calls finishData() on all data handles.
unspecified | Can throw any exception thrown by AnalysisDataHandle::finishData(). |
This function should be called from the implementation of finish() in all subclasses.
Returns a selection that corresponds to the given selection.
[in] | selection | Global selection object. |
selection
is the selection object that was obtained from SelectionOption. The return value is the corresponding selection in the selection collection with which this data object was constructed with.
Does not throw.
SelectionList gmx::TrajectoryAnalysisModuleData::parallelSelections | ( | const SelectionList & | selections | ) |
Returns a set of selection that corresponds to the given selections.
std::bad_alloc | if out of memory. |
Works as parallelSelection(), but for a list of selections at once.