AbstractAnalysisData module handling into a separate class.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 16 Jun 2013 03:32:21 +0000 (06:32 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 5 Sep 2013 19:51:38 +0000 (21:51 +0200)
commit7a55aae08a8b6e5025bf921ffbb6c899abb0900f
treede32985b14bb084070f2c1f9c037e2221207c578
parent5a62999d39f7a3822b1cbb1cbaead06d832f6e91
AbstractAnalysisData module handling into a separate class.

Move all logic related to maintaining the list of attached modules,
checking their compatibility with the data, and notifying them from
AbstractAnalysisData into a separate AnalysisDataModuleManager class.
AbstractAnalysisData now contains an instance of this class, and
provires a moduleManager() protected method for derived classes to
access it.

Module notification methods are no longer responsible of keeping the
frame count.  Instead, made the frameCount() method pure virtual and
added a method in AnalysisDataStorage to conveniently implement this
method.

Moved the responsibility of calling all data notification methods into
AnalysisDataStorage (including notifyDataStart() and
notifyDataFinish()). This allows modules that use AnalysisDataStorage to
not even know of the implementation details of the module manager.

Improved the semantics of setColumnCount() etc. such that they now
immediately check the compatibility of data modules and throw if there
is a problem.

Rationale:
 - Remove implementation details from the installed abstractdata.h
   header: AbstractAnalysisData is one of the main public interfaces in
   the module, and it exposed unnecessary complexity in the header. Now
   only the subclasses that actually need it see these details.
   In particular with #869, the module notification interface is only
   going to get more complex.
 - Reduce the responsibilities of AbstractAnalysisData: now it only
   keeps track of the dimensionality of the data (and notifies the
   module manager of relevant changes). Now it is closer to a pure
   interface, which is possibly should be.
 - Makes it possible to remove friendship between AbstractAnalysisData
   and AnalysisDataStorage. This allows further simplification in
   datastorage.cpp.

Related to #869.

Change-Id: Ic42d4b27bb6d1e445e3f74aa06ae52b354bf4403
18 files changed:
src/gromacs/analysisdata/abstractdata.cpp
src/gromacs/analysisdata/abstractdata.h
src/gromacs/analysisdata/analysisdata.cpp
src/gromacs/analysisdata/analysisdata.h
src/gromacs/analysisdata/arraydata.cpp
src/gromacs/analysisdata/arraydata.h
src/gromacs/analysisdata/datamodule.h
src/gromacs/analysisdata/datamodulemanager.cpp [new file with mode: 0644]
src/gromacs/analysisdata/datamodulemanager.h [new file with mode: 0644]
src/gromacs/analysisdata/dataproxy.cpp
src/gromacs/analysisdata/dataproxy.h
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/analysisdata/datastorage.h
src/gromacs/analysisdata/modules/average.cpp
src/gromacs/analysisdata/modules/average.h
src/gromacs/analysisdata/modules/displacement.cpp
src/gromacs/analysisdata/modules/histogram.cpp
src/gromacs/analysisdata/modules/histogram.h