Fix GPU X buffer ops with empty domain
[gromacs.git] / src / gromacs / coordinateio / ioutputadapter.h
blobf57e6f27d1a0c1dc24c0bd8870f8a5e837831469
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2019, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
35 /*! \file
36 * \brief
37 * Declares gmx::IOutputAdapter interface for modifying coordinate
38 * file structures before writing them to disk.
40 * \author Paul Bauer <paul.bauer.q@gmail.com>
41 * \inlibraryapi
42 * \ingroup module_coordinateio
44 #ifndef GMX_COORDINATEIO_IOUTPUTADAPTER_H
45 #define GMX_COORDINATEIO_IOUTPUTADAPTER_H
47 #include <memory>
49 #include "gromacs/utility/classhelpers.h"
51 #include "enums.h"
53 struct t_trxframe;
55 namespace gmx
58 /*!\brief
59 * OutputAdapter class for handling trajectory file flag setting and processing.
61 * This interface provides the base point upon which modules that modify trajectory frame
62 * datastructures should be build. The interface itself does not provide any direct means
63 * to modify the data, but only gives the virtual method to perform work on a
64 * t_trxframe object. Classes that modify trajectory frames should implement this interface.
66 * \inlibraryapi
67 * \ingroup module_coordinateio
70 class IOutputAdapter
72 public:
73 /*! \brief
74 * Default constructor for IOutputAdapter interface.
76 IOutputAdapter()
79 virtual ~IOutputAdapter()
82 //! Move constructor for old object.
83 explicit IOutputAdapter(IOutputAdapter &&old) noexcept = default;
85 /*! \brief
86 * Change t_trxframe according to user input.
88 * \param[in] framenumber Frame number as reported from the
89 * trajectoryanalysis framework or set by user.
90 * \param[in,out] input Pointer to trajectory analysis frame that will
91 * be worked on.
93 virtual void processFrame(int framenumber, t_trxframe *input) = 0;
95 /*! \brief
96 * Checks that the abilities of the output writer are sufficient for this adapter.
98 * It can happen that a method to write coordinate files does not match with
99 * a requested operation on the input data (e.g. the user requires velocities or
100 * forces to be written to a PDB file).
101 * To check those dependencies, derived classes need to implement a version of this
102 * function to make sure that only matching methods can be used.
104 * \param[in] abilities The abilities of an output method that need to be checked against
105 * the dependencies created by using the derived method.
106 * \throws InconsistentInputError If dependencies can not be matched to abilities.
108 virtual void checkAbilityDependencies(unsigned long abilities) const = 0;
110 GMX_DISALLOW_COPY_AND_ASSIGN(IOutputAdapter);
114 //! Smart pointer to manage the frame adapter object.
115 using OutputAdapterPointer = std::unique_ptr<IOutputAdapter>;
117 } // namespace gmx
119 #endif