From ba5d8e3e2ed68e1daa72e919436bf1fa6da9572a Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Sun, 25 May 2014 07:28:31 +0300 Subject: [PATCH] Remove some typedefs.h dependencies - Replace several typedefs.h dependencies with either forward declarations or includes of the individual headers that are required. - Some other cleanup in the selection code, removing stuff that is no longer necessary for C++. Change-Id: I6b9b3fe5cbbcc8f6bac29c9306cc4c4c57e59479 --- src/gromacs/fileio/enxio.c | 2 ++ src/gromacs/fileio/tngio.cpp | 2 ++ src/gromacs/fileio/tngio.h | 27 +++++++++++-------- src/gromacs/fileio/tngio_for_tools.h | 19 ++++++++----- src/gromacs/fileio/trx.h | 8 +++--- src/gromacs/fileio/vmdio.c | 7 +++-- src/gromacs/fileio/vmdio.h | 18 +++++++------ src/gromacs/fileio/xdrf.h | 8 +++--- src/gromacs/fileio/xtcio.h | 8 +++--- src/gromacs/pbcutil/pbc.c | 2 +- src/gromacs/pbcutil/rmpbc.c | 1 + src/gromacs/pbcutil/rmpbc.h | 4 +-- src/gromacs/selection/centerofmass.cpp | 4 +-- src/gromacs/selection/centerofmass.h | 8 +++++- src/gromacs/selection/evaluate.h | 18 ++++++------- src/gromacs/selection/indexutil.cpp | 3 ++- src/gromacs/selection/indexutil.h | 19 ++++++++----- src/gromacs/selection/nbsearch.cpp | 2 -- src/gromacs/selection/nbsearch.h | 9 +++---- src/gromacs/selection/poscalc.cpp | 9 +++---- src/gromacs/selection/poscalc.h | 15 ++++++----- src/gromacs/selection/position.cpp | 2 -- src/gromacs/selection/scanner_internal.cpp | 2 -- src/gromacs/selection/selection.cpp | 4 ++- src/gromacs/selection/selection.h | 5 ++-- .../selection/selectioncollection-impl.h | 13 +++++---- src/gromacs/selection/selectioncollection.cpp | 1 + src/gromacs/selection/selectioncollection.h | 7 ++++- src/gromacs/selection/selmethod.h | 18 ++++++------- src/gromacs/selection/sm_simple.cpp | 1 + src/gromacs/selection/tests/poscalc.cpp | 4 +-- .../selection/tests/selectioncollection.cpp | 1 + src/gromacs/selection/tests/toputils.h | 5 ++-- src/gromacs/trajectoryanalysis.h | 2 ++ .../trajectoryanalysis/analysismodule.h | 5 ++-- .../trajectoryanalysis/analysissettings.h | 7 ++--- .../trajectoryanalysis/cmdlinerunner.cpp | 1 + .../trajectoryanalysis/modules/angle.cpp | 1 + .../trajectoryanalysis/modules/distance.cpp | 1 + .../trajectoryanalysis/modules/freevolume.cpp | 2 ++ src/gromacs/trajectoryanalysis/modules/nsc.h | 7 ++++- .../trajectoryanalysis/modules/sasa.cpp | 2 ++ src/gromacs/trajectoryanalysis/runnercommon.h | 3 ++- 43 files changed, 173 insertions(+), 114 deletions(-) diff --git a/src/gromacs/fileio/enxio.c b/src/gromacs/fileio/enxio.c index 4ba3496372..0548c4673f 100644 --- a/src/gromacs/fileio/enxio.c +++ b/src/gromacs/fileio/enxio.c @@ -47,8 +47,10 @@ #include "gromacs/math/vec.h" #include "xdrf.h" #include "macros.h" +#include "typedefs.h" #include "gromacs/pbcutil/pbc.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/fileio/tngio.cpp b/src/gromacs/fileio/tngio.cpp index a4b72f9dee..7a2cb969da 100644 --- a/src/gromacs/fileio/tngio.cpp +++ b/src/gromacs/fileio/tngio.cpp @@ -47,10 +47,12 @@ #endif #include "gromacs/legacyheaders/copyrite.h" +#include "gromacs/legacyheaders/types/ifunc.h" #include "gromacs/fileio/gmxfio.h" #include "gromacs/math/units.h" #include "gromacs/math/utilities.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/basenetwork.h" #include "gromacs/utility/common.h" #include "gromacs/utility/fatalerror.h" diff --git a/src/gromacs/fileio/tngio.h b/src/gromacs/fileio/tngio.h index e899a23373..375cd6c7c8 100644 --- a/src/gromacs/fileio/tngio.h +++ b/src/gromacs/fileio/tngio.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -36,8 +36,11 @@ #ifndef GMX_FILEIO_TNGIO_H #define GMX_FILEIO_TNGIO_H -#include "gromacs/legacyheaders/typedefs.h" -#include "../../external/tng_io/include/tng_io_fwd.h" +#include "external/tng_io/include/tng_io_fwd.h" + +#include "gromacs/legacyheaders/types/inputrec.h" +#include "gromacs/math/vectypes.h" +#include "gromacs/utility/real.h" #ifdef __cplusplus extern "C" { @@ -46,6 +49,8 @@ extern "C" { } #endif +struct gmx_mtop_t; + /*! \brief Open a TNG trajectory file * * \param filename Name of file to open @@ -67,8 +72,8 @@ void gmx_tng_close(tng_trajectory_t *tng); * \param tng Valid handle to a TNG trajectory * \param mtop Pointer to a topology (can be NULL) */ -void gmx_tng_add_mtop(tng_trajectory_t tng, - const gmx_mtop_t *mtop); +void gmx_tng_add_mtop(tng_trajectory_t tng, + const struct gmx_mtop_t *mtop); /*! \brief Do all TNG preparation for full-precision whole-system * trajectory writing during MD simulations. @@ -77,9 +82,9 @@ void gmx_tng_add_mtop(tng_trajectory_t tng, * \param mtop Global topology * \param ir Input settings (for writing frequencies) */ -void gmx_tng_prepare_md_writing(tng_trajectory_t tng, - const gmx_mtop_t *mtop, - const t_inputrec *ir); +void gmx_tng_prepare_md_writing(tng_trajectory_t tng, + const struct gmx_mtop_t *mtop, + const t_inputrec *ir); /*! \brief Set the default compression precision for TNG writing * @@ -95,9 +100,9 @@ void gmx_tng_set_compression_precision(tng_trajectory_t tng, * \param mtop Global topology * \param ir Input settings (for writing frequencies) */ -void gmx_tng_prepare_low_prec_writing(tng_trajectory_t tng, - const gmx_mtop_t *mtop, - const t_inputrec *ir); +void gmx_tng_prepare_low_prec_writing(tng_trajectory_t tng, + const struct gmx_mtop_t *mtop, + const t_inputrec *ir); /*! \brief Write a frame to a TNG file * diff --git a/src/gromacs/fileio/tngio_for_tools.h b/src/gromacs/fileio/tngio_for_tools.h index ed9cc84a67..6dbfee1708 100644 --- a/src/gromacs/fileio/tngio_for_tools.h +++ b/src/gromacs/fileio/tngio_for_tools.h @@ -32,12 +32,16 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ - #ifndef GMX_FILEIO_TNGIO_FOR_TOOLS_H #define GMX_FILEIO_TNGIO_FOR_TOOLS_H -#include "gromacs/legacyheaders/typedefs.h" -#include "../../external/tng_io/include/tng_io_fwd.h" +#include + +#include "external/tng_io/include/tng_io_fwd.h" + +#include "gromacs/legacyheaders/types/simple.h" +#include "gromacs/utility/basedefinitions.h" +#include "gromacs/utility/real.h" #ifdef __cplusplus extern "C" { @@ -46,13 +50,16 @@ extern "C" { } #endif +struct gmx_mtop_t; +struct t_trxframe; + /*! \brief Prepare to write TNG output from trajectory conversion tools */ void gmx_prepare_tng_writing(const char *filename, char mode, tng_trajectory_t *in, tng_trajectory_t *out, int nAtoms, - const gmx_mtop_t *mtop, + const struct gmx_mtop_t *mtop, const atom_id *index, const char *indexGroupName); @@ -67,7 +74,7 @@ void gmx_prepare_tng_writing(const char *filename, * atoms. */ void gmx_write_tng_from_trxframe(tng_trajectory_t output, - t_trxframe *frame, + struct t_trxframe *frame, int natoms); /*! \brief Creates a molecule containing only the indexed atoms and sets @@ -80,7 +87,7 @@ void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng, /*! \brief Read the first/next TNG frame. */ gmx_bool gmx_read_next_tng_frame(tng_trajectory_t input, - t_trxframe *fr, + struct t_trxframe *fr, gmx_int64_t *requestedIds, int numRequestedIds); diff --git a/src/gromacs/fileio/trx.h b/src/gromacs/fileio/trx.h index 70a32b9fd8..85b311473d 100644 --- a/src/gromacs/fileio/trx.h +++ b/src/gromacs/fileio/trx.h @@ -43,9 +43,9 @@ #ifndef GMX_FILEIO_TRX_H #define GMX_FILEIO_TRX_H -#include "gromacs/math/vectypes.h" -#include "gromacs/utility/basedefinitions.h" -#include "gromacs/utility/real.h" +#include "../math/vectypes.h" +#include "../utility/basedefinitions.h" +#include "../utility/real.h" #ifdef __cplusplus extern "C" { @@ -55,7 +55,7 @@ struct t_atoms; typedef struct gmxvmdplugin t_gmxvmdplugin; -typedef struct trxframe +typedef struct t_trxframe { int flags; /* flags for read_first/next_frame */ int not_ok; /* integrity flags */ diff --git a/src/gromacs/fileio/vmdio.c b/src/gromacs/fileio/vmdio.c index 2ded1c8842..5fc17e8a32 100644 --- a/src/gromacs/fileio/vmdio.c +++ b/src/gromacs/fileio/vmdio.c @@ -32,6 +32,7 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#include "vmdio.h" #ifdef HAVE_CONFIG_H #include @@ -102,10 +103,8 @@ #include #endif -#include "vmdio.h" - -#include "gmxfio.h" - +#include "gromacs/fileio/gmxfio.h" +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/futil.h" diff --git a/src/gromacs/fileio/vmdio.h b/src/gromacs/fileio/vmdio.h index 6e11d75d54..ec4d1250ad 100644 --- a/src/gromacs/fileio/vmdio.h +++ b/src/gromacs/fileio/vmdio.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -32,17 +32,19 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ - -#ifndef GMX_FILEIO_VMDIO_H_ -#define GMX_FILEIO_VMDIO_H_ +#ifndef GMX_FILEIO_VMDIO_H +#define GMX_FILEIO_VMDIO_H #include "external/vmd_molfile/molfile_plugin.h" -#include "trx.h" + +#include "gromacs/utility/basedefinitions.h" #ifdef __cplusplus extern "C" { #endif +struct t_trxframe; + struct gmxvmdplugin { molfile_plugin_t *api; @@ -51,11 +53,11 @@ struct gmxvmdplugin gmx_bool bV; }; -int read_first_vmd_frame(const char *fn, struct trxframe *fr); -gmx_bool read_next_vmd_frame(struct trxframe *fr); +int read_first_vmd_frame(const char *fn, struct t_trxframe *fr); +gmx_bool read_next_vmd_frame(struct t_trxframe *fr); #ifdef __cplusplus } #endif -#endif /* GMX_FILEIO_VMDIO_H_ */ +#endif diff --git a/src/gromacs/fileio/xdrf.h b/src/gromacs/fileio/xdrf.h index 830867f728..5563c58e86 100644 --- a/src/gromacs/fileio/xdrf.h +++ b/src/gromacs/fileio/xdrf.h @@ -2,8 +2,8 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team, - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2001-2004, The GROMACS development team. + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,7 +38,9 @@ #define GMX_FILEIO_XDRF_H #include -#include "../legacyheaders/typedefs.h" + +#include "gromacs/utility/basedefinitions.h" +#include "gromacs/utility/real.h" #ifdef __PGI /*Portland group compiler*/ #define int64_t long long diff --git a/src/gromacs/fileio/xtcio.h b/src/gromacs/fileio/xtcio.h index 494cd863be..18ebc044c9 100644 --- a/src/gromacs/fileio/xtcio.h +++ b/src/gromacs/fileio/xtcio.h @@ -2,8 +2,8 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team, - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2001-2004, The GROMACS development team. + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,7 +38,9 @@ #ifndef GMX_FILEIO_XTCIO_H #define GMX_FILEIO_XTCIO_H -#include "../legacyheaders/typedefs.h" +#include "../math/vectypes.h" +#include "../utility/basedefinitions.h" +#include "../utility/real.h" #include "gmxfio.h" #ifdef __cplusplus diff --git a/src/gromacs/pbcutil/pbc.c b/src/gromacs/pbcutil/pbc.c index d2ebf4f8f8..91e92d9c13 100644 --- a/src/gromacs/pbcutil/pbc.c +++ b/src/gromacs/pbcutil/pbc.c @@ -43,7 +43,7 @@ #include #include -#include "typedefs.h" +#include "gromacs/legacyheaders/types/inputrec.h" #include "types/commrec.h" #include "txtdump.h" #include "names.h" diff --git a/src/gromacs/pbcutil/rmpbc.c b/src/gromacs/pbcutil/rmpbc.c index 98d8d12048..8990a41a74 100644 --- a/src/gromacs/pbcutil/rmpbc.c +++ b/src/gromacs/pbcutil/rmpbc.c @@ -40,6 +40,7 @@ #include #endif +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/pbcutil/mshift.h" #include "gromacs/pbcutil/pbc.h" diff --git a/src/gromacs/pbcutil/rmpbc.h b/src/gromacs/pbcutil/rmpbc.h index 2fe50b0e6c..3f90bdb265 100644 --- a/src/gromacs/pbcutil/rmpbc.h +++ b/src/gromacs/pbcutil/rmpbc.h @@ -37,7 +37,6 @@ #ifndef GMX_PBCUTIL_RMPBC_H #define GMX_PBCUTIL_RMPBC_H -#include "../fileio/trx.h" #include "../math/vectypes.h" #ifdef __cplusplus @@ -46,6 +45,7 @@ extern "C" { struct t_atoms; struct t_idef; +struct t_trxframe; typedef struct gmx_rmpbc *gmx_rmpbc_t; @@ -65,7 +65,7 @@ void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[], rvec x_s[]); /* As gmx_rmpbc, but outputs in x_s and does not modify x. */ -void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, t_trxframe *fr); +void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, struct t_trxframe *fr); /* As gmx_rmpbc but operates on a t_trxframe data structure. */ void rm_gropbc(struct t_atoms *atoms, rvec x[], matrix box); diff --git a/src/gromacs/selection/centerofmass.cpp b/src/gromacs/selection/centerofmass.cpp index fdbd7852fc..a50e15d660 100644 --- a/src/gromacs/selection/centerofmass.cpp +++ b/src/gromacs/selection/centerofmass.cpp @@ -43,10 +43,10 @@ #include -#include "gromacs/legacyheaders/typedefs.h" - #include "gromacs/math/vec.h" #include "gromacs/pbcutil/pbc.h" +#include "gromacs/topology/block.h" +#include "gromacs/topology/topology.h" int gmx_calc_cog(t_topology * /* top */, rvec x[], int nrefat, atom_id index[], rvec xout) diff --git a/src/gromacs/selection/centerofmass.h b/src/gromacs/selection/centerofmass.h index 7cefe1a02b..494d39b26e 100644 --- a/src/gromacs/selection/centerofmass.h +++ b/src/gromacs/selection/centerofmass.h @@ -74,7 +74,13 @@ #ifndef GMX_SELECTION_CENTEROFMASS_H #define GMX_SELECTION_CENTEROFMASS_H -#include "../legacyheaders/typedefs.h" +#include "../legacyheaders/types/simple.h" +#include "../math/vectypes.h" + +struct t_block; +struct t_blocka; +struct t_pbc; +struct t_topology; /*! \brief * Calculate a single center of geometry. diff --git a/src/gromacs/selection/evaluate.h b/src/gromacs/selection/evaluate.h index df0aefeb06..337e9be336 100644 --- a/src/gromacs/selection/evaluate.h +++ b/src/gromacs/selection/evaluate.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -49,21 +49,21 @@ #ifndef GMX_SELECTION_EVALUATE_H #define GMX_SELECTION_EVALUATE_H -#include "gromacs/legacyheaders/typedefs.h" - -#include "gromacs/selection/indexutil.h" - #include "selelem.h" +struct gmx_ana_index_t; struct gmx_sel_mempool_t; +struct t_pbc; +struct t_topology; +struct t_trxframe; /*! \internal \brief * Data structure for passing information required during evaluation. */ -typedef struct gmx_sel_evaluate_t +struct gmx_sel_evaluate_t { /** Memory pool for intermediate values. */ - struct gmx_sel_mempool_t *mp; + gmx_sel_mempool_t *mp; /** Index group that contains all the atoms. */ gmx_ana_index_t *gall; /** Topology information. */ @@ -72,7 +72,7 @@ typedef struct gmx_sel_evaluate_t t_trxframe *fr; /** PBC data. */ t_pbc *pbc; -} gmx_sel_evaluate_t; +}; /*! \name Utility functions */ @@ -80,7 +80,7 @@ typedef struct gmx_sel_evaluate_t /** Initializes an evaluation data structure. */ void _gmx_sel_evaluate_init(gmx_sel_evaluate_t *data, - struct gmx_sel_mempool_t *mp, gmx_ana_index_t *gall, + gmx_sel_mempool_t *mp, gmx_ana_index_t *gall, t_topology *top, t_trxframe *fr, t_pbc *pbc); /** Evaluates the children of a general selection element. */ void diff --git a/src/gromacs/selection/indexutil.cpp b/src/gromacs/selection/indexutil.cpp index 3874cc8a5c..fcfe0b8f0a 100644 --- a/src/gromacs/selection/indexutil.cpp +++ b/src/gromacs/selection/indexutil.cpp @@ -50,6 +50,7 @@ #include "gromacs/legacyheaders/index.h" #include "gromacs/topology/block.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/smalloc.h" @@ -247,7 +248,7 @@ gmx_ana_indexgrps_find(gmx_ana_index_t *dest, std::string *destName, int n = find_group(const_cast(name), src->nr, const_cast(names)); sfree(names); - if (n == NOTSET) + if (n < 0) { dest->isize = 0; return false; diff --git a/src/gromacs/selection/indexutil.h b/src/gromacs/selection/indexutil.h index 9092febb4a..f9b4b3f46c 100644 --- a/src/gromacs/selection/indexutil.h +++ b/src/gromacs/selection/indexutil.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -61,12 +61,17 @@ #ifndef GMX_SELECTION_INDEXUTIL_H #define GMX_SELECTION_INDEXUTIL_H +#include + #include -#include "../legacyheaders/typedefs.h" +#include "../legacyheaders/types/simple.h" +#include "../topology/block.h" + +struct t_topology; /** Stores a set of index groups. */ -typedef struct gmx_ana_indexgrps_t gmx_ana_indexgrps_t; +struct gmx_ana_indexgrps_t; /*! \brief * Specifies the type of index partition or index mapping in several contexts. @@ -85,7 +90,7 @@ typedef enum /*! \brief * Stores a single index group. */ -typedef struct gmx_ana_index_t +struct gmx_ana_index_t { /** Number of atoms. */ int isize; @@ -93,12 +98,12 @@ typedef struct gmx_ana_index_t atom_id *index; /** Number of items allocated for \p index. */ int nalloc_index; -} gmx_ana_index_t; +}; /*! \brief * Data structure for calculating index group mappings. */ -typedef struct gmx_ana_indexmap_t +struct gmx_ana_indexmap_t { /** Type of the mapping. */ e_index_t type; @@ -168,7 +173,7 @@ typedef struct gmx_ana_indexmap_t * actually static. */ bool bStatic; -} gmx_ana_indexmap_t; +}; /*! \name Functions for handling gmx_ana_indexgrps_t diff --git a/src/gromacs/selection/nbsearch.cpp b/src/gromacs/selection/nbsearch.cpp index 9df5687f34..32b2d330f7 100644 --- a/src/gromacs/selection/nbsearch.cpp +++ b/src/gromacs/selection/nbsearch.cpp @@ -64,8 +64,6 @@ #include "thread_mpi/mutex.h" -#include "gromacs/legacyheaders/typedefs.h" - #include "gromacs/math/vec.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/selection/position.h" diff --git a/src/gromacs/selection/nbsearch.h b/src/gromacs/selection/nbsearch.h index c3a2994824..4732ae0b31 100644 --- a/src/gromacs/selection/nbsearch.h +++ b/src/gromacs/selection/nbsearch.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,13 +51,12 @@ #include -#include "../legacyheaders/typedefs.h" +#include "../math/vectypes.h" #include "../utility/common.h" #include "../utility/gmxassert.h" +#include "../utility/real.h" -#include "indexutil.h" - -struct gmx_ana_pos_t; +struct t_pbc; namespace gmx { diff --git a/src/gromacs/selection/poscalc.cpp b/src/gromacs/selection/poscalc.cpp index 5727a81a4f..72f00e7756 100644 --- a/src/gromacs/selection/poscalc.cpp +++ b/src/gromacs/selection/poscalc.cpp @@ -61,8 +61,7 @@ */ #include -#include "gromacs/legacyheaders/typedefs.h" - +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/selection/centerofmass.h" #include "gromacs/selection/indexutil.h" @@ -187,11 +186,11 @@ struct gmx_ana_poscalc_t * already been calculated in \p sbase. * The structure pointed by \p sbase is always a static calculation. */ - struct gmx_ana_poscalc_t *sbase; + gmx_ana_poscalc_t *sbase; /** Next structure in the linked list of calculations. */ - struct gmx_ana_poscalc_t *next; + gmx_ana_poscalc_t *next; /** Previous structure in the linked list of calculations. */ - struct gmx_ana_poscalc_t *prev; + gmx_ana_poscalc_t *prev; /** Number of references to this structure. */ int refcount; /** Collection this calculation belongs to. */ diff --git a/src/gromacs/selection/poscalc.h b/src/gromacs/selection/poscalc.h index 9ddc0fd46c..fead217d1b 100644 --- a/src/gromacs/selection/poscalc.h +++ b/src/gromacs/selection/poscalc.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -52,7 +52,7 @@ #ifndef GMX_SELECTION_POSCALC_H #define GMX_SELECTION_POSCALC_H -#include "../legacyheaders/typedefs.h" +#include #include "../utility/common.h" @@ -127,10 +127,13 @@ typedef enum } e_poscalc_t; /** Data structure for position calculation. */ -typedef struct gmx_ana_poscalc_t gmx_ana_poscalc_t; +struct gmx_ana_poscalc_t; struct gmx_ana_index_t; struct gmx_ana_pos_t; +struct t_pbc; +struct t_topology; +struct t_trxframe; namespace gmx { @@ -323,10 +326,10 @@ void gmx_ana_poscalc_set_flags(gmx_ana_poscalc_t *pc, int flags); /** Sets the maximum possible input index group for position calculation. */ void -gmx_ana_poscalc_set_maxindex(gmx_ana_poscalc_t *pc, struct gmx_ana_index_t *g); +gmx_ana_poscalc_set_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g); /** Initializes positions for position calculation output. */ void -gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, struct gmx_ana_pos_t *p); +gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p); /** Frees the memory allocated for position calculation. */ void gmx_ana_poscalc_free(gmx_ana_poscalc_t *pc); @@ -337,7 +340,7 @@ gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc); /** Updates a single COM/COG structure for a frame. */ void gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, - struct gmx_ana_pos_t *p, struct gmx_ana_index_t *g, + gmx_ana_pos_t *p, gmx_ana_index_t *g, t_trxframe *fr, t_pbc *pbc); #endif diff --git a/src/gromacs/selection/position.cpp b/src/gromacs/selection/position.cpp index 795a08f3f6..c33cdc3d86 100644 --- a/src/gromacs/selection/position.cpp +++ b/src/gromacs/selection/position.cpp @@ -43,8 +43,6 @@ #include -#include "gromacs/legacyheaders/typedefs.h" - #include "gromacs/math/vec.h" #include "gromacs/selection/indexutil.h" #include "gromacs/utility/gmxassert.h" diff --git a/src/gromacs/selection/scanner_internal.cpp b/src/gromacs/selection/scanner_internal.cpp index 0f0457121a..9fdebc7118 100644 --- a/src/gromacs/selection/scanner_internal.cpp +++ b/src/gromacs/selection/scanner_internal.cpp @@ -56,8 +56,6 @@ #include -#include "gromacs/legacyheaders/typedefs.h" - #include "gromacs/utility/cstringutil.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/gmxassert.h" diff --git a/src/gromacs/selection/selection.cpp b/src/gromacs/selection/selection.cpp index 786fb9912a..795b08065e 100644 --- a/src/gromacs/selection/selection.cpp +++ b/src/gromacs/selection/selection.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,6 +41,8 @@ */ #include "selection.h" +#include "gromacs/topology/topology.h" + #include "nbsearch.h" #include "position.h" #include "selelem.h" diff --git a/src/gromacs/selection/selection.h b/src/gromacs/selection/selection.h index a09167d5a5..b027a5ed8a 100644 --- a/src/gromacs/selection/selection.h +++ b/src/gromacs/selection/selection.h @@ -46,16 +46,15 @@ #include #include -#include "../legacyheaders/typedefs.h" - #include "../utility/arrayref.h" #include "../utility/common.h" #include "../utility/gmxassert.h" #include "position.h" -#include "indexutil.h" #include "selectionenums.h" +struct t_topology; + namespace gmx { diff --git a/src/gromacs/selection/selectioncollection-impl.h b/src/gromacs/selection/selectioncollection-impl.h index d44f2124fe..a0af8d0659 100644 --- a/src/gromacs/selection/selectioncollection-impl.h +++ b/src/gromacs/selection/selectioncollection-impl.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,8 +50,6 @@ #include -#include "../legacyheaders/typedefs.h" - #include "../onlinehelp/helptopicinterface.h" #include "../utility/uniqueptr.h" #include "indexutil.h" @@ -60,6 +58,11 @@ #include "selectioncollection.h" #include "selelem.h" +struct gmx_sel_mempool_t; +struct t_pbc; +struct t_topology; +struct t_trxframe; + namespace gmx { @@ -99,9 +102,9 @@ struct gmx_ana_selcollection_t /** Topology for the collection. */ t_topology *top; /** Index group that contains all the atoms. */ - struct gmx_ana_index_t gall; + gmx_ana_index_t gall; /** Memory pool used for selection evaluation. */ - struct gmx_sel_mempool_t *mempool; + gmx_sel_mempool_t *mempool; //! Parser symbol table. boost::scoped_ptr symtab; //! Root of help topic tree (NULL is no help yet requested). diff --git a/src/gromacs/selection/selectioncollection.cpp b/src/gromacs/selection/selectioncollection.cpp index df91fe990e..58c367b8a8 100644 --- a/src/gromacs/selection/selectioncollection.cpp +++ b/src/gromacs/selection/selectioncollection.cpp @@ -56,6 +56,7 @@ #include "gromacs/options/basicoptions.h" #include "gromacs/options/options.h" #include "gromacs/selection/selection.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/file.h" #include "gromacs/utility/gmxassert.h" diff --git a/src/gromacs/selection/selectioncollection.h b/src/gromacs/selection/selectioncollection.h index cf79b660bd..aac15039ee 100644 --- a/src/gromacs/selection/selectioncollection.h +++ b/src/gromacs/selection/selectioncollection.h @@ -43,16 +43,21 @@ #ifndef GMX_SELECTION_SELECTIONCOLLECTION_H #define GMX_SELECTION_SELECTIONCOLLECTION_H +#include + #include #include -#include "../legacyheaders/typedefs.h" +#include "../legacyheaders/types/oenv.h" #include "../onlinehelp/helptopicinterface.h" #include "../utility/common.h" #include "selection.h" // For gmx::SelectionList struct gmx_ana_indexgrps_t; +struct t_pbc; +struct t_topology; +struct t_trxframe; namespace gmx { diff --git a/src/gromacs/selection/selmethod.h b/src/gromacs/selection/selmethod.h index 5d80abe934..3a2167d797 100644 --- a/src/gromacs/selection/selmethod.h +++ b/src/gromacs/selection/selmethod.h @@ -293,9 +293,6 @@ #ifndef GMX_SELECTION_SELMETHOD_H #define GMX_SELECTION_SELMETHOD_H -#include "../legacyheaders/typedefs.h" - -#include "indexutil.h" #include "selparam.h" #include "selvalue.h" @@ -305,8 +302,12 @@ class PositionCalculationCollection; class SelectionParserSymbolTable; } // namespace gmx +struct gmx_ana_index_t; struct gmx_ana_pos_t; struct gmx_ana_selcollection_t; +struct t_pbc; +struct t_topology; +struct t_trxframe; /*! \name Selection method flags * \anchor selmethod_flags @@ -573,8 +574,7 @@ typedef void (*sel_updatefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc, * pointers that can be discarded without memory leaks. */ typedef void (*sel_updatefunc_pos)(t_topology *top, t_trxframe *fr, t_pbc *pbc, - struct gmx_ana_pos_t *pos, - gmx_ana_selvalue_t *out, + gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data); /*! \internal @@ -584,7 +584,7 @@ typedef void (*sel_updatefunc_pos)(t_topology *top, t_trxframe *fr, t_pbc *pbc, * If some information is not available, the corresponding field can be set to * 0/NULL. */ -typedef struct gmx_ana_selmethod_help_t +struct gmx_ana_selmethod_help_t { /*! \brief * One-line description of the syntax of the method. @@ -605,7 +605,7 @@ typedef struct gmx_ana_selmethod_help_t * to NULL. */ const char **help; -} gmx_ana_selmethod_help_t; +}; /*! \internal * \brief @@ -620,7 +620,7 @@ typedef struct gmx_ana_selmethod_help_t * More details on implementing new selection methods can be found on a * separate page: \ref page_module_selection_custom. */ -typedef struct gmx_ana_selmethod_t +struct gmx_ana_selmethod_t { /** Name of the method. */ const char *name; @@ -657,7 +657,7 @@ typedef struct gmx_ana_selmethod_t /** Help data for the method. */ gmx_ana_selmethod_help_t help; -} gmx_ana_selmethod_t; +}; /** Registers a selection method. */ int diff --git a/src/gromacs/selection/sm_simple.cpp b/src/gromacs/selection/sm_simple.cpp index cc61a684b7..0f118367c1 100644 --- a/src/gromacs/selection/sm_simple.cpp +++ b/src/gromacs/selection/sm_simple.cpp @@ -43,6 +43,7 @@ #include "gromacs/legacyheaders/macros.h" +#include "gromacs/topology/topology.h" #include "gromacs/selection/position.h" #include "gromacs/selection/selmethod.h" #include "gromacs/utility/exceptions.h" diff --git a/src/gromacs/selection/tests/poscalc.cpp b/src/gromacs/selection/tests/poscalc.cpp index a5a8d9faa7..db01535ba1 100644 --- a/src/gromacs/selection/tests/poscalc.cpp +++ b/src/gromacs/selection/tests/poscalc.cpp @@ -43,12 +43,12 @@ #include -#include "gromacs/legacyheaders/typedefs.h" - +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/selection/indexutil.h" #include "gromacs/selection/poscalc.h" #include "gromacs/selection/position.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/smalloc.h" #include "gromacs/utility/uniqueptr.h" diff --git a/src/gromacs/selection/tests/selectioncollection.cpp b/src/gromacs/selection/tests/selectioncollection.cpp index f106e2f4af..4475798b5d 100644 --- a/src/gromacs/selection/tests/selectioncollection.cpp +++ b/src/gromacs/selection/tests/selectioncollection.cpp @@ -46,6 +46,7 @@ #include "gromacs/selection/indexutil.h" #include "gromacs/selection/selectioncollection.h" #include "gromacs/selection/selection.h" +#include "gromacs/topology/topology.h" #include "gromacs/utility/arrayref.h" #include "gromacs/utility/exceptions.h" #include "gromacs/utility/flags.h" diff --git a/src/gromacs/selection/tests/toputils.h b/src/gromacs/selection/tests/toputils.h index 94ab8c3139..c5dec1c429 100644 --- a/src/gromacs/selection/tests/toputils.h +++ b/src/gromacs/selection/tests/toputils.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -44,7 +44,8 @@ #include -#include "gromacs/legacyheaders/typedefs.h" +struct t_topology; +struct t_trxframe; namespace gmx { diff --git a/src/gromacs/trajectoryanalysis.h b/src/gromacs/trajectoryanalysis.h index 2942a303a8..3a33b0d2cb 100644 --- a/src/gromacs/trajectoryanalysis.h +++ b/src/gromacs/trajectoryanalysis.h @@ -280,7 +280,9 @@ #include "options.h" #include "selection.h" +#include "fileio/trx.h" #include "selection/nbsearch.h" +#include "topology/topology.h" #include "trajectoryanalysis/analysismodule.h" #include "trajectoryanalysis/analysissettings.h" #include "trajectoryanalysis/cmdlinerunner.h" diff --git a/src/gromacs/trajectoryanalysis/analysismodule.h b/src/gromacs/trajectoryanalysis/analysismodule.h index 9ae568aebd..0a26830726 100644 --- a/src/gromacs/trajectoryanalysis/analysismodule.h +++ b/src/gromacs/trajectoryanalysis/analysismodule.h @@ -47,12 +47,13 @@ #include #include -#include "../legacyheaders/typedefs.h" - #include "../selection/selection.h" // For gmx::SelectionList #include "../utility/common.h" #include "../utility/uniqueptr.h" +struct t_pbc; +struct t_trxframe; + namespace gmx { diff --git a/src/gromacs/trajectoryanalysis/analysissettings.h b/src/gromacs/trajectoryanalysis/analysissettings.h index 391b3791d8..7687fdf178 100644 --- a/src/gromacs/trajectoryanalysis/analysissettings.h +++ b/src/gromacs/trajectoryanalysis/analysissettings.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,11 +43,12 @@ #ifndef GMX_TRAJECTORYANALYSIS_ANALYSISSETTINGS_H #define GMX_TRAJECTORYANALYSIS_ANALYSISSETTINGS_H -#include "../legacyheaders/typedefs.h" - #include "../options/timeunitmanager.h" +#include "../math/vectypes.h" #include "../utility/common.h" +struct t_topology; + namespace gmx { diff --git a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp index cf213f109f..b7165f94bf 100644 --- a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp +++ b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp @@ -51,6 +51,7 @@ #include "gromacs/commandline/cmdlinemodule.h" #include "gromacs/commandline/cmdlinemodulemanager.h" #include "gromacs/commandline/cmdlineparser.h" +#include "gromacs/fileio/trx.h" #include "gromacs/options/options.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/selection/selectioncollection.h" diff --git a/src/gromacs/trajectoryanalysis/modules/angle.cpp b/src/gromacs/trajectoryanalysis/modules/angle.cpp index 679a417bd4..977840e6fa 100644 --- a/src/gromacs/trajectoryanalysis/modules/angle.cpp +++ b/src/gromacs/trajectoryanalysis/modules/angle.cpp @@ -49,6 +49,7 @@ #include "gromacs/analysisdata/modules/average.h" #include "gromacs/analysisdata/modules/histogram.h" #include "gromacs/analysisdata/modules/plot.h" +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" diff --git a/src/gromacs/trajectoryanalysis/modules/distance.cpp b/src/gromacs/trajectoryanalysis/modules/distance.cpp index e1f2a390c9..fde8a4d7c6 100644 --- a/src/gromacs/trajectoryanalysis/modules/distance.cpp +++ b/src/gromacs/trajectoryanalysis/modules/distance.cpp @@ -47,6 +47,7 @@ #include "gromacs/analysisdata/modules/average.h" #include "gromacs/analysisdata/modules/histogram.h" #include "gromacs/analysisdata/modules/plot.h" +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" diff --git a/src/gromacs/trajectoryanalysis/modules/freevolume.cpp b/src/gromacs/trajectoryanalysis/modules/freevolume.cpp index ae72883416..5add615390 100644 --- a/src/gromacs/trajectoryanalysis/modules/freevolume.cpp +++ b/src/gromacs/trajectoryanalysis/modules/freevolume.cpp @@ -49,6 +49,7 @@ #include "gromacs/analysisdata/analysisdata.h" #include "gromacs/analysisdata/modules/average.h" #include "gromacs/analysisdata/modules/plot.h" +#include "gromacs/fileio/trx.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" #include "gromacs/options/filenameoption.h" @@ -58,6 +59,7 @@ #include "gromacs/selection/nbsearch.h" #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" +#include "gromacs/topology/topology.h" #include "gromacs/trajectoryanalysis/analysissettings.h" #include "gromacs/utility/arrayref.h" #include "gromacs/utility/exceptions.h" diff --git a/src/gromacs/trajectoryanalysis/modules/nsc.h b/src/gromacs/trajectoryanalysis/modules/nsc.h index 6394c56a6b..bb39b9f350 100644 --- a/src/gromacs/trajectoryanalysis/modules/nsc.h +++ b/src/gromacs/trajectoryanalysis/modules/nsc.h @@ -34,7 +34,10 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ -#include "typedefs.h" +#ifndef GMX_TRAJECTORYANALYSIS_NSC_H +#define GMX_TRAJECTORYANALYSIS_NSC_H + +#include "gromacs/legacyheaders/types/simple.h" #define FLAG_DOTS 01 #define FLAG_VOLUME 02 @@ -142,3 +145,5 @@ int nsc_dclm_pbc(const rvec *coords, real *radius, int nat, #ifdef __cplusplus } #endif + +#endif diff --git a/src/gromacs/trajectoryanalysis/modules/sasa.cpp b/src/gromacs/trajectoryanalysis/modules/sasa.cpp index ac14aa0567..087a8eea33 100644 --- a/src/gromacs/trajectoryanalysis/modules/sasa.cpp +++ b/src/gromacs/trajectoryanalysis/modules/sasa.cpp @@ -55,6 +55,7 @@ #include "gromacs/analysisdata/modules/plot.h" #include "gromacs/fileio/confio.h" #include "gromacs/fileio/pdbio.h" +#include "gromacs/fileio/trx.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" #include "gromacs/options/basicoptions.h" @@ -64,6 +65,7 @@ #include "gromacs/selection/selection.h" #include "gromacs/selection/selectionoption.h" #include "gromacs/topology/symtab.h" +#include "gromacs/topology/topology.h" #include "gromacs/trajectoryanalysis/analysismodule.h" #include "gromacs/trajectoryanalysis/analysissettings.h" #include "gromacs/utility/exceptions.h" diff --git a/src/gromacs/trajectoryanalysis/runnercommon.h b/src/gromacs/trajectoryanalysis/runnercommon.h index 1ece73f6d5..e8753db775 100644 --- a/src/gromacs/trajectoryanalysis/runnercommon.h +++ b/src/gromacs/trajectoryanalysis/runnercommon.h @@ -42,9 +42,10 @@ #ifndef GMX_TRAJECTORYANALYSIS_RUNNERCOMMON_H #define GMX_TRAJECTORYANALYSIS_RUNNERCOMMON_H -#include "gromacs/fileio/trx.h" #include "gromacs/utility/common.h" +struct t_trxframe; + namespace gmx { -- 2.22.0