20 #include "SheafSystem/dof_tuple_record_set.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/data_converter.h" 24 #include "SheafSystem/error_message.h" 25 #include "SheafSystem/poset_bounds.h" 26 #include "SheafSystem/poset_dof_iterator.h" 27 #include "SheafSystem/poset_scaffold.h" 28 #include "SheafSystem/preorder_member_iterator.h" 29 #include "SheafSystem/primitive_value.h" 30 #include "SheafSystem/sheaf_file.h" 31 #include "SheafSystem/std_iostream.h" 32 #include "SheafSystem/std_sstream.h" 33 #include "SheafSystem/std_string.h" 45 const int DATASPACE_RANK = 1;
59 _record_is_full(xother._record_is_full)
127 delete []
static_cast<char*
>(
_hdf_buf);
211 int xrecord_buffer_ub,
213 :
record_set(xfile, xrecord_buffer_ub, xscaffold),
220 require(xrecord_buffer_ub > 0);
256 hsize_t linit_dims[DATASPACE_RANK];
262 post_fatal_error_message(
"can't create interior data space");
287 static const string result(
".dof_tuples");
325 post_fatal_error_message(
"Unable to get record size.");
352 require(
scaffold().structure().state_is_read_write_accessible());
356 #ifdef DIAGNOSTIC_OUTPUT 357 cout <<
"internalizing record set " <<
name() << endl;
398 require(
scaffold().structure().state_is_read_write_accessible());
402 require(unexecutable(
"all tuple schema are comparable to column bounds decomposition"));
446 int lext_dof_tuple_schema_ver =
454 lext_dof_tuple_schema_int_id,
455 lext_dof_tuple_schema_ver);
522 delete lext_col_bounds;
532 delete &lext_dof_map;
554 require(
scaffold().structure().state_is_read_accessible());
558 #ifdef DIAGNOSTIC_OUTPUT 559 cout <<
"externalizing record set " <<
name() << endl;
608 assertion(
scaffold().dof_tuple_schema_versions().find(lext_pod) ==
609 scaffold().dof_tuple_schema_versions().end());
613 pair<pod_index_type, int> lmap_pair(lext_pod, ldof_map.
schema().
version());
645 if(lint_tuple_schema.
ge(lcol_bnd.
ub_id()))
647 lactual_tuple_schema_int_id = lcol_bnd.
ub_id();
651 lactual_tuple_schema_int_id = lint_tuple_schema.
index();
658 lactual_tuple_schema_int_id = lint_tuple_schema.
index();
672 assertion(
scaffold().dof_tuple_schema_ids().find(lext_pod) ==
673 scaffold().dof_tuple_schema_ids().end());
677 pair<pod_index_type, pod_index_type>
678 lid_pair(lext_pod, lactual_tuple_schema_ext_pod);
741 require(
scaffold().structure().state_is_read_accessible());
763 if(
scaffold().dof_tuple_schema_versions().find(xtuple_id.
pod()) ==
768 pair<pod_index_type, int> lmap_pair(xtuple_id.
pod(),
775 if(
scaffold().dof_tuple_schema_ids().find(xtuple_id.
pod()) ==
787 pair<pod_index_type, pod_index_type>
788 lid_pair(xtuple_id.
pod(), lschema_ext_pod);
909 require(
scaffold().structure().state_is_read_accessible());
910 require(
scaffold().structure().contains_row_dof_tuple(xtuple_id));
962 poset_scaffold::dof_tuple_domain_offsets_type::key_type
963 lkey(result, litem_ext_id);
964 poset_scaffold::dof_tuple_domain_offsets_type::value_type lval(lkey, lnext_ext_id);
968 #ifdef DIAGNOSTIC_OUTPUT 969 cout <<
"dof_tuple_record_set::compute_next_ext_id: offsets:" << endl;
970 cout <<
"xtuple_id= " << xtuple_id
971 <<
" lcol_itr->item= " << lcol_itr->
item()
972 <<
" litem_ext_id= " << litem_ext_id
973 <<
" lnext_ext_id= " << lnext_ext_id
981 if(!
scaffold().col_bounds().ub_is_singleton())
1041 require(
file().mode() == sheaf_file::READ_WRITE);
1065 hsize_t linit_dims[DATASPACE_RANK];
1070 hsize_t lmax_dims[DATASPACE_RANK];
1071 lmax_dims[0] = H5S_UNLIMITED;
1076 post_fatal_error_message(
"can't create data space");
1083 hsize_t lchunk_dims[DATASPACE_RANK];
1088 hid_t lparms = H5Pcreate(H5P_DATASET_CREATE);
1089 herr_t status = H5Pset_chunk( lparms, DATASPACE_RANK, lchunk_dims);
1092 post_fatal_error_message(
"can't set chunk size");
1106 post_fatal_error_message(
"unable to create dataset.");
1111 ensure(result >= 0);
1131 #ifdef DIAGNOSTIC_OUTPUT 1132 cout <<
"selection:" << endl;
1133 cout << setw(6) <<
"i" << setw(6) <<
"int" << setw(6) <<
"ext" << endl;
1136 cout << setw(6) << i
1156 post_fatal_error_message(
"can't set dof tuple record write selection fro internal dataspace");
1169 post_fatal_error_message(
"can't set dof tuple record read selection");
1178 post_fatal_error_message(
"can't read dof tuple record selection");
1181 #ifdef DIAGNOSTIC_OUTPUT 1182 cout <<
"in dof_tuple_record_set::read_selection: buffer is:";
1183 cout << setbase(16);
1184 cout << setfill(
'0');
1191 cout << setw(2) << int(reinterpret_cast<unsigned char*>(
_hdf_buf)[i]) <<
" ";
1193 cout << endl << endl;
1194 cout << setbase(10) << setfill(
' ');
1217 #ifdef DIAGNOSTIC_OUTPUT 1233 herr_t status = H5Sselect_elements(
_int_dataspace_hdf_id, H5S_SELECT_SET, _hdf_selection_ct, lselect);
1236 post_fatal_error_message(
"can't set dof tuple record write selection for internal dataspace");
1243 #ifdef DIAGNOSTIC_OUTPUT 1244 cout <<
"dataspace extent:";
1258 hsize_t ldims[DATASPACE_RANK];
1265 #ifdef DIAGNOSTIC_OUTPUT 1266 cout <<
"ext_selection:" << endl;
1284 post_fatal_error_message(
"can't set dof tuple record write selection");
1287 #ifdef DIAGNOSTIC_OUTPUT 1288 cout <<
"in dof_tuple_record_set::write_selection: buffer is:";
1289 cout << setbase(16);
1290 cout << setfill(
'0');
1297 cout << setw(2) << int(reinterpret_cast<unsigned char*>(
_hdf_buf)[i]) <<
" ";
1299 cout << endl << endl;
1300 cout << setbase(10) << setfill(
' ');
1309 post_fatal_error_message(
"can't write dof tuple record selection");
1370 size_t& xbuf_remainder)
1380 int ldof_tuple_type;
1381 int lrecord_dof_index = 0;
1399 bool lid_needs_conversion = lis_nrmi_type || lis_nrsi_type;
1404 for(
int i=0; i<ldof_ct; ++i)
1406 if(xbuf_remainder == 0)
1409 lrecord_dof_index = 0;
1416 xint_dof_map.
get_dof(i, xbuf, xbuf_remainder);
1418 if(lid_needs_conversion)
1439 ++lrecord_dof_index;
1440 size_t loffset = ldof_descriptors[lrecord_dof_index].offset;
1441 xbuf = lbuf + loffset;
1456 if(xbuf_remainder == 0)
1459 lrecord_dof_index = 0;
1464 #ifdef DIAGNOSTIC_OUTPUT 1465 cout <<
"dof: " << lxfr_itr->
item().
name();
1466 cout <<
" xbuf: " <<
static_cast<void*
>(xbuf)
1467 <<
" xbuf_remainder: " << xbuf_remainder
1473 xint_dof_map.
get_dof(lxfr_itr->
index(), xbuf, xbuf_remainder);
1490 ++lrecord_dof_index;
1491 size_t loffset = ldof_descriptors[lrecord_dof_index].offset;
1492 xbuf = lbuf + loffset;
1516 size_t xbuf_remainder)
1525 int ldof_tuple_type;
1526 int lrecord_dof_index = 0;
1538 #ifdef DIAGNOSTIC_OUTPUT 1539 post_information_message(
"iterating over sequence id");
1549 if(xbuf_remainder == 0)
1552 lrecord_dof_index = 0;
1570 xext_dof_map.
put_dof(i, xbuf, xbuf_remainder);
1572 #ifdef DIAGNOSTIC_OUTPUT 1579 ++lrecord_dof_index;
1580 size_t loffset = ldof_descriptors[lrecord_dof_index].offset;
1581 xbuf = lbuf + loffset;
1585 #ifdef DIAGNOSTIC_OUTPUT 1595 #ifdef DIAGNOSTIC_OUTPUT 1596 post_information_message(
"iterating over schema");
1604 if(xbuf_remainder == 0)
1607 lrecord_dof_index = 0;
1626 xext_dof_map.
put_dof(xfr_itr->
index(), xbuf, xbuf_remainder);
1628 #ifdef DIAGNOSTIC_OUTPUT 1635 ++lrecord_dof_index;
1636 size_t loffset = ldof_descriptors[lrecord_dof_index].offset;
1637 xbuf = lbuf + loffset;
1643 #ifdef DIAGNOSTIC_OUTPUT 1688 while(!lint_dof_itr->
is_done())
1693 xext_dof_map.
get_dof(ldof_id, &pbuf,
sizeof(pbuf));
1694 xint_dof_map.
put_dof(ldof_id, &pbuf,
sizeof(pbuf));
1696 lint_dof_itr->
next();
1698 delete lint_dof_itr;
1730 int lcur_int_rec_id = (xbuf - 1 -
_hdf_buf)/_record_size;
1739 int lnext_ext_rec_id = lcur_ext_rec_id + 1;
1754 require( ((result -
_hdf_buf) % _record_size) == 0 );
1877 result = lint_rec_pod;
1881 ensure(result >= 0);
1906 require(
scaffold().structure().state_is_read_accessible());
1931 poset_scaffold::dof_tuple_domain_offsets_type::key_type
1932 lkey(xtuple_id.
pod(), lxfr_schema_ext_pod);
1933 poset_scaffold::dof_tuple_domain_offsets_type::iterator loffsets_itr =
1936 assertion(loffsets_itr !=
scaffold().dof_tuple_domain_offsets().end());
1943 size_t lbuf_remainder =
1946 assertion(lbuf_remainder == _record_size);
1954 for(
size_t i=0; i<lbuf_remainder; i++)
1974 require(
scaffold().transfer_schema().is_attached());
1983 if(xdof_map_schema.
le(xdomain_schema_id))
2055 size_t lrecord_dof_ct = ldt_schema.
row_dof_ct();
2057 if(lrecord_dof_ct == 1)
2065 post_fatal_error_message(
"Can't create internal data type");
2072 hsize_t larray_dims = lrecord_dof_ct;
2075 H5Tarray_create1(
type_map()[ldof_tuple_type]->internal_type(),
2081 post_fatal_error_message(
"Can't create internal data type");
2109 post_fatal_error_message(
"Can't create internal data type");
2118 string ldof_name = ldof_itr->
item().
name();
2119 size_t loffset = ldesc.offset;
2122 #ifdef DIAGNOSTIC_OUTPUT 2123 cout <<
"create_int_data_type: " 2124 <<
" dof_name: " << ldof_name
2125 <<
" offset: " << loffset
2133 post_fatal_error_message(
"Unable to insert member in HDF5 compound data type.");
An implementation of class scattered_insertion_index_space_handle that has a interval id space state...
void populate_internal_dof_map(const poset_dof_map &xext_dof_map, poset_dof_map &xint_dof_map)
Gathers dofs from xext_dof_map and puts them into xint_dof_map.
An encapsulation of an HDF file containing sheaf data.
primitive_type row_dof_tuple_type() const
The type of row dofs defined by this. Synonym for dof_tuple_type(false).
virtual void put_version(int xversion, bool xunalias=false)
Sets version to (possibly aliased) xversion. If unalias == true, set version to the actual version al...
pod_index_type ub_id() const
The index of the upper bound member, if the upper bound contains a single member. ...
int _ext_dataspace_rank
The rank of the dataspace for the record_set.
poset_state_handle * host() const
The poset which this is a handle to a component of.
internal_index_type internal_id(external_index_type xexternal_id) const
The internal id corresponding to xexternal_id.
virtual void open()
Opens the record_set.
hsize_t * _ext_dataspace_dims
The current dimensions of the external dataspace.
void reset_record_buffer_ct()
The set the number of active records in record buffer to 0.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
virtual hid_t create_dataset()
Creates the HDF dataset associated with this.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
virtual void next()
Makes this the next member of the subset.
void initialize_dof_id_space(subposet &xdof_subposet)
Initialize the id space for the dof subposet, xdof_subposet.
pod_index_type get_internal_record(pod_index_type xext_rec_pod)
Brings external record identified by xext_rec_pod into memory, if necessary, and returns its internal...
pod_index_type dof_tuple_schema_int_id(pod_index_type xdof_tuple_ext_id) const
The internal schema id for the dof tuple with external id xdof_tuple_ext_id.
virtual bool supports_xfr_opt() const
True if this dof map type supports dof tuple transfer optimization. /.
std::string data_set_alias(const std::string &xname) const
The data set alias for a poset with name xname.
void translate_dof_tuple_col_bounds()
Translate the dof tuple column bounds from external ids to internal ids.
pod_index_type dof_tuple_scratch_id() const
The scratch id for the dof tuple id space.
void convert_record_id_to_subposet_id(void *xbuf)
Converts namespace relative record id at location xbuf to namespace relative subposet id at location ...
size_type _record_size
The size in bytes of a record.
external_index_type external_id(internal_index_type xinternal_id) const
The external id corresponding to xinternal_id.
virtual bool has_id_space() const
True if this already has an id space.
poset_dof_iterator * row_dof_iterator(int xversion=CURRENT_MEMBER_VERSION) const
A postorder iterator over the row dofs defined by this.
void internalize()
Internalize the members of scafold().structure() from disk.
char * _hdf_buf
The HDF buffer.
schema_poset_member & item()
The current member of the iteration (mutable version).
char * get_next_record(char *xbuf)
The next record to use in the record buffer.
virtual schema_poset_member & schema()
The schema on which this is allocated (mutable version).
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
int version() const
The version of the host of the schema this is defined on.
scoped_index dof_tuple_ext_id(const scoped_index &xid) const
An id in the dof tuple external id space with pod mapped from xid.
bool is_empty() const
True if the record queue is empty.
A client handle for a general, abstract partially order set.
int record_buffer_ct() const
The number of active records in record buffer.
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
void extend_dataset(const hsize_t *xdims, int xdims_ub)
Extends the dataset dimensions to at least the dimensions given xdims, an array of length xdims_ub...
virtual void get_dof(pod_index_type xdof_id, void *xdof, size_type xdof_size) const
Copies the dof referred to by xdof_id into xdof.
const scoped_index & index() const
The current item in the subset.
virtual void * dof_tuple()=0
The dof tuple (mutable version).
int item()
OBSOLETE: use index(). The current item in the subset.
dof_descriptor_array * dof_descriptors(bool xis_table_dof) const
The dof_descriptors_array for the table dof tuple (xis_table_dof true) or row dof tuple defined by th...
void write_selection()
Write the records specified by the selection into the file.
bool is_same_state(const poset_state_handle *xhost, pod_index_type xhub_id) const
True is this is attached to state with hub id xhub_id in host xhost.
void put(int i, bool value)
Sets i-th member to value.
int _record_buffer_ub
The maximum number of records the buffer can hold.
bool is_open() const
True if this record_set is open.
virtual pod_index_type get_ext_id(const std::string &xid_space_name) const
Gets an external id corresponding to index() in the id space with name xid_space_name.
std::string row_dof_subposet_name() const
The standard name for the row dof subposet associated with this schema member. Synonym for dof_subpos...
virtual bool is_done() const
True if iteration finished.
A (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation...
pod_index_type _next_record_pod
The index of the next buffer record to allocate for a read or write operation.
bool is_namespace_relative_member_index_type() const
True if this is a converter for a naemspace_relative_member_index type.
const scoped_index & index() const
The index of the component state this handle is attached to.
The general, abstract map from dof ids to dof values.
record_queue & queue()
The queue of dof tuple record requests.
record_map< pod_index_type, pod_index_type > _hdf_buf_record_map
The record id map for the hdf buffer.
virtual primitive_type type() const
The primitive type index of the dof defined by this.
bool contains_internal_id(internal_index_type xint_id) const
True if this map contains an entry for internal index xint_id.
virtual schema_poset_member & ext_data_type_schema()
The schema for the external data type associated with this schema.
int dof_tuple_schema_version(pod_index_type xext_id) const
The external schema version for the dof tuple with external id xdof_tuple_ext_id. ...
void internalize_all_dofs(schema_poset_member &xxfr_schema, poset_dof_map &xext_dof_map, char *xbuf, size_t xbuf_remainder)
Internalizes all the dofs in the domain described by xxfr_schema.
hid_t int_data_type_hdf_id()
The HDF internal data type id for this record set.
std::string alias() const
The standard alias for this data set.
virtual void create_int_data_type()
Creates a new HDF internal data type.
void next()
Makes item the next member of the subset.
bool same_scope(const scoped_index &xother) const
True if and only if this is in the same id space as xother.
void attach_to_state(const poset_state_handle *xhost, pod_index_type xhub_id)
Attach this handle to the state with hub id xhub_id in the current version of host xhost...
hid_t _hdf_id
The HDF id for this record set.
hsize_t(* _hdf_int_selection)[1]
The HDF internal record selection buffer.
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all objects.
std::string _alias
The standard alias for this record_set.
virtual dof_tuple_record_set * clone() const
Virtual constructor; makes a new instance of the same type as this.
std::string to_string() const
Converts this to a string (for stream insertion).
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
dof_tuple_index_space_type & dof_tuple_id_space()
External to internal dof_tuple index space for table() (mutable version).
pod_index_type dequeue()
Removes and returns the index at the front of the record queue.
hid_t _int_data_type_hdf_id
The HDF internal data type id for this record set.
void attach_transfer_schema(schema_poset_member &xdof_map_schema, const scoped_index &xdomain_schema_id)
Attaches the transfer schema to the lesser of the dof map schema or the domain schema.
subposet & row_dof_subposet()
The row dof subposet when this poset is used as a schema (mutable version).
virtual pod_index_type get_ext_id(pod_index_type xint_id, const std::string &xid_space_name, bool xauto_access) const
Translates xint_id to an external id using the equivalence map with name xid_space_name.
record_queue _record_queue
The record queue.
void read_selection()
Read the records specified by the selection into the record buffer.
bool is_open() const
True if this file is open.
Type of buffer large enough to hold any primitive type.
size_t dof_tuple_ub() const
The size of the dof tuple in bytes.
pod_index_type advance_to_start_of_record(pod_index_type xext_pod)
Advances the offset xoffset to the smallest offset which is less than or equal to xoffset and which i...
std::string _name
The name of this record_set.
hid_t hdf_id()
The HDF id for this record set.
An index within the external ("client") scope of a given id space.
int record_buffer_ub() const
The maximum number of records the buffer can hold.
int ext_dataspace_rank()
The rank of the dataspace for the record_set.
void convert_record_id_to_member_id(void *buf)
Converts namespace relative record id at location xbuf to namespace relative member id at location xb...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
size_type compute_ext_domain_size(const poset_dof_map &xdof_map, const schema_poset_member &xschema) const
Computes the external size for the portion of the dof tuple xdof_map which is described by schema xsc...
An abstract, indexed collection of records on secondary storage.
std::string data_set_name(const std::string &xname) const
The data set name for a poset with name xname.
dof_tuple_domain_offsets_type & dof_tuple_domain_offsets()
Dof tuple domain offsets accessor (mutable version).
size_type record_size() const
The size in bytes of data transfers to disk.
virtual void init_row_dof_map(const poset_state_handle *xhost, pod_index_type xschema_mbr_id, int xschema_version)
Initializes this as a map for row dofs in host xhost, with schema member specified by xschema_mbr_id ...
schema_poset_member & external_schema()
The schema of the poset in external namespace (mutable version).
void put_dof_tuple_scratch_id(pod_index_type xid)
Set the scratch id for the dof tuple id space.
std::string name(pod_index_type xdof_id, bool xis_table_dof) const
The name of the table dof (xis_table_dof true) or row dof referred to by xdof_id in the schema define...
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
void insert(pod_type xid, const scoped_index &xhub_id)
Make id xid in this id space equivalent to xhub_id in the hub id space. synonym for insert(xid...
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
poset_bounds & col_bounds()
The bounds for the columns in this transaction (mutable version).
int _hdf_selection_ct
The number of records selected.
void externalize_domain(const scoped_index &xtuple_ext_id, const scoped_index &xschema_id)
Externalize the domain specified by the schema member with index xschema_id.
bool ub_is_singleton() const
True if the upper bound contains a single member.
size_t _hdf_buf_ub
The HDF buffer upper bound.
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
static int row_dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xauto_access=true)
The number of row dofs defined by the schema specified by xns and xpath. Synonym for dof_ct(xns...
poset_scaffold & scaffold()
Scaffold for constructing poset associated with this record set (mutable version).
hsize_t(* _hdf_ext_selection)[1]
The HDF external record selection buffer.
virtual std::string name() const
The name of this poset.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
dof_tuple_record_set(const dof_tuple_record_set &xother)
Copy constructor.
void externalize_one_domain(const scoped_index &xtuple_id, const scoped_index &xschema_id)
Externalize the domain specified by the schema member with index xschema_id. Does not initialize reco...
int _hdf_selection_ub
The HDF record selection buffers upper bound.
virtual size_t ext_data_type_ct(bool xis_table_schema) const
The number of instances of the external data type needed to represent this schema.
void externalize()
Externalize the members of scafold().structure() to disk.
void put_dof_tuple_col_bound(pod_index_type xdof_tuple_ext_id)
Insets the descriptor for the column bound for the dof tuple with external id xdof_tuple_ext_id into ...
index_iterator * bound_iterator(const poset_bounds &xbnd_id, bool xis_ub) const
An iterator for the upper bound (xis_ub == true) or the lower bound (xis_ub == false) for xbounds...
A record_set which contains dof tuple records. Supports both record selection and record restriction ...
poset_state_handle & structure()
The handle for the poset being transferred. (Name chosen to void name conflict with class poset...
virtual const scoped_index & index()
The index of the current member of the iteration.
bool is_namespace_relative_subposet_index_type() const
True if this is a converter for a namespace_relative_subposet_index type.
Iterates over the subset of Zn defined by the characteristic function host().
std::string name() const
The name of this data set.
primitive_buffer_type & value()
The value of this.
virtual poset_dof_map & row_dof_map(pod_index_type xtuple_hub_id, bool xrequire_write_access=false) const
The map from row dof client_ids to row dof values for dof tuple hub id xtuple_hub_id.
bool ge(pod_index_type xother_index) const
True if this is greater than or equal to the member with index xother_index.
void schematize()
Schematize the table and row dof subposets.
zn_to_bool _record_is_full
True if i-th record is full and should be written out.
dof_tuple_schema_versions_type & dof_tuple_schema_versions()
Dof tuple schema versions (mutable version).
Basic description of a dof.
size_t _hdf_scratch_buf_ub
The size of the scratch buffer in bytes.
void remove_reference()
Remove a reference from this.
void remove_internal_id(internal_index_type xinternal_id)
Removes xinternal_id and its external image from the map.
virtual poset_state_handle * host() const
The poset which owns this.
size_t row_dof_tuple_ub() const
The size in bytes of the row dof tuple defined by this schema. Synonym for dof_tuple_ub(false).
bool invariant_check() const
True if invariant checking is enabled.
dof_tuple_schema_ids_type & dof_tuple_schema_ids()
Dof tuple schema ids (mutable version).
Iterates in postorder over dofs of a schema member anchor. Attaches a handle of type schema_poset_mem...
pod_index_type compute_ext_id(const scoped_index &xtuple_id)
Computes the external id for the dof tuple dof tuple with id xtuple_id.
const sheaf_file & file() const
The file this record_set belongs to.
A queue for record read requests.
void put_dof(pod_index_type xdof_id, const primitive_value &xdof)
Sets the dof referred to by xdof_id to xdof.
bool _writing
True if current operation is a write operation.
subposet & table_dof_subposet()
The table dof subposet when this poset is used as a schema (mutable version).
int_type pod_index_type
The plain old data index type.
void add_reference()
Add a reference to this.
bool is_done() const
True if iteration finished.
Function object to convert between internal and external data formats.
poset_data_type_map & type_map()
Data type map for records in this record set (mutable version)
A poset specific collection of data converters, various buffers and other data used while transferrin...
schema_poset_member & transfer_schema()
The schema for the restriction that is being read or written (mutable version)
virtual void open()
Opens the record_set.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)=0
Copies the entire dof tuple from xbuf into internal storage.
hid_t internal_type() const
The HDF type identifier for the internal type.
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
void put_ids(internal_index_type xinternal_id, external_index_type xexternal_id)
Defines the mapping between xinternal_id and xexternal_id.
Abstract object wrapper for an instance of a primitive type.
static const primitive_value & prototype(pod_index_type xid)
The prototype for the primitive value of the type associated with xid.
virtual ~dof_tuple_record_set()
Destructor.
size_t max_size() const
The maximum size, internal or external, of any fixed length type.
void convert_subposet_id_to_record_id(void *xbuf)
Converts namespace relative subposet id at location xbuf to namespace relative record id at location ...
void read_records()
Read and internalizes all the records.
virtual bool invariant() const
Class invariant.
virtual const std::string & suffix() const
The name suffix for this data set.
virtual schema_poset_member & schema()
The schema for this member (mutable version).
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
bool is_same_type(const any *other) const
True if other is the same type as this.
hid_t _ext_dataspace_hdf_id
The HDF id for the external dataspace of this record set.
void enable_invariant_check() const
Enable invariant checking.
void externalize_all_dofs(schema_poset_member &xxfr_schema, const poset_dof_map &xint_dof_map, char *&xbuf, size_t &xbuf_remainder)
Externalizes all the dofs in the domain described by xxfr_schema.
std::string table_dof_subposet_name() const
The standard name for the table dof subposet associated with this schema member. Synonym for dof_subp...
virtual poset_dof_map * clone() const =0
Virtual default constructor.
char * get_first_record(pod_index_type xext_pod)
The first record associated with the dof tuple with external id xext_pod.
pod_index_type dof_tuple_domain_offset(pod_index_type xdof_tuple_ext_id, pod_index_type xdomain_key) const
The offset for domain xdomain_key in tuple xdof_tuple_ext_id.
A client handle for a poset member which has been prepared for use as a schema.
hid_t _int_dataspace_hdf_id
The hdf5 id of the dataspace associated with the record buffer.
char * _hdf_scratch_buf
Scratch buffer for internalizing dofs that span record boundaries.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
void convert_member_id_to_record_id(void *buf)
Converts namespace relative member id at location xbuf to namespace relative record id at location xb...