Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / selection / selectioncollection-impl.h
index 6d0dc6ce439eb3eb837e65cce8611c4635789cfe..abc938683067dc98fc8485b784db340a83292066 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * 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.
  *
  * GROMACS is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
 
 #include <boost/scoped_ptr.hpp>
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/onlinehelp/helptopicinterface.h"
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/selection.h" // For gmx::SelectionList
+#include "gromacs/selection/selectioncollection.h"
+#include "gromacs/utility/uniqueptr.h"
 
-#include "../onlinehelp/helptopicinterface.h"
-#include "../utility/uniqueptr.h"
-#include "indexutil.h"
 #include "poscalc.h"
-#include "selection.h" // For gmx::SelectionList
-#include "selectioncollection.h"
 #include "selelem.h"
 
+struct gmx_sel_mempool_t;
+struct t_pbc;
+struct t_topology;
+struct t_trxframe;
+
 namespace gmx
 {
 
@@ -99,9 +103,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<gmx::SelectionParserSymbolTable> symtab;
     //! Root of help topic tree (NULL is no help yet requested).
@@ -111,7 +115,7 @@ struct gmx_ana_selcollection_t
 namespace gmx
 {
 
-class MessageStringCollector;
+class ExceptionInitializer;
 
 /*! \internal \brief
  * Private implemention class for SelectionCollection.
@@ -140,18 +144,16 @@ class SelectionCollection::Impl
          *
          * \param[in]    root    Root of selection tree to process.
          * \param        errors  Object for reporting any error messages.
+         * \throws std::bad_alloc if out of memory.
          *
          * Recursively searches the selection tree for unresolved external
          * references.  If one is found, finds the referenced group in
          * \a grps_ and replaces the reference with a constant element that
          * contains the atoms from the referenced group.  Any failures to
          * resolve references are reported to \p errors.
-         *
-         * Does not throw currently, but this is subject to change when more
-         * underlying code is converted to C++.
          */
         void resolveExternalGroups(const gmx::SelectionTreeElementPointer &root,
-                                   MessageStringCollector                 *errors);
+                                   ExceptionInitializer                   *errors);
 
         //! Internal data, used for interfacing with old C code.
         gmx_ana_selcollection_t sc_;
@@ -159,6 +161,8 @@ class SelectionCollection::Impl
         std::string             rpost_;
         //! Default output position type for selections.
         std::string             spost_;
+        //! Largest atom index needed by the selections for evaluation.
+        int                     maxAtomIndex_;
         /*! \brief
          * Debugging level for the collection.
          *
@@ -176,7 +180,8 @@ class SelectionCollection::Impl
         gmx_ana_indexgrps_t    *grps_;
 };
 
-/*! \internal \brief
+/*! \internal
+ * \brief
  * Implements selection evaluation.
  *
  * This class is used to implement SelectionCollection::evaluate() and