Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / selection / selelem.h
index bcb67c768ac030533c09e6aa1c6dac53e92d52ee..ddc429850f7f3e8d7d2a89a33a72afad46d54e37 100644 (file)
 
 #include <boost/shared_ptr.hpp>
 
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/selection/indexutil.h"
 #include "gromacs/utility/common.h"
+#include "gromacs/utility/real.h"
 
-#include "indexutil.h"
 #include "selvalue.h"
 
 struct gmx_ana_poscalc_t;
@@ -339,14 +339,24 @@ class SelectionTreeElement
         void checkUnsortedAtoms(bool                  bUnsortedAllowed,
                                 ExceptionInitializer *errors) const;
         /*! \brief
-         * Resolved an unresolved reference to an index group.
+         * Resolves an unresolved reference to an index group.
          *
-         * \param[in] grps  Index groups to use to resolve the reference.
+         * \param[in] grps   Index groups to use to resolve the reference.
+         * \param[in] natoms Maximum number of atoms the selections can evaluate to
+         *     (zero if the topology/atom count is not set yet).
          * \throws    std::bad_alloc if out of memory.
          * \throws    InconsistentInputError if the reference cannot be
          *     resolved.
          */
-        void resolveIndexGroupReference(gmx_ana_indexgrps_t *grps);
+        void resolveIndexGroupReference(gmx_ana_indexgrps_t *grps, int natoms);
+        /*! \brief
+         * Checks that an index group has valid atom indices.
+         *
+         * \param[in] natoms Maximum number of atoms the selections can evaluate to.
+         * \throws    std::bad_alloc if out of memory.
+         * \throws    InconsistentInputError if there are invalid atom indices.
+         */
+        void checkIndexGroup(int natoms);
 
         //! Type of the element.
         e_selelem_t                         type;