Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / analysisdata / analysisdata.h
index 451cee4a598b74e37def4d65d150258c7ce08e1e..b8849769ea847b06f19d5f4e32e9d0e95f185f2d 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, 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) 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
@@ -43,7 +43,8 @@
 #ifndef GMX_ANALYSISDATA_ANALYSISDATA_H
 #define GMX_ANALYSISDATA_ANALYSISDATA_H
 
-#include "abstractdata.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
@@ -99,13 +100,13 @@ class AnalysisData : public AbstractAnalysisData
          * Sets the number of data sets.
          *
          * \param[in] dataSetCount  Number of data sets (must be > 0).
+         * \throws    std::bad_alloc if out of memory.
+         * \throws    APIError if modules have been added that are not
+         *      compatible with the new data set count.
          *
          * Must not be called after startData() has been called.
          * If not called, a single data set is assumed.
          * If called multiple times, the last call takes effect.
-         *
-         * Does not currently throw, but this may change for the case that
-         * modules have already been added.
          */
         void setDataSetCount(int dataSetCount);
         /*! \brief
@@ -113,13 +114,12 @@ class AnalysisData : public AbstractAnalysisData
          *
          * \param[in] dataSet      Zero-based data set index.
          * \param[in] columnCount  Number of columns in the data (must be > 0).
+         * \throws    APIError if modules have been added that are not
+         *      compatible with the new column count.
          *
          * Must be called before startData() for each data set.
          * Must not be called after startData() has been called.
          * If called multiple times for a data set, the last call takes effect.
-         *
-         * Does not currently throw, but this may change for the case that
-         * modules have already been added.
          */
         void setColumnCount(int dataSet, int columnCount);
         /*! \brief
@@ -127,18 +127,19 @@ class AnalysisData : public AbstractAnalysisData
          *
          * \param[in] bMultipoint  Whether the data will allow multiple points
          *      per column within a single frame.
+         * \throws    APIError if modules have been added that are not
+         *      compatible with the new setting.
          *
          * If this method is not called, the data is not multipoint.
          *
          * Must not be called after startData() has been called.
          *
-         * Does not currently throw, but this may change for the case that
-         * modules have already been added.
-         *
          * \see isMultipoint()
          */
         void setMultipoint(bool bMultipoint);
 
+        virtual int frameCount() const;
+
         /*! \brief
          * Create a handle for adding data.
          *
@@ -242,6 +243,9 @@ class AnalysisDataHandle
          */
         AnalysisDataHandle();
 
+        //! Returns whether this data handle is valid.
+        bool isValid() const { return impl_ != NULL; }
+
         /*! \brief
          * Start data for a new frame.
          *
@@ -341,7 +345,7 @@ class AnalysisDataHandle
         /*! \brief
          * Creates a new data handle associated with \p data.
          *
-         * \param  data Data to associate the handle with.
+         * \param  impl Data to associate the handle with.
          *
          * The constructor is private because data handles should only be
          * constructed through AnalysisData::startData().