20 #include "SheafSystem/interval_index_space_record.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/error_message.h" 24 #include "SheafSystem/member_record_set.h" 25 #include "SheafSystem/interval_index_space_iterator.h" 110 require(
scaffold().structure().state_is_read_accessible());
114 #ifdef DIAGNOSTIC_OUTPUT 115 cout <<
"interval_index_space_record::externalize:" << endl;
120 transfer_id_space_to_internal_buffer();
125 convert_internal_buffer_to_external_buffer(xid_space);
129 transfer_external_buffer_to_HDF(xhdf_buffer);
140 sheaf::interval_index_space_record::
141 transfer_id_space_to_internal_buffer()
145 require(
scaffold().structure().state_is_read_accessible());
165 sheaf::interval_index_space_record::
174 initialize_external_buffer(xid_space);
178 size_t lnext_field_offset = 0;
180 externalize_id_space_data(lnext_field_offset, xid_space);
197 sheaf::interval_index_space_record::
221 void* lbuf = lend_offset > 0 ?
new pod_index_type[lend_offset] : 0;
244 sheaf::interval_index_space_record::
254 define_old_variable(
size_t old_xnext_field_offset = xnext_field_offset);
256 #ifdef DIAGNOSTIC_OUTPUT 258 <<
" file_id_space: " << endl;
260 cout << xid_space << endl;
273 #ifdef DIAGNOSTIC_OUTPUT 275 cout << setw(12) << lbuf[0]
276 << setw(12) << lbuf[1]
277 << setw(12) << lbuf[2]
278 << setw(12) << lbuf[3]
287 ensure(xnext_field_offset ==
buf_ub());
296 sheaf::interval_index_space_record::
297 transfer_external_buffer_to_HDF(hvl_t* xbuf)
311 ensure(xbuf->p ==
buf());
312 ensure(xbuf->len ==
buf_ub());
331 require(
scaffold().structure().state_is_read_write_accessible());
335 #ifdef DIAGNOSTIC_OUTPUT 336 cout <<
"interval_index_space_record::internalize:" << endl;
341 transfer_HDF_to_external_buffer(xhdf_buffer);
346 convert_external_buffer_to_internal_buffer(xid_space);
350 transfer_internal_buffer_to_id_space();
361 sheaf::interval_index_space_record::
362 transfer_HDF_to_external_buffer(hvl_t* xbuf)
377 ensure(
buf() == xbuf->p);
378 ensure(
buf_ub() == xbuf->len);
389 sheaf::interval_index_space_record::
396 size_t lnext_field_offset = 0;
400 internalize_id_space_data(lnext_field_offset, xid_space);
417 sheaf::interval_index_space_record::
427 define_old_variable(
size_t old_xnext_field_offset = xnext_field_offset);
430 while(xnext_field_offset <
buf_ub())
433 #ifdef DIAGNOSTIC_OUTPUT 434 cout << setw(12) << lbuf[0]
435 << setw(12) << lbuf[1]
436 << setw(12) << lbuf[2]
437 << setw(12) << lbuf[3]
442 xnext_field_offset += 4;
447 #ifdef DIAGNOSTIC_OUTPUT 449 <<
" file_id_space: " << endl;
451 cout << xid_space << endl;
456 ensure(xnext_field_offset ==
buf_ub());
465 sheaf::interval_index_space_record::
466 transfer_internal_buffer_to_id_space()
470 require(
scaffold().structure().state_is_read_write_accessible());
An implementation of class scattered_insertion_index_space_handle that has a interval id space state...
virtual bool invariant() const
Class invariant.
poset_scaffold & scaffold()
The scaffold for the poset associated with this record (mutable version).
void * buf() const
The buffer.
void next_interval()
Advances the iteration to the beginning of the next interval.
void internalize(hvl_t *xhdf_buffer, interval_index_space_handle &xid_space)
Converts the record from external to internal form.
The general variable length record wrapper/adapter for transferring data between the kernel and the i...
void put_delete_buffer(bool xval)
Sets delete_buffer to value xval.
void put_buf(const void *xbuf, size_t xub)
Sets the buffer to xbuf.
virtual index_space_iterator & get_iterator() const
Allocates an id space iterator from the iterator pool.
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all objects.
A record_set containing records of type member_record.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
pod_type interval_begin() const
The begin of the current interval.
bool is_done() const
True if iteration is finished.
void insert_interval(pod_type xbegin, pod_type xend, const scoped_index &xhub_begin, const scoped_index &xhub_end)
Make the closed interval [xbegin, xend] equivalent to [xbegin.hub_pod(), xhub_end.hub_pod()]. synonym for insert_interval(xbegin, xend, xhub_begin.hub_pod(), xhub_end.hub_pod()).
A record buffer for transferring file id id space data for the member record data set between the ker...
size_t buf_ub() const
The size of the buffer, in bytes.
pod_type interval_end() const
The end of the current interval.
bool is_internal() const
True if the internal buffer has been initialized.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
An iterator over an id space in which the equivalence between the ids in the space and the hub id spa...
void put_is_internal(bool xis_internal)
Sets is_internal to xis_internal.
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...
poset_state_handle & structure()
The handle for the poset being transferred. (Name chosen to void name conflict with class poset...
void externalize(hvl_t *xhdf_buffer, const interval_index_space_handle &xid_space)
Converts the record from internal to external form.
pod_type hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space; synonym for unglued_hub...
bool invariant_check() const
True if invariant checking is enabled.
interval_index_space_record(member_record_set &xhost)
Creates an instance in record set xhost for reading or writing member data.
int_type pod_index_type
The plain old data index type.
bool is_external() const
True if the external buffer has been initialized.
virtual void release_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual ~interval_index_space_record()
Destructor.
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
virtual interval_index_space_record * clone() const
Virtual constructor; makes a new instance of the same type as this.
void put_is_external(bool xis_external)
Sets is_external to xis_external.
void print_map_rep(std::ostream &xos) const
Inserts the map representation into ostream xos.