aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetIOF5/src/file.hh
blob: 19add249e468fa6e2ffbbabb4bc5f666782ffbb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef FILE_HH
#define FILE_HH

#include <string>
#include <vector>

#include <hdf5.h>

#include "cctk.h"

#include "extending.hh"



namespace CarpetIOF5 {
  
  using std::string;
  using std::vector;
  
  
  
  namespace F5 {
    
    class file_t {
      
      cGH const * const m_cctkGH;
      
      bool m_have_metafile;
      int m_output_processor;
      
      string const m_basename;
      string const m_extension;
      
      string m_metafilename;
      string m_filename;
      
      vector <string> mutable m_filenames;
      
      hid_t m_hdf5_metafile;
      hid_t m_hdf5_file;
      
      file_t ();
      file_t (file_t const &);
      file_t operator= (file_t const &);
      
      bool
      determine_want_metafile (int proc)
        const;
      
      int
      determine_output_processor (int proc)
        const;
      
      string
      make_metafilename ()
        const;
      
      string
      make_filename (int proc)
        const;
      
    public:
      
      file_t (cGH const * cctkGH,
              string filename,
              string extension,
              bool do_truncate);
      
      virtual
      ~ file_t ();
      
      cGH const *
      get_cctkGH ()
        const;
      
      bool
      get_have_metafile ()
        const;
      
      int
      get_output_processor ()
        const;
      
      string
      get_filename (int proc)
        const;
      
      hid_t
      get_hdf5_metafile ()
        const;
      
      hid_t
      get_hdf5_file ()
        const;
      
      void
      get_link_destination (string & filename,
                            string & objectname)
        const;
      
      virtual bool
      invariant ()
        const;
    };
    
  } // namespace F5

} // namespace CarpetIOF5

#endif  // #ifndef FILE_HH