ALPSCore reference
archivecontext.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
7 #pragma once
8 
9 #include <string>
10 
11 #include <boost/noncopyable.hpp>
12 
13 #include <hdf5.h>
14 
15 namespace alps {
16  namespace hdf5 {
17  namespace detail {
18 
19  struct archivecontext : boost::noncopyable {
20 
21  archivecontext(std::string const & filename, bool write, bool replace, bool compress, bool memory);
22  ~archivecontext();
23 
24  void grant(bool write, bool replace);
25 
26  bool compress_;
27  bool write_;
28  bool replace_;
29  bool memory_;
30  std::string filename_;
31  std::string filename_new_;
32  hid_t file_id_;
33 
34  private:
35 
36  void construct();
37  void destruct(bool abort);
38  };
39  }
40  }
41 }