]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move enum Mode
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Thu, 4 Oct 2018 15:59:41 +0000 (17:59 +0200)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:08:41 +0000 (19:08 +0100)
include/deal.II/base/hdf5.h

index 06d7a5216b95334287de3dc59cb2f0f8345f882f..8301af3b7b019eeca5160da8c6171e9eab1335a6 100644 (file)
@@ -268,12 +268,6 @@ namespace HDF5
     HDF5Object(const std::string name, const bool mpi);
 
   public:
-    enum class Mode
-    {
-      create,
-      open
-    };
-
     /**
      * Reads an attribute. `T` can be `float`, `double`, `std::complex<float>`,
      * `std::complex<double>`, `int`, `unsigned int`, `bool` or `std::string`.
@@ -704,10 +698,27 @@ namespace HDF5
   class Group : public HDF5Object
   {
   protected:
+    /**
+     * Group access mode
+     */
+    enum class Mode
+    {
+      /**
+       * Creates a new group
+       */
+      create,
+      /**
+       * Opens an existing group
+       */
+      open
+    };
+
     Group(const std::string name,
           const Group &     parent_group,
           const bool        mpi,
           const Mode        mode);
+
+    // This constructor is used by File
     Group(const std::string name, const bool mpi);
 
   public:
@@ -766,6 +777,22 @@ namespace HDF5
    */
   class File : public Group
   {
+  public:
+    /**
+     * File access mode
+     */
+    enum class Mode
+    {
+      /**
+       * Create file, truncate if exists
+       */
+      create,
+      /**
+       * Read/write, file must exist
+       */
+      open
+    };
+
   private:
     File(const std::string name,
          const bool        mpi,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.