20 #include "SheafSystem/storage_agent.h" 21 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/array_poset_dof_map.h" 24 #include "SheafSystem/attributes_record_set.h" 25 #include "SheafSystem/dof_tuple_record_set.h" 26 #include "SheafSystem/error_message.h" 27 #include "SheafSystem/interval_index_space_state.h" 28 #include "SheafSystem/member_names_record.h" 29 #include "SheafSystem/member_record.h" 30 #include "SheafSystem/member_record_set.h" 31 #include "SheafSystem/namespace_poset.h" 32 #include "SheafSystem/namespace_poset_member.h" 33 #include "SheafSystem/poset.h" 34 #include "SheafSystem/poset_bounds.h" 35 #include "SheafSystem/poset_bounds_descriptor.h" 36 #include "SheafSystem/poset_data_type_map.h" 37 #include "SheafSystem/poset_general_record.h" 38 #include "SheafSystem/poset_handle_factory.h" 39 #include "SheafSystem/poset_state_handle.h" 40 #include "SheafSystem/postorder_itr.h" 41 #include "SheafSystem/preorder_itr.h" 42 #include "SheafSystem/schema_poset_member.h" 43 #include "SheafSystem/subposet_names_record.h" 44 #include "SheafSystem/total_poset_member.h" 46 #include "SheafSystem/index_equivalence_iterator.h" 59 const int DEFAULT_MEMBER_RECORD_BUFFER_UB = 1000;
64 const size_t DEFAULT_DOF_TUPLE_RECORD_SIZE = 1024;
70 const int DEFAULT_DOF_TUPLE_RECORD_BUFFER_UB = 4;
89 _member_record_buffer_ub = DEFAULT_MEMBER_RECORD_BUFFER_UB;
90 _dof_tuple_record_size = DEFAULT_DOF_TUPLE_RECORD_SIZE;
91 _dof_tuple_record_buffer_ub = DEFAULT_DOF_TUPLE_RECORD_BUFFER_UB;
100 ensure(transaction_ct() == 0);
101 ensure(member_record_buffer_ub() == DEFAULT_MEMBER_RECORD_BUFFER_UB);
102 ensure(dof_tuple_record_size() == DEFAULT_DOF_TUPLE_RECORD_SIZE);
103 ensure(dof_tuple_record_buffer_ub() == DEFAULT_DOF_TUPLE_RECORD_BUFFER_UB);
152 ensure(is_same_type(result));
199 result = result && any::invariant();
201 if(invariant_check())
205 disable_invariant_check();
209 enable_invariant_check();
233 bool result =
dynamic_cast<const storage_agent*
>(other) != 0;
252 bool xenable_error_report)
257 require(!xfile_name.empty());
258 require(xfile_name.substr(xfile_name.size() - 4) ==
".hdf");
262 _member_record_buffer_ub = DEFAULT_MEMBER_RECORD_BUFFER_UB;
263 _dof_tuple_record_size = DEFAULT_DOF_TUPLE_RECORD_SIZE;
264 _dof_tuple_record_buffer_ub = DEFAULT_DOF_TUPLE_RECORD_BUFFER_UB;
266 if(xenable_error_report)
270 H5Eset_auto1(
reinterpret_cast<herr_t (*)(
void*)
>(H5Eprint), stderr);
276 H5Eset_auto1(NULL, NULL);
281 _file.open(xfile_name, xmode, xclobber);
285 string::size_type lpos = xfile_name.find_last_of(
'/');
286 lpos = (lpos == string::npos) ? 0 : lpos+1;
287 string lname = xfile_name.substr(lpos);
289 _file_id_space_name = poset_path::reserved_prefix() + lname;
298 ensure(transaction_ct() == 0);
299 ensure(member_record_buffer_ub() == DEFAULT_MEMBER_RECORD_BUFFER_UB);
300 ensure(dof_tuple_record_size() == DEFAULT_DOF_TUPLE_RECORD_SIZE);
301 ensure(dof_tuple_record_buffer_ub() == DEFAULT_DOF_TUPLE_RECORD_BUFFER_UB);
302 ensure(file().is_open());
335 result = file().is_open();
339 ensure(result == file().is_open());
359 result = (file().mode() == sheaf_file::READ_ONLY);
363 ensure(result == (file().mode() == sheaf_file::READ_ONLY));
383 result = (file().mode() == sheaf_file::READ_WRITE);
387 ensure(result == (file().mode() == sheaf_file::READ_WRITE));
398 return _file_id_space_name;
409 _start_time = clock();
427 clock_t result = clock() - _start_time;
458 require(!transaction_is_active(xns));
474 ensure(!transaction_is_active(xns));
476 ensure(unexecutable(
"for all members m of xns: !m.is_external()"));
493 require(!transaction_is_active(xns));
502 while(!itr.is_done())
505 #ifdef DIAGNOSTIC_OUTPUT 506 cout <<
"testing is_external for poset " << xns.
member_name(itr.index()) << endl;
519 ensure(!transaction_is_active(xns));
521 ensure(unexecutable(
"for all members m of xns: !m.is_external()"));
537 require(!transaction_is_active(xns));
543 begin_read_transaction(xns);
544 end_transaction(xns, ABORT);
546 #ifdef DIAGNOSTIC_OUTPUT 547 cout << static_cast<poset_state_handle&>(xns) << endl;
552 ensure(!transaction_is_active(xns));
568 require(file_is_read_write_accessible());
572 require(!transaction_is_active(xns));
576 initialize_namespace_id_spaces_for_write(xns);
580 begin_write_transaction(xns);
584 end_transaction(xns, COMMIT);
588 ensure(state_is_consistent(xns));
589 ensure(!transaction_is_active(xns));
604 require(file_is_read_write_accessible());
607 require(!transaction_is_active(xns));
608 require(unexecutable(
"for all members m of xns( !transaction_is_active(m))"));
618 write_remainder(xns);
622 ensure(state_is_consistent(xns));
623 ensure(!transaction_is_active(xns));
624 ensure(unexecutable(
"for all members m of xns(state_is_consistent(m))"));
625 ensure(unexecutable(
"for all members m of xns( !transaction_is_active(m))"));
640 require(file_is_read_write_accessible());
646 require(unexecutable(
"xns itself has already been written"));
647 require(unexecutable(
"for all members p of xns(!p.is_external())"));
648 require(!transaction_is_active(xns));
649 require(unexecutable(
"for all members p of xns(!transaction_is_active(p))"));
657 while(!itr.is_done())
664 if(!state_is_consistent(p))
675 ensure(state_is_consistent(xns));
676 ensure(!transaction_is_active(xns));
677 ensure(unexecutable(
"for all members m of xns(state_is_consistent(m))"));
678 ensure(unexecutable(
"for all members m of xns(!transaction_is_active(m))"));
701 require(!transaction_is_active(xposet));
707 begin_read_transaction(xposet, xrow_bounds, xcol_bounds);
708 end_transaction(xposet, ABORT);
729 require(!transaction_is_active(xposet));
737 read(xposet, lrow_bounds);
758 require(!transaction_is_active(xposet));
763 poset_bounds_descriptor::BOTTOM_TOP,
764 poset_bounds_descriptor::BOTTOM_BOTTOM);
789 require(unexecutable(
"Have already read the table of contents"));
790 require(!transaction_is_active(xposet));
800 read(xposet, lrow_bounds);
818 bool xretain_read_access)
821 #ifdef DIAGNOSTIC_OUTPUT 822 cout << endl << SOURCE_CODE_LOCATION;
823 cout <<
"writing poset " << xposet.
name() <<
" index: " << xposet.
index() << endl;
828 require(file_is_read_write_accessible());
832 require(!transaction_is_active(xposet));
841 require(unexecutable(
"if xposet is a section space, col bound is base space decomposition or same fiber as xposet"));
848 begin_write_transaction(xposet, xrow_bounds, xcol_bounds);
850 if(xretain_read_access)
854 commit_transaction(xposet);
858 active_transaction(xposet).is_write_transaction =
false;
864 end_transaction(xposet, COMMIT);
869 ensure(state_is_consistent(xposet));
870 ensure(!write_transaction_is_active(xposet));
871 ensure(read_transaction_is_active(xposet) == xretain_read_access);
886 require(file_is_read_write_accessible());
889 require(!transaction_is_active(xposet));
898 write(xposet, lrow_bounds);
902 ensure(state_is_consistent(xposet));
903 ensure(!transaction_is_active(xposet));
919 require(file_is_read_write_accessible());
922 require(!transaction_is_active(xposet));
931 write(xposet, lrow_bounds);
935 ensure(state_is_consistent(xposet));
936 ensure(!transaction_is_active(xposet));
953 require(file_is_read_write_accessible());
956 require(!transaction_is_active(xposet));
974 write(xposet, lrow_bounds, lcol_bounds);
979 ensure(!transaction_is_active(xposet));
1000 require(file_is_read_write_accessible());
1002 require(!transaction_is_active(*(xmbr.
host())));
1020 begin_write_transaction(*(xmbr.
host()), lrow_bounds, lcol_bounds);
1022 commit_dof_tuple_transaction(xmbr, xcol_ub_id, xdecomp_id);
1024 remove_active_transaction(*(xmbr.
host()));
1029 ensure(!transaction_is_active(*(xmbr.
host())));
1045 require(file_is_read_write_accessible());
1046 require(write_transaction_is_active(*(xmbr.
host())));
1055 const transaction& ltrans = active_transaction(lposet);
1061 initialize_poset_id_spaces_for_write(lposet);
1070 _file_id_space_name,
1075 write_prerequisites(lscaffold);
1081 dof_tuple_record_set ldof_tuple_records(file(), dof_tuple_record_size(), dof_tuple_record_buffer_ub(), lscaffold);
1082 ldof_tuple_records.
open();
1101 lext_dof_tuple_id = ldof_tuple_records.
compute_ext_id(lint_dof_tuple_id);
1110 pair<pod_index_type, dof_tuple_type>
1111 lmap_pair(lext_dof_tuple_id.
pod(), ltype_id);
1119 pair<pod_index_type, string> lname_map_pair(lext_dof_tuple_id.
pod(), lclass_name);
1128 ldof_tuple_records.
close();
1132 ensure(write_transaction_is_active(lposet));
1152 require(!transaction_is_active(xns));
1156 #ifdef DIAGNOSTIC_OUTPUT 1157 cout << endl << SOURCE_CODE_LOCATION;
1158 cout <<
"reading poset " << xns.
name() << endl;
1167 put_active_transaction(ltrans);
1178 initialize_namespace_id_spaces_for_read(xns);
1187 _file_id_space_name,
1197 lattributes_records.
open();
1207 dof_tuple_record_set ldof_tuple_records(file(), dof_tuple_record_size(), dof_tuple_record_buffer_ub(), lscaffold);
1208 ldof_tuple_records.
open();
1210 member_record_set lmember_records(file(), member_record_buffer_ub(), lscaffold, ldof_tuple_records);
1211 lmember_records.
open();
1220 lmember_records.
close();
1221 ldof_tuple_records.
close();
1222 lattributes_records.
close();
1234 string lns_name = lattributes_records.
poset_name();
1242 while(!itr.is_done())
1244 lns_mbr.attach_to_state(&xns, itr.
index());
1255 poset_state_handle::new_poset_handle(lns_mbr.poset_class(), lns_mbr.poset_type_id());
1263 lns_mbr.dof_map().extend_to_top();
1270 lns_mbr.detach_from_state();
1274 ensure(read_transaction_is_active(xns));
1292 #ifdef DIAGNOSTIC_OUTPUT 1293 cout << endl << SOURCE_CODE_LOCATION;
1294 cout <<
"reading poset: " << xposet.
name() <<
" index: " << xposet.
index() << endl;
1297 require(!transaction_is_active(xposet));
1301 int old_access_request_depth =
1306 transaction ltrans(READ, xposet, xrow_bounds, xcol_bounds);
1307 put_active_transaction(ltrans);
1311 read_prerequisites(xposet, xcol_bounds);
1329 _file_id_space_name,
1336 #ifdef DIAGNOSTIC_OUTPUT 1338 cout << endl << SOURCE_CODE_LOCATION;
1339 cout <<
"opening record sets for poset " << lposet.
name() << endl;
1343 lattributes_records.
open();
1354 dof_tuple_record_size(),
1355 dof_tuple_record_buffer_ub(),
1357 ldof_tuple_records.
open();
1360 member_record_buffer_ub(),
1362 ldof_tuple_records);
1363 lmember_records.
open();
1382 lmember_records.
close();
1383 ldof_tuple_records.
close();
1384 lattributes_records.
close();
1386 #ifdef DIAGNOSTIC_OUTPUT 1388 cout << endl << SOURCE_CODE_LOCATION;
1389 cout <<
"closed record sets for poset " << lposet.
name() << endl;
1415 #ifdef DIAGNOSTIC_OUTPUT 1416 cout << lposet << endl;
1423 ensure(read_transaction_is_active(xposet));
1440 require(!transaction_is_active(xposet));
1444 begin_read_transaction(xposet, xrow_bounds, xcol_bounds);
1455 active_transaction(xposet).is_write_transaction =
true;
1460 ensure(read_transaction_is_active(xposet));
1461 ensure(write_transaction_is_active(xposet));
1475 require(file_is_read_write_accessible());
1477 require(!transaction_is_active(xns));
1487 transaction ltrans(WRITE, xns, poset_bounds_descriptor::BOTTOM_TOP, lcol_bounds);
1488 put_active_transaction(ltrans);
1492 ensure(write_transaction_is_active(xns));
1509 require(file_is_read_write_accessible());
1512 require(!transaction_is_active(xposet));
1521 transaction ltrans(WRITE, xposet, xrow_bounds, xcol_bounds);
1522 put_active_transaction(ltrans);
1526 ensure(write_transaction_is_active(xposet));
1541 require(file_is_read_write_accessible());
1542 require(write_transaction_is_active(xposet));
1554 const transaction& ltrans = active_transaction(xposet);
1560 initialize_poset_id_spaces_for_write(xposet);
1569 _file_id_space_name,
1574 write_prerequisites(lscaffold);
1578 #ifdef DIAGNOSTIC_OUTPUT 1579 cout << endl << SOURCE_CODE_LOCATION;
1580 cout <<
"opening record sets for poset " << xposet.
name() << endl;
1592 dof_tuple_record_size(),
1593 dof_tuple_record_buffer_ub(),
1595 ldof_tuple_records.
open();
1599 member_record_buffer_ub(),
1601 ldof_tuple_records);
1602 lmember_records.
open();
1606 lattributes_records.
open();
1628 lmember_records.
close();
1629 ldof_tuple_records.
close();
1630 lattributes_records.
close();
1632 #ifdef DIAGNOSTIC_OUTPUT 1633 cout << endl << SOURCE_CODE_LOCATION;
1634 cout <<
"closed record sets for poset " << xposet.
name() << endl;
1639 put_state_is_consistent(xposet);
1643 ensure(write_transaction_is_active(xposet));
1644 ensure(state_is_consistent(xposet));
1659 require(transaction_is_active(xposet));
1660 require(xcommit ? file_is_read_write_accessible() :
true);
1661 require(xcommit ? write_transaction_is_active(xposet) :
true);
1668 commit_transaction(xposet);
1672 remove_active_transaction(xposet);
1676 ensure(!transaction_is_active(xposet));
1677 ensure( xcommit ? state_is_consistent(xposet) :
true );
1697 return _member_record_buffer_ub;
1712 _member_record_buffer_ub = xub;
1716 ensure(member_record_buffer_ub() == xub);
1728 return _dof_tuple_record_size;
1740 _dof_tuple_record_size = xsize;
1744 ensure(dof_tuple_record_size() == xsize);
1756 return _dof_tuple_record_buffer_ub;
1770 _dof_tuple_record_buffer_ub = xub;
1774 ensure(dof_tuple_record_buffer_ub() == xub);
1794 result = _active_transactions.size();
1798 ensure(result >= 0);
1819 set<transaction>::const_iterator itr = _active_transactions.find(ltrans);
1821 result = itr != _active_transactions.end();
1844 set<transaction>::const_iterator itr = _active_transactions.find(ltrans);
1846 result = itr != _active_transactions.end();
1869 set<transaction>::const_iterator itr = _active_transactions.find(ltrans);
1871 result = (itr != _active_transactions.end()) && itr->is_read_transaction;
1894 set<transaction>::const_iterator itr = _active_transactions.find(ltrans);
1896 result = (itr != _active_transactions.end()) && itr->is_write_transaction;
1919 result = read_transaction_is_active(xposet) &&
1920 write_transaction_is_active(xposet);
2033 #ifdef DIAGNOSTIC_OUTPUT 2034 cout <<
"Inspecting prerequisites of poset " << lname_space_mbr.
name() << endl;
2043 #ifdef DIAGNOSTIC_OUTPUT 2044 cout <<
"\tprereq_id = " << lprereq_id << endl;
2057 begin_read_transaction(lposet);
2067 #ifdef DIAGNOSTIC_OUTPUT 2068 cout <<
"prereq name: " << lposet.
name() << endl;
2077 lname_space_mbr.detach_from_state();
2081 ensure(unexecutable(all prerequisites have been internalized));
2109 if(!state_is_consistent(lns->namespace_schema()))
2111 write(lns->namespace_schema());
2123 #ifdef DIAGNOSTIC_OUTPUT 2124 cout <<
"Inspecting prerequisites of poset " << lname_space_mbr.
name() << endl;
2131 #ifdef DIAGNOSTIC_OUTPUT 2132 cout <<
"\tprereq_id = " << lprereq_id << endl;
2143 #ifdef DIAGNOSTIC_OUTPUT 2144 cout <<
"prereq name: " << lposet.
name() << endl;
2147 if(!state_is_consistent(lposet))
2168 lname_space_mbr.detach_from_state();
2176 ensure(unexecutable(
"for all prerequisites p: state_is_consistent(p)"));
2206 _file_id_space_name,
false,
false);
2217 _file_id_space_name,
false,
false);
2223 get_id_space<scattered_insertion_index_space_handle>(_file_id_space_name);
2236 _file_id_space_name,
false,
false);
2269 while(!itr0.is_done())
2277 lid_space.attach_to(lmbr_poset.
member_id_spaces(
false), _file_id_space_name);
2342 clear_all_id_spaces(xns);
2351 pod_index_type lfirst_member = member_record_set::first_member_record();
2355 _file_id_space_name,
false,
false);
2360 lid_space.
insert_interval(lfirst_member, lfirst_member+lprim_ct, 0, lprim_ct);
2366 _file_id_space_name,
false,
false);
2373 lid_space.
insert_interval(lfirst_member, lfirst_member+lprim_schema_ct,
2374 0, lprim_schema_ct);
2380 _file_id_space_name,
false,
false);
2387 lid_space.
insert_interval(lfirst_member, lfirst_member+lnamespace_schema_ct,
2388 0, lnamespace_schema_ct);
2414 clear_all_id_spaces(xns);
2432 const string _name_space_ext_name(
"__name_space");
2439 return (target < xother.
target);
2501 ensure(
target == xindex);
2560 sheaf::storage_agent::
2570 set<transaction>::iterator itr = _active_transactions.find(ltrans);
2584 sheaf::storage_agent::
2593 _active_transactions.insert(xtransaction);
2606 sheaf::storage_agent::
2616 (void)_active_transactions.erase(ltrans);
An implementation of class scattered_insertion_index_space_handle that has a interval id space state...
bool is_read_transaction
True if read transaction.
An encapsulation of an HDF file containing sheaf data.
poset_table_state & table() const
The table of dof tuples of this poset.
void read_prerequisites(const poset_state_handle &xposet, const poset_bounds_descriptor &xcol_bounds)
Reads all posets that xposet depends on.
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
void write_toc(poset_state_handle &xposet, const scoped_index &xtoc_id)
Writes the portion of poset xposet between the lower bound specified by the subposet with index xtoc_...
pod_index_type ub_id() const
The index of the upper bound member, if the upper bound contains a single member. ...
void read_entire(namespace_poset &xns)
Reads the namespace xns and all the posets in it.
poset_state_handle * host() const
The poset which this is a handle to a component of.
void put_state_is_consistent(poset_state_handle &xposet)
Sets the state_is_consistent flag for xposet to true.
virtual void open()
Opens the record_set.
bool is_valid() const
True if this is a valid id.
pod_index_type dof_tuple_id(bool xauto_access) const
The dof tuple index of this member.
void evaluate_toc_alias()
If row bounds lower bound is an alias for the toc bounds, substitutes the toc bounds into the row bou...
namespace_poset * name_space() const
The name space of this poset.
bool is_write_transaction
True if write transaction.
void write_row_decomposition(poset_state_handle &xposet, const scoped_index &xdecomp_id)
Writes poset xposet using the row decomposition identified by index xdecomp_id.
virtual ~storage_agent()
Destructor.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
void put_name(const std::string &xname)
Sets name() to xname. Intended for use only by storage_agent::begin_read_transaction(namespace_poset&...
virtual void close()
Closes the record_set.
namespace_poset_schema & namespace_schema()
The namespace poset schema within this namespace (mutable version)
const scoped_index & index() const
The member index of this poset within the namespace host()
bool state_is_consistent(const poset_state_handle &xposet) const
True if uncommitted state is consistent with committed state.
dof_tuple_types_type & dof_tuple_types()
Dof tuple type ids (mutable version).
const std::string & file_id_space_name() const
The name of the id spaces associated with this file in each poset.
void internalize()
Internalize the members of scafold().structure() from disk.
std::string poset_name() const
The name of the poset this represents, extracted from the name of the dataset.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
void put_member_record_buffer_ub(int xub)
Sets the number of records allocated in a member record buffer during a transaction.
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.
A client handle for a general, abstract partially order set.
access_mode
File access modes.
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.
const index_space_family & dof_tuple_id_spaces(bool xauto_access) const
Collection of dof tuple id spaces for this (const version).
int transaction_ct() const
The number of active transactions.
primitives_poset & primitives()
The poset of primitives for this namespace (mutable version)
const scoped_index & index() const
The current item in the subset.
void put_dof_tuple_record_size(size_t xsize)
OBSOLETE: no longer used. Sets the number of bytes in a dof_tuple record.
const index_space_family & member_id_spaces(bool xauto_access) const
Collection of member id spaces for this (const version).
void clear()
Delete all ids.
Specialization of the filtered depth-first iterator which exposes the POSTVISIT_ACTION to the client...
virtual void release_id_space() const
Returns this id space handle to the handle pool.
pod_index_type ub_id() const
The index of the upper bound member, if the upper bound contains a single member. ...
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
void initialize_poset_id_spaces_for_write(poset_state_handle &xposet)
Initializes the subposet and dof tuple index spaces for poset xposet.
poset_bounds_descriptor col_bounds
Bounds for the columns accessed in this transaction.
const scoped_index & index() const
The index of the component state this handle is attached to.
int dof_tuple_record_buffer_ub() const
The number of records allocated in a dof_tuple record buffer during a transaction. Equal to the HDF chunk size.
sheaf_file & file()
The file this is attached to.
std::string name() const
A name for this.
virtual bool invariant() const
Class invariant.
dof_tuple_class_names_type & dof_tuple_class_names()
Dof tuple class names (mutable version).
void read_row_decomposition(poset_state_handle &xposet, const scoped_index &xdecomp_id)
Reads poset xposet using the row decomposition identified by index xdecomp_id.
bool file_is_read_accessible() const
True if file is open.
bool read_transaction_is_active(const poset_state_handle &xposet) const
True if there is an active read transaction for poset xposet.
primitives_poset_schema & primitives_schema()
The schema poset for the primitives poset (mutable version)
void next()
Makes item the next member of the subset.
A client handle for a member of a namespace poset.
transaction()
Default constructor.
void clear_all_id_spaces(namespace_poset &xns)
Clears all dof tuple index spaces.
void commit_transaction(poset_state_handle &xposet)
Commits the uncommitted state, but does not end the transaction or release read access.
void read_toc(poset_state_handle &xposet)
Reads the table of contents portion of poset xposet.
Abstract base class with useful features for all objects.
A record_set containing records of type member_record.
void write_dof_tuple(const abstract_poset_member &xmbr, const scoped_index &xcol_ub_id, const scoped_index &xdecomp_id)
Writes the portion of the dof tuple of member xmbr which is in the downset of the schema member ident...
const bool NOT_STRICT
Iteration strictness control.
const bool DOWN
Iteration directions.
virtual int standard_member_ct() const
The number of standard members automatically allocated by the constructor.
void put_dof_tuple_record_buffer_ub(int xub)
Sets the number of records allocated in a dof_tuple record buffer during a transaction and hence the ...
size_t dof_tuple_record_size() const
OBSOLETE: no longer used. The number of bytes in a dof tuple record The dof tuple records are now aut...
void clear_state_is_modified()
Sets the state_is_modified floag to false.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
void end_transaction(poset_state_handle &xposet, bool xcommit=true)
Ends an independent access transaction.
pod_index_type target
The index of the target poset of the transaction.
namespace_poset_member & top()
The top member of the poset (mutable version)
bool ub_member_is_not_top() const
True if ub_is_member() and ub_id() is not sheaf_constants::TOP_INDEX.
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()).
void reset_time()
Reset the start time. Set the start time to the CPU time when this function is called.
bool is_external() const
True if this has a corresponding member in a name space, but is not yet attached to a state...
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
void get_member_names_from_poset()
Transfers the enitre poset member name map to the scaffold name map.
poset_bounds_descriptor row_bounds
Bounds for the rows accessed in this transaction.
void write(namespace_poset &xns)
Writes the namespace xns.
void write_remainder(const namespace_poset &xns)
Writes all the posets in namespace xns that have not already been written.
transaction_type
Type of access associated with a transaction.
An index within the external ("client") scope of a given id space.
void initialize_namespace_id_spaces_for_read(namespace_poset &xposet)
Ensures that the namespace and its standard posets have an empty index space for members and no index...
void read(namespace_poset &xns)
Reads the namespace xns.
bool write_transaction_is_active(const poset_state_handle &xposet) const
True if there is an active write transaction involving the poset with name space index xindex...
bool state_is_modified() const
True if write access has been granted and released since the last call to clear_state_is_modified().
void initialize_namespace_id_spaces_for_write(namespace_poset &xposet)
Ensures that the namespace and its standard posets have an empty index space for members and no index...
void internalize(pod_index_type xmax_row_int_id)
Internalize the members of scafold().structure() from disk.
void read_index(poset_state_handle &xposet)
Reads the index of poset xposet; that is, it does not read the dof tuples.
bool transaction_is_active(pod_index_type xindex) const
True if either a read or write transaction is active for poset with index xindex. ...
poset_bounds & row_bounds()
The bounds for the rows in this transaction (mutable version).
virtual std::string member_name(pod_index_type xmbr_hub_id, bool xauto_access=false) const
A name for the member with hub id xmbr_hub_id.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
void internalize()
Internalize the record set from disk.
void clear()
Removes all members except the standard members.
static const poset_bounds_descriptor & BOTTOM_TOP
An instance with lb() == {bottom} and ub() == {top}.
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 structure_is_namespace() const
True if the poset being transferred is the name space poset.
dof_tuple_type
Identifiers for dof tuple types.
void attach_to_state(const poset_state_handle *xother)
Attach this handle to the same state as xother.
virtual std::string name() const
The name of this poset.
void write_col_decomposition(poset_state_handle &xposet, const scoped_index &xrow_id, const scoped_index &xdecomp_id)
Writes the member identified by xrow_id in poset xposet using the column decomposition identified by ...
const index_space_family & subposet_id_spaces(bool xauto_access) const
Collection of subposet id spaces for this (const version).
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
~transaction()
Destructor.
void begin_write_transaction(namespace_poset &xns)
Begins an independent write transaction for the namespace xns.
virtual storage_agent * clone() const
Virtual constructor; makes a new instance of the same type as this.
void externalize()
Externalize the members of scafold().structure() to disk.
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...
Iterates over the subset of Zn defined by the characteristic function host().
bool file_is_read_write_accessible() const
True if file is open with READ_WRITE.
namespace_poset * name_space() const
The namespace this poset resides in.
bool ge(pod_index_type xother_index) const
True if this is greater than or equal to the member with index xother_index.
virtual bool is_attached() const
True if this is attached to a state.
A record set for storing various poset attributes.
A description of a (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bound...
void externalize()
Externalize the reccord set to disk.
bool is_empty(const std::string &xname) const
True if there are no ids in the space with name xname.
static const bool ABORT
Value to indicate transaction should not be committed.
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...
static const bool RETAIN_READ
Value to indicate read access should be retained.
int access_request_depth() const
The number of times access has been requested and granted without being released. ...
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.
virtual std::string name() const
The name of this poset.
void read_remainder(namespace_poset &xns)
Reads all members of the namespace that have not already been read.
int_type pod_index_type
The plain old data index type.
static const bool RELEASE_ALL
Value to indicate read access should not be retained.
bool is_done() const
True if iteration finished.
bool file_is_read_only_accessible() const
True if file is open with READ_ONLY access.
scoped_index index() const
The name space index of this poset.
static const bool COMMIT
Value to indicate transaction should be committed.
A handle for a scattered_insertion_index_space_state.
void externalize(pod_index_type xmax_row_int_id)
Externalize the members of scafold().structure() to disk.
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
A poset specific collection of data converters, various buffers and other data used while transferrin...
virtual void open()
Opens the record_set.
int member_record_buffer_ub() const
The number of records allocated in a member record buffer during a transaction.
void begin_read_transaction(namespace_poset &xns)
Begins an independent read transaction for the namespace xposet.
virtual dof_tuple_type type_id() const =0
An identifer for the type of dof tuple this is.
void begin_read_write_transaction(poset_state_handle &xposet, const poset_bounds_descriptor &xrow_bounds=poset_bounds_descriptor::BOTTOM_TOP, const poset_bounds_descriptor &xcol_bounds=poset_bounds_descriptor::BOTTOM_TOP)
Begins an independent read-write transaction for the portion of poset xposet defined by the down sets...
void write_entire(namespace_poset &xns)
Writes the namespace xns and all the posets in it. Rewrites any posets that have already been written...
virtual void get_read_access() const
Get read access to the state associated with this.
An abstract client handle for a member of a poset.
virtual poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
bool read_write_transaction_is_active(poset_state_handle &xposet) const
True if both a read-write transaction is active.
void commit_dof_tuple_transaction(const abstract_poset_member &xmbr, const scoped_index &xcol_ub_id, const scoped_index &xdecomp_id)
Commits the dof tuple transaction associated with xmbr.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
virtual const std::string & class_name() const
The name of the actual (possibly derived) class of this instance.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
The set of subsets of a poset.
clock_t time() const
Return the CPU time between when reset_time() was last called and when this function is called...
void write_prerequisites(const poset_scaffold &xscaffold)
Writes all posets that xposet depends on.
bool operator<(const transaction &xother) const
True if this.target < xother.target.
void put_member_names_to_poset()
Transfers all entries in scaffold name map that refer members that exist in the poset.
The data structure representing the table containing the dof tuples of the members of a poset...
poset_powerset_state & powerset() const
The set of subposets of this poset.
storage_agent()
Default constructor.
Agent responsible for importing and exporting posets from an external name space which resides on dis...
const int PREREQ_IDS_UB
Number of prerequisites ids. Must be consistent with PREREQ_ID_*_INDEX below.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.