/*
* 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
#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
{
* 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
*
* \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
*
* \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.
*
*/
AnalysisDataHandle();
+ //! Returns whether this data handle is valid.
+ bool isValid() const { return impl_ != NULL; }
+
/*! \brief
* Start data for a new frame.
*
/*! \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().