Simplify code structure for C++ analysis tools
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 22 Oct 2013 04:34:36 +0000 (07:34 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 28 Oct 2013 16:38:58 +0000 (17:38 +0100)
commit0b68bbb979ef95afe20f7297a84bec4ee1ba9608
tree68561197aadd9e32dcc24e78ae675f472a2a1edd
parent690c59fdfd0f8cff4207fc7b61c2c284ab402566
Simplify code structure for C++ analysis tools

Move all the code for declaring the actual analysis tool into the source
file, and leave only a stub info object in the headers.  Make the class
declared in the header provide a static factory method to allow this.

This has several benefits:
 - Easier to write and maintain the tools, as all the logic is in one
   file only.
 - Clearer about the intended level of encapsulation of the tools.
 - Makes the tools in the library more closely resemble those written
   using the template.  The only difference now is that the main()
   method is replaced by the info object, and that the info object
   provides the names to pass to TrajectoryAnalysisModule constructor.

Change-Id: Ib545cc1d8900fe88cb58811df2cd4a63a6a99b2f
15 files changed:
src/gromacs/trajectoryanalysis/cmdlinerunner.h
src/gromacs/trajectoryanalysis/modules.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/angle.h
src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/distance.h
src/gromacs/trajectoryanalysis/modules/freevolume.cpp
src/gromacs/trajectoryanalysis/modules/freevolume.h
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/modules/select.h
src/gromacs/trajectoryanalysis/tests/angle.cpp
src/gromacs/trajectoryanalysis/tests/distance.cpp
src/gromacs/trajectoryanalysis/tests/freevolume.cpp
src/gromacs/trajectoryanalysis/tests/moduletest.h
src/gromacs/trajectoryanalysis/tests/select.cpp