SheafSystem  0.0.0.0
sheaf_file.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class sheaf_file
19 
20 #ifndef SHEAF_FILE_H
21 #define SHEAF_FILE_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef ANY_H
28 #include "SheafSystem/any.h"
29 #endif
30 
31 #ifndef STD_HDF5_H
32 #include "SheafSystem/std_hdf5.h"
33 #endif
34 
35 #ifndef STD_STRING_H
36 #include "SheafSystem/std_string.h"
37 #endif
38 
39 namespace sheaf
40 {
41 
42 class data_type_map;
43 class dof_tuple_record_set;
44 class member_record_set;
45 
49 class SHEAF_DLL_SPEC sheaf_file : public any
50 {
51 
52  friend class data_type_map;
53  friend class record_set;
54  friend class attributes_record_set;
55  friend class member_record_set;
56  friend class dof_tuple_record_set;
57 
58 public:
59 
60  // CANONICAL MEMBERS
61 
66  sheaf_file();
67 
72  sheaf_file(const sheaf_file& xother);
73 
79  virtual sheaf_file* clone() const;
80 
84  virtual ~sheaf_file();
85 
89  virtual bool invariant() const;
90 
94  virtual bool is_ancestor_of(const any* other) const;
95 
96  // SHEAF_FILE INTERFACE
97 
98 
99 
103  inline std::string name() const
104  {
105  return _name;
106  } ;
107 
111  enum access_mode {NONE, READ_ONLY, READ_WRITE};
112 
117  void open(const std::string &xname, access_mode xmode = READ_WRITE, bool xclobber = true);
118 
122  bool is_open() const;
123 
127  access_mode mode() const;
128 
132  void close();
133 
137  data_type_map& type_map();
138 
142  const data_type_map& type_map() const;
143 
147  bool type_map_defined() const;
148 
149 
150 private:
151 
155  std::string _name;
156 
160  hid_t _hdf_id;
161 
165  hid_t hdf_id() const;
166 
170  access_mode _mode;
171 
175  data_type_map* _type_map;
176 
177 };
178 
179 } // namespace sheaf
180 
181 #endif // ifndef SHEAF_FILE_H
182 
183 
184 
185 
186 
187 
188 
An encapsulation of an HDF file containing sheaf data.
Definition: sheaf_file.h:49
access_mode
File access modes.
Definition: sheaf_file.h:111
Abstract base class with useful features for all objects.
Definition: any.h:39
A record_set containing records of type member_record.
An abstract, indexed collection of records on secondary storage.
Definition: record_set.h:150
std::string name() const
The name of this file.
Definition: sheaf_file.h:103
A record_set which contains dof tuple records. Supports both record selection and record restriction ...
A record set for storing various poset attributes.
Namespace for the sheaves component of the sheaf system.
A collection of data converters that map data types between internal and external representations...
Definition: data_type_map.h:49