SheafSystem  0.0.0.0
member_record_set.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 member_record_set
19 
20 #ifndef MEMBER_RECORD_SET_H
21 #define MEMBER_RECORD_SET_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef RECORD_SET_H
28 #include "SheafSystem/record_set.h"
29 #endif
30 
31 #ifndef INTERVAL_INDEX_SPACE_RECORD_H
32 #include "SheafSystem/interval_index_space_record.h"
33 #endif
34 
35 #ifndef MEMBER_RECORD_H
36 #include "SheafSystem/member_record.h"
37 #endif
38 
39 #ifndef INTERVAL_INDEX_SPACE_HANDLE_H
40 #include "SheafSystem/interval_index_space_handle.h"
41 #endif
42 
43 
44 namespace sheaf
45 {
46 
47 class dof_tuple_record_set;
48 class index_equivalence_iterator;
49 
53 class SHEAF_DLL_SPEC member_record_set : public record_set
54 {
55 
56 public:
57 
58  // =============================================================================
59  // ANY FACET
60  // =============================================================================
61 
67  virtual member_record_set* clone() const;
68 
72  virtual bool invariant() const;
73 
77  virtual bool is_ancestor_of(const any* other) const;
78 
79  // =============================================================================
80  // MEMBER_RECORD_SET FACET
81  // =============================================================================
82 
89  member_record_set(const sheaf_file& xfile,
90  int xbuffer_ub,
91  const poset_scaffold& xscaffold,
92  const dof_tuple_record_set& xdof_tuple_records);
93 
98  member_record_set(const member_record_set& xother);
99 
103  virtual ~member_record_set();
104 
108  virtual const std::string& suffix() const;
109 
113  void internalize(pod_index_type xmax_row_int_id);
114 
118  void internalize(const scoped_index& xmax_row_int_id);
119 
123  void externalize(pod_index_type xmax_row_int_id);
124 
128  void externalize(const scoped_index& xmax_row_int_id);
129 
133  dof_tuple_record_set& dof_tuple_records();
134 
138  const member_record& record() const;
139 
144  static pod_index_type first_member_record();
145 
146 protected:
147 
148  // Default constructor;
149  // not supported because can not initialize reference data members.
150  // member_record_set();
151 
155  virtual hid_t create_dataset();
156 
160  virtual void create_int_data_type();
161 
165  void read_record(const record_index& xext_id);
166 
170  void read_selection();
171 
175  void write_selection();
176 
180  void make_internal_dataspace();
181 
182 private:
183 
187  hid_t _member_record_type;
188 
192  hvl_t* _hdf_bufs;
193 
197  void delete_external_buffers();
198 
202  void delete_hdf_buffers();
203 
210 
214  hsize_t (*_hdf_selection)[1];
215 
219  member_record _record;
220 
224  poset_scaffold& _scaffold;
225 
229  dof_tuple_record_set& _dof_tuple_records;
230 
234  void write_record_buffer();
235 
239  void clean_upper_covers();
240 
244  interval_index_space_record _id_space_record;
245 
249  interval_index_space_handle _record_id_space;
250 
254  static pod_index_type record_id_space_record();
255 
259  static pod_index_type interval_id_space_record();
260 
264  std::string _interval_id_space_name;
265 
269  interval_index_space_handle _interval_id_space;
270 
274  void write_id_space_record(const interval_index_space_handle& xid_space, pod_index_type xrecord_id);
275 
279  void read_id_space_record(interval_index_space_handle& xid_space, pod_index_type xrecord_id);
280 
284  void read_member(const scoped_index& xindex, record_index& xext_id);
285 
290  void make_idorder_file_id_spaces(const abstract_poset_member& xmbr);
291 
292 };
293 
294 } // namespace sheaf
295 
296 #endif // ifndef MEMBER_RECORD_SET_H
297 
298 
299 
300 
301 
302 
An implementation of class scattered_insertion_index_space_handle that has a interval id space state...
An encapsulation of an HDF file containing sheaf data.
Definition: sheaf_file.h:49
Abstract base class with useful features for all objects.
Definition: any.h:39
A record_set containing records of type member_record.
A record buffer for transferring member data between the kernel and the i/o subsystem.
Definition: member_record.h:54
A record buffer for transferring file id id space data for the member record data set between the ker...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
An abstract, indexed collection of records on secondary storage.
Definition: record_set.h:150
The general variable length record wrapper/adapter for transferring data between the kernel and the i...
Definition: record.h:48
A record_set which contains dof tuple records. Supports both record selection and record restriction ...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
A poset specific collection of data converters, various buffers and other data used while transferrin...
An abstract client handle for a member of a poset.