Convert gmx_mtop_t to C++
[alexxy/gromacs.git] / src / gromacs / selection / tests / toputils.h
index ac2faf4159b233ea70804c3df4014d9833ed0614..33707c53dd63574f78cfcb7ff19371027b7722b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
@@ -42,6 +42,7 @@
 #ifndef GMX_SELECTION_TESTS_TOPUTILS_H
 #define GMX_SELECTION_TESTS_TOPUTILS_H
 
+#include <memory>
 #include <vector>
 
 struct gmx_mtop_t;
@@ -75,14 +76,14 @@ class TopologyManager
 
         void initFrameIndices(const ArrayRef<const int> &index);
 
-        gmx_mtop_t *topology() { return mtop_; }
+        gmx_mtop_t *topology() { return mtop_.get(); }
         t_atoms &atoms();
         t_trxframe *frame() { return frame_; }
 
     private:
-        gmx_mtop_t             *mtop_;
-        t_trxframe             *frame_;
-        std::vector<char *>     atomtypes_;
+        std::unique_ptr<gmx_mtop_t>  mtop_;
+        t_trxframe                  *frame_;
+        std::vector<char *>          atomtypes_;
 };
 
 } // namespace test