Use separate class for data storage.
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 6 Jan 2012 17:56:41 +0000 (19:56 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 22 Feb 2012 05:38:09 +0000 (07:38 +0200)
commitbff23abdff170833de72d7151f61d7d74f870e6e
treeeaf9e738b2c98af64ed167986e7975f2bc52568a
parent4220bfdf6f4d134c014658da2a5b30e2dd7cafda
Use separate class for data storage.

Moved storage implementation from AbstractAnalysisDataStored and
parallel storage implementation from AnalysisData to a common
AnalysisDataStorage helper class that is used through containment
and delegation instead of inheritance.

Makes the code more reusable in eventual implementation of
parallel-enabled analysis modules, moves implementation details away
from the public interface (AnalysisDataStorage now only needs to be
forward-declared in public headers), and clarifies responsibilities in
the code.

Support for multipoint data is still not very good (but not worse than
it was), but should now be easier to improve.  In the future, it could
be considered whether to split the unit tests such that storage tests
test AnalysisDataStorage directly instead of through the AnalysisData
interface, but currently, these classes are quite tightly bound
together, so there is not much to gain from separate testing.

Related to issue #827.

Change-Id: I8c34a618893c770bff6d8216500d1061455bee89
25 files changed:
share/template/template.cpp
src/gromacs/analysisdata/abstractdata-impl.h
src/gromacs/analysisdata/abstractdata.cpp
src/gromacs/analysisdata/abstractdata.h
src/gromacs/analysisdata/analysisdata-impl.h
src/gromacs/analysisdata/analysisdata.cpp
src/gromacs/analysisdata/analysisdata.h
src/gromacs/analysisdata/datastorage-impl.h [new file with mode: 0644]
src/gromacs/analysisdata/datastorage.cpp [new file with mode: 0644]
src/gromacs/analysisdata/datastorage.h [new file with mode: 0644]
src/gromacs/analysisdata/modules/histogram-impl.h
src/gromacs/analysisdata/modules/histogram.cpp
src/gromacs/analysisdata/modules/histogram.h
src/gromacs/analysisdata/paralleloptions.h [new file with mode: 0644]
src/gromacs/analysisdata/tests/analysisdata.cpp
src/gromacs/analysisdata/tests/datatest.cpp
src/gromacs/analysisdata/tests/datatest.h
src/gromacs/trajectoryanalysis/analysismodule-impl.h
src/gromacs/trajectoryanalysis/analysismodule.cpp
src/gromacs/trajectoryanalysis/analysismodule.h
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/modules/select.h