21 #include "SheafSystem/schema_poset_member.h" 23 #include "SheafSystem/array_index_space_handle.h" 24 #include "SheafSystem/array_index_space_state.h" 25 #include "SheafSystem/assert_contract.h" 26 #include "SheafSystem/namespace_poset.h" 27 #include "SheafSystem/poset_bounds.h" 28 #include "SheafSystem/poset_dof_iterator.h" 29 #include "SheafSystem/postorder_iterator.h" 30 #include "SheafSystem/schema_descriptor.h" 31 #include "SheafSystem/index_space_iterator.h" 32 #include "SheafSystem/tern.h" 33 #include "SheafSystem/wsv_block.h" 54 static const poset_path result(namespace_poset::primitives_schema_path());
58 ensure(result.
full());
75 require(!xhost_path.
empty());
78 require(xschema_path.
full());
80 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
84 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xauto_access);
89 subposet ltable_dofs(&result, 0,
false);
90 subposet lrow_dofs(&result, 0,
false);
94 result.
schematize(<able_dofs, &lrow_dofs,
true);
105 ensure(xns.
owns(result, xauto_access));
108 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
128 require(!xhost_path.
empty());
142 result_ptr = &new_host(xns, xhost_path, standard_schema_path(), xauto_access);
149 ensure(xns.
owns(result, xauto_access));
152 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
175 : _table_dof_descriptors(0),
176 _row_dof_descriptors(0),
177 _table_cache_version(NOT_A_STANDARD_VERSION_INDEX),
178 _row_cache_version(NOT_A_STANDARD_VERSION_INDEX),
179 _table_dof_id_space(0),
218 new_jem_state(const_cast<abstract_poset_member*>(&xother),
true, xauto_access);
358 const tern& xnew_jem,
374 new_jrm_state(xhost, xexpansion, xexpansion_ct, xnew_jem, xauto_access);
384 const std::string& xname,
402 new_jim_state(xns, xname, xparent_path, xdof_specs, xauto_access);
434 ensure(
host() == xhost);
435 ensure(
index() == xhub_id);
461 ensure(
host() == xhost);
462 ensure(
index() ==~ xid);
480 require(!xname.empty());
490 ensure(
host() == xhost);
491 ensure(
name() == xname);
532 require(!xauto_access ?
host()->in_jim_edit_mode() :
true);
559 ensure(
type() == xprimitive_type);
607 ensure(
type() == xprimitive_type);
622 const std::string& xname,
636 require(!xname.empty());
641 require(xauto_access ||
651 require_for_all(i, 0, xdof_specs.
ct(), !xdof_specs[i].name.empty());
675 lschema_poset.begin_jim_edit_mode();
684 int ldof_ct = xdof_specs.
ct();
691 if(lschema_poset.top().covers(&lschema_mbr))
695 lschema_poset.top().delete_cover_link(&lschema_mbr);
701 if((lschema_mbr.
index() != BOTTOM_INDEX) || (ldof_ct == 0))
708 for(
int i=0; i<ldof_ct; ++i)
710 const string& ldof_name = xdof_specs[i].name;
711 if(lschema_poset.contains_member(ldof_name))
722 lschema_mbr.
put_name(ldof_name,
true,
false);
727 subposet& ldof_sp = xdof_specs[i].is_table_dof ? ltable_dof_sp : lrow_dof_sp;
737 lschema_poset.end_jim_edit_mode();
754 ensure(
name() == xname);
759 lschema_poset.release_access();
786 require(xpath.
full());
787 require(!xauto_access ?
802 result = lschema_mbr.
dof_ct(xis_table_dof);
804 lschema_mbr.detach_from_state();
808 lschema_poset.release_access();
832 require(precondition_of(
dof_ct(xns, xpath,
true, xauto_access)));
836 result =
dof_ct(xns, xpath,
true, xauto_access);
841 ensure(postcondition_of(
dof_ct(xns, xpath,
true, xauto_access)));
858 require(precondition_of(
dof_ct(xns, xpath,
false, xauto_access)));
862 result =
dof_ct(xns, xpath,
false, xauto_access);
867 ensure(postcondition_of(
dof_ct(xns, xpath,
false, xauto_access)));
1045 while(!itr->
is_done() && (result != NOT_A_PRIMITIVE_TYPE))
1049 result = NOT_A_PRIMITIVE_TYPE;
1095 require(!xname.empty());
1102 (xis_table_dofs ?
"_table_dofs" :
"_row_dofs");
1106 ensure(!result.empty());
1127 ensure(!result.empty());
1190 require(
host()->is_schematized(
false));
1195 result = xother.
le(
this) && xother.
is_dof(xin_table_dofs);
1213 require(
host()->is_schematized(
false));
1246 require(
host()->is_schematized(
false));
1263 require(
host()->is_schematized(
false));
1264 require(!xname.empty());
1284 require(
host()->is_schematized(
false));
1312 require(
host()->is_schematized(
false));
1336 require(
host()->is_schematized(
false));
1364 require(
host()->is_schematized(
false));
1371 result = (
index() != TOP_INDEX) && (
index() != BOTTOM_INDEX);
1389 require(
host()->is_schematized(
false));
1478 require(
host()->is_schematized(
false));
1488 ensure(result != 0);
1511 result =
ge(&xother);
1545 while(result && !lother_itr->
is_done())
1547 result = !lthis_itr->
is_done() &&
1584 require(xpath.
full());
1589 if(
name_space()->contains_poset_member(xpath))
1623 require(xpath.
full());
1628 if(
name_space()->contains_poset_member(xpath))
1683 require(xpath.
full());
1726 require(xpath.
full());
1759 require(xchild_path.
full());
1760 require(xauto_access ||
1763 require(xparent_path.
full());
1764 require(xauto_access ||
1789 lparent.detach_from_state();
1790 lchild.detach_from_state();
1815 bool xis_table_dofs,
1829 require(xchild_path.
full());
1830 require(!xauto_access ?
1834 require(xparent_path.
full());
1835 require(!xauto_access ?
1859 result = lchild.
conforms_to(lparent, xis_table_dofs);
1861 lparent.detach_from_state();
1862 lchild.detach_from_state();
1893 require(precondition_of(
conforms_to(xns, xchild_path, xparent_path,
true, xauto_access)));
1898 result =
conforms_to(xns, xchild_path, xparent_path,
true, xauto_access);
1902 ensure(postcondition_of(
conforms_to(xns, xchild_path, xparent_path,
true, xauto_access)));
1920 require(precondition_of(
conforms_to(xns, xchild_path, xparent_path,
false, xauto_access)));
1925 result =
conforms_to(xns, xchild_path, xparent_path,
false, xauto_access);
1929 ensure(postcondition_of(
conforms_to(xns, xchild_path, xparent_path,
false, xauto_access)));
1940 const std::string& xname)
1944 require(!xname.empty());
1946 require(xparent_path.
full());
1964 lmember.
put_name(xname,
true,
true);
1976 ensure(result.poset_name() == xparent_path.
poset_name());
1977 ensure(result.member_name() == xname);
1978 ensure(unexecutable(
new member is join equivalent to parent member));
1988 const std::string& xposet_name,
1989 const std::string& xmember_name,
1990 const std::string& xparent_name)
1996 poset_path lparent_path(xposet_name, xparent_name);
2011 const std::string& xname,
2012 const std::string xdof_names[],
2014 const bool xis_table_dof[],
2027 require(xparent_path.
full());
2029 require(!xauto_access ?
2040 require(!xname.empty());
2042 require_for_all(i, 0, xdof_ct, !xdof_names[i].empty());
2043 require(unexecutable(
"if xdof_names[i] already exists, must have type xdof_type[i]"));
2044 require(unexecutable(
"if xdof_names[i] already exists, must have role xis_table_dof[i]"));
2071 const string& ldof_name = xdof_names[i];
2080 assertion(lschema_mbr.
is_dof(xis_table_dof[i]));
2087 lschema_mbr.
put_name(ldof_name,
true,
false);
2091 subposet& ldof_sp = xis_table_dof[i] ? ltable_dof_sp : lrow_dof_sp;
2106 lschema_mbr.
put_name(xname,
true,
false);
2137 const std::string& xname,
2138 const std::string xdof_names[],
2146 require(precondition_of(
make_schema(xns, xparent_path, xname, xdof_names, xdof_types,
false{}, xdof_ct, xauto_access)));
2150 bool* ldof_roles =
new bool[xdof_ct];
2151 for(
int i=0; i< xdof_ct; ++i)
2153 ldof_roles[i] =
false;
2166 delete [] ldof_roles;
2170 ensure(postcondition_of(
make_schema(xns, xparent_path, xname, xdof_names, xdof_types,
false[], xdof_ct, xauto_access)));
2181 const std::string& xname,
2182 const std::string xdof_names[],
2189 require(precondition_of(
make_row_schema(xns, xparent_path, xname, xdof_names, xdof_type[], xdof_ct, xauto_access)));
2194 prim_type* ldof_types =
new prim_type[xdof_ct];
2195 for(
int i=0; i< xdof_ct; ++i)
2197 ldof_types[i] = xdof_type;
2209 delete [] ldof_types;
2213 ensure(postcondition_of(
make_row_schema(xns, xparent_path, xname, xdof_names, xdof_type[], xdof_ct, xauto_access)));
2223 const std::string member_names[],
2224 const int num_members,
2225 const int member_dof_type,
2226 const std::string& schema_poset_name,
2227 const std::string& schema_member_name,
2228 const std::string& schema_inherits_name)
2236 prim_type* ltypes =
new prim_type[num_members];
2237 for(
int i=0; i< num_members; ++i)
2239 ltypes[i] = prim_type(member_dof_type);
2242 bool* lroles =
new bool[num_members];
2243 for(
int i=0; i< num_members; ++i)
2248 poset_path lparent_path(schema_poset_name, schema_inherits_name);
2272 const std::string member_names[],
2273 const int num_members,
2274 const int member_dof_type,
2275 const std::string& schema_poset_name,
2276 const std::string& schema_member_name,
2277 const std::string& schema_inherits_name)
2285 prim_type* ltypes =
new prim_type[num_members];
2286 for(
int i=0; i< num_members; ++i)
2288 ltypes[i] = prim_type(member_dof_type);
2291 bool* lroles =
new bool[num_members];
2292 for(
int i=0; i< num_members; ++i)
2298 poset_path lparent_path(schema_poset_name, schema_inherits_name);
2326 require(
host()->is_schematized(
false));
2359 ensure(unexecutable(result != 0 implies it points to a buffer of
length table_dof_ct()+1));
2387 ensure(unexecutable(result != 0 implies it points to a buffer of
length table_dof_ct()+1));
2415 ensure(unexecutable(result != 0 implies it points to a buffer of
length row_dof_ct()+1));
2721 bool result =
false;
2726 if(ldof_id_space == 0)
2731 if(!
host()->member_id_spaces(
false).contains(ldof_id_space_name))
2785 set<pod_index_type> ltop_seq_ids;
2790 ltop_seq_ids.insert(ltop_space.
pod(litr->
index()));
2795 ldof_id_space->
reserve(ltop_seq_ids.size());
2797 set<pod_index_type>::iterator lseq_id_itr;
2798 for(lseq_id_itr = ltop_seq_ids.begin();
2799 lseq_id_itr != ltop_seq_ids.end();
2829 if(xdof_descriptors != 0)
2852 ldesc.size = lschema_mbr->
size();
2853 ldesc.alignment = lschema_mbr->
alignment();
2854 ldesc.type = lschema_mbr->
type();
2855 ldesc.offset = xdof_tuple_ub;
2857 xdof_tuple_ub += ldesc.size;
2859 #ifdef DIAGNOSTIC_OUTPUT 2860 cout <<
" dof name: " << lschema_mbr->
name()
2861 <<
" seq id: " << itr.
pod()
2862 <<
" dof descriptor: " << ldesc
2877 ldesc.alignment = 0;
2878 ldesc.type = NOT_A_PRIMITIVE_TYPE;
2879 ldesc.offset = xdof_tuple_ub;
2883 ensure((xdof_ct > 0) == (xdof_tuple_ub > 0));
3082 require(
dof_id_space(xis_table_dof).contains(xdof_id));
3088 string result(
host()->member_name(lhub_pod,
false));
3104 require(
dof_id_space(xis_table_dof, xauto_access).contains(xdof_id));
3108 string result(
host()->member_name(xdof_id, xauto_access));
3124 require(
dof_id_space(xis_table_dof).contains(xdof_id));
3144 require(
dof_id_space(xis_table_dof, xauto_access).contains(xdof_id));
3170 size(
const std::string& xname,
bool xis_table_dof,
bool xauto_access)
const 3210 require(
dof_id_space(xis_table_dof).contains(xdof_id));
3230 require(
dof_id_space(xis_table_dof, xauto_access).contains(xdof_id));
3256 alignment(
const std::string& xname,
bool xis_table_dof,
bool xauto_access)
const 3295 require(
dof_id_space(xis_table_dof).contains(xdof_id));
3316 require(
dof_id_space(xis_table_dof, xauto_access).contains(xdof_id));
3342 type(
const std::string& xname,
bool xis_table_dof,
bool xauto_access)
const 3381 require(
dof_id_space(xis_table_dof).contains(xdof_id));
3401 require(
dof_id_space(xis_table_dof, xauto_access).contains(xdof_id));
3427 offset(
const std::string& xname,
bool xis_table_dof,
bool xauto_access)
const 3480 require(
host()->includes_subposet(xindex));
3510 lbnd_id = xbounds.
ub_id();
3515 lbnd_id = xbounds.
lb_id();
3522 l_lb->
force(lbnd_id,
true);
3532 ensure(result != 0);
3546 require(xext_id >=
host()->standard_member_ct() ?
3547 host()->member_id_spaces(
false).contains(xid_space_name) :
3549 require(xext_id >=
host()->standard_member_ct() ?
3550 host()->member_id_spaces(
false).contains(xid_space_name, xext_id) :
3559 ensure(
host()->contains_member(result,
false));
3605 xschema_poset_ext_id =
3608 xschema_member_ext_id =
3671 require(xrequire_write_access ?
3698 require(xrequire_write_access ?
3727 require(xdof_map != 0);
3823 ensure(result != 0);
3890 result = xinclude_shallow ?
sizeof(xp) : 0;
3892 #ifdef DIAGNOSTIC_OUTPUT 3893 cout <<
"$$$ deep_size(const schema_poset_mamber& xp) &xp = " << &xp << endl;
3894 cout <<
"$$$ deep_size(const schema_poset_mamber& xp) sizeof(xp) = " <<
sizeof(xp) << endl;
3916 #ifdef DIAGNOSTIC_OUTPUT 3917 cout <<
"$$$ deep_size(const schema_poset_mamber& xp) result = " << result << endl;
3922 ensure(result >= 0);
virtual void force_is_done()
Force the iterator to be done.
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...
pod_index_type ub_id() const
The index of the upper bound member, if the upper bound contains a single member. ...
poset_state_handle * host() const
The poset which this is a handle to a component of.
virtual bool invariant() const
Class invariant.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
virtual bool is_jim(bool xin_current_version=true) const
True if this member is join irreducible in the current version of the host (xin_current_version == tr...
A client handle for a subposet.
virtual ~schema_poset_member()
Destructor; deletes a poset member and its attached state, if any.
virtual bool is_restricted() const
True if handle is a restriction of the state, that is, if schema() is not the same as host()->schema(...
bool is_valid() const
True if this is a valid id.
virtual void schematize(subposet *xtable_dof_subposet, subposet *xrow_dof_subposet, bool xall_members=false)
Prepare this poset and its top member for use as a schema. If xall_members = true, schematize all other members as well.
bool table_cache_consistent() const
True if cached table properties are consistent with index() and version().
bool lb_is_singleton() const
True if the lower bound contains a single member.
virtual void create_cover_link(abstract_poset_member *xlesser)
Insert a link from this to lesser; make lesser <= this.
bool full() const
True if both poset name and member name are not empty.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
size_type ct() const
The number of items currently in use.
bool covers(const abstract_poset_member *xother) const
True if this covers other.
virtual void next()
Makes this the next member of the subset.
const index_space_handle & row_dof_id_space() const
The row dof id space for the schema defined by this.
An abstract iterator over the ids of an id space.
virtual schema_poset_member * clone() const
Make a new handle, no state instance of current.
virtual size_t size() const
The number of bytes in this dof.
const index_space_handle & dof_id_space(bool xis_table_dofs) const
The table dof (xis_table_dof true) or row dof id space for the schema defined by this.
virtual bool has_id_space() const
True if this already has an id space.
virtual index_iterator * get_decomposition(pod_index_type xindex) const
An iterator over the members of the decomposition identified by xindex.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
poset_path path(bool xauto_access=true) const
A path to this component.
pod_type pod() const
The current id in the iteration.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
The default name space; a poset which contains other posets as members.
bool table_conforms_to(const schema_poset_member &xother) const
True if the table dofs defined by this agree in type and in order with the dofs defined by xother...
virtual subposet_state * powerset_member(const scoped_index &xindex) const
The hidden state of the subposet asocciated with index xindex.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
void put_type(int xindex)
Put type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited...
schema_poset_member & item()
The current member of the iteration (mutable version).
poset_state_handle * _host
The host poset for this component.
static void make_table_dofs_schema(namespace_poset *xns, const std::string member_names[], const int num_members, const int member_dof_type, const std::string &schema_poset_name, const std::string &schema_member_name, const std::string &schema_inherits_name)
The data structure representing the state of a subposet.
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
const scoped_index & table_dof_subposet_index() const
The index in host() of the subposet containing the the table dofs in the down set of this (const vers...
A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly...
A client handle for a general, abstract partially order set.
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.
index_space_handle & get_id_space(const std::string &xname) const
Allocates an id space handle from the handle pool attached to state with name xname.
bool is_component() const
True if this represents a component in the row dofs part of some schema.
static int dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xis_table_dof, bool xauto_access=true)
The number of table dofs (xis_table_dof true) or row dofs defined by the schema specified by xns and ...
static host_type & standard_host(namespace_type &xns, const poset_path &xhost_path, bool xauto_access)
The host with path xhost_path.Returns the host if it already exists, otherwise, creates it in namespa...
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
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...
const index_space_family & member_id_spaces(bool xauto_access) const
Collection of member id spaces for this (const version).
static poset_path make_row_schema(const namespace_poset &xns, const poset_path &xparent_path, const std::string &xname, const std::string xdof_names[], const primitive_type xdof_types[], size_type xdof_ct, bool xauto_access)
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
index_space_handle * _row_dof_id_space
The row dof id space for the schema defined by this.
bool is_factor_of(const schema_poset_member &xother) const
True if this represents a factor in the row dofs part of schema xother.
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.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
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.
virtual void release_id_space() const =0
Returns this id space handle to the handle pool.
virtual void get_read_access() const
Get read access to the state associated with this.
A (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation...
index_space_handle * _table_dof_id_space
The table dof id space for the schema defined by this.
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 invalidate()
Make this id invalid.
virtual namespace_poset * name_space() const
The namespace of host()
const scoped_index & index() const
The index of the component state this handle is attached to.
virtual void next()=0
Makes id() the next id in the iteration.
std::string name() const
A name for this.
The general, abstract map from dof ids to dof values.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual primitive_type type() const
The primitive type index of the dof defined by this.
virtual schema_poset_member & ext_data_type_schema()
The schema for the external data type associated with this schema.
const index_space_handle & table_dof_id_space() const
The table dof id space for the schema defined by this.
bool row_cache_consistent() const
True if cached row properties are consistent with index() and version().
virtual pod_index_type new_member(bool xis_jim, pod_index_type xtuple_hub_id)
Create a disconnected member with is_jim == xis_jim and the dof tuple identified by hub id xtuple_hub...
SHEAF_DLL_SPEC vd_value_type length(const ed &x0, bool xauto_access)
The Euclidean length (magnitude) of x0 (version for persistent types).
virtual int dof_ct() const
The number of dofs in the dof tuple for jims of this poset;.
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...
Abstract base class with useful features for all objects.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
bool path_is_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and conforms to poset type P...
virtual index_iterator * get_decomposition(pod_index_type xindex) const
An iterator over the members of the decomposition identified by xindex. /.
virtual size_t alignment() const
The alignment for this dof.
pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name, bool xauto_access) const
Translates xext_id to an internal id using the equivalence map with name xid_space_name.
int row_dof_ct() const
The number of row dofs defined by this schema. Synonym for dof_ct(false).
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
bool has_same_host(const poset_component *xother) const
True if xother is attached to the same host as this or if both are unattached.
dof_descriptor_array * table_dof_descriptors() const
The dof_descriptors_array for the table dof tuple defined by this schema. Synonym for dof_descriptors...
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
bool is_done() const
True if iteration is finished.
scoped_index _row_cache_index
The index with respect to which the cached row properties were evaluated.
virtual void update_row_dof_id_space() const
Update the row dof id space.
bool is_component_of(const schema_poset_member &xother) const
True if this represents a component in the row dofs part of schema xother.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
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.
primitive_type
Type ids for sheaf primitives.
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...
A client handle for a mutable partially ordered set.
primitive_type type() const
Get type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited...
size_type _row_dof_ct
The number of row dofs defined by this schema.
A map from schema poset member ids to dof values for primitives_poset members.
pointer_type base() const
The underlying storage array.
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
virtual void release_iterator(index_space_iterator &xitr) const =0
Returns the id space iterator xitr to the iterator pool.
virtual void detach_from_state()
Detach this handle from its state, if any.
int table_dof_ct() const
The number of table dofs defined by this schema. Synonym for dof_ct(true).
virtual scattered_insertion_index_space_handle & new_id_space(const std::string &xstate_class_name)
Creates an id space for the members of this.
An index within the external ("client") scope of a given id space.
static poset_path make_homogeneous_row_schema(const namespace_poset &xns, const poset_path &xparent_path, const std::string &xname, const std::string xdof_names[], const primitive_type xdof_type, size_type xdof_ct, bool xauto_access)
size_type _row_dof_tuple_ub
The size in bytes of the row dof tuple defined by this schema.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
virtual pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name) const
Gets the internal id corresponding to xext_id in the id space with name xid_space_name.
dof_descriptor_array * _row_dof_descriptors
The dof_descriptors_array for the row dof tuple defined by this schema.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
virtual void update_row_cache(bool xupdate_id_space=false) const
Updates cached row properties; if xupdate_id_space, force the update of the row dof id space...
virtual void get_read_access() const
Get read access to the state associated with this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
std::string poset_name() const
The poset name part of the path.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
void new_jim_state(primitive_type xprimitive_type, bool xauto_access=true)
Creates a new jim state in host() with dof map a copy of the primitive type specified by xprimitive_t...
static std::string reserved_prefix()
Prefix for identifying member names reserved by the sheaf system.
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
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...
void reserve(size_type xcapacity)
Reserve enough memory for xcapacity number of ids.
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
size_t table_dof_tuple_ub() const
The size in bytes of the table dof tuple defined by this schema. Synonym for dof_tuple_ub(true).
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
virtual size_type ct() const =0
The number of members.
int _table_cache_version
The version with respect to which the cached table properties were evaluated.
virtual bool invariant() const
Class invariant.
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
virtual primitive_type dof_tuple_type(bool xis_table_dof) const
The type of table dofs (xis_table_dof == true) or row dofs (xis_table_dof == false) defined by this s...
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
bool ub_is_singleton() const
True if the upper bound contains a single member.
virtual void update_table_dof_descriptors() const
Update the table dof descriptors.
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
int _row_cache_version
The version with respect to which the cached row properties were evaluated.
bool empty() const
True if both poset name and member name are empty.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
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...
size_t alignment() const
Get alignment dof.
virtual bool initialize_table_dof_id_space() const
Initialize table dof id space. Return true, if and only if the table dof id space was created...
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
bool initialize_dof_id_space(bool xis_table_dof) const
Initializes the dof id space. If xis_table_dof, otherwise initialize table dof id space...
void force_cache_update()
Forces update of the attribute cache.
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.
virtual index_space_iterator & get_iterator() const =0
Allocates an id space iterator from the iterator pool.
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
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...
const hub_index_space_handle & member_hub_id_space(bool xauto_access) const
The member hub id space.
virtual const scoped_index & index()
The index of the current member of the iteration.
size_type _table_dof_ct
The number of table dofs defined by this schema.
virtual bool is_atom() const
True if this member covers the bottom.
Iterates over the subset of Zn defined by the characteristic function host().
friend SHEAF_DLL_SPEC size_t deep_size(const schema_poset_member &xp, bool xinclude_shallow)
The deep size of the referenced object of type schema_poset_member.
subposet_state * dof_subposet_state(bool xis_table_dof)
The subposet_state for the table/row dof subposet.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
static void make_schema_no_jims(namespace_poset *xns, const std::string &xposet_name, const std::string &xmember_name, const std::string &xparent_name)
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
virtual void detach_from_state()
Detach this handle from its state, if any.
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 ge(pod_index_type xother_index) const
True if this is greater than or equal to the member with index xother_index.
virtual bool initialize_row_dof_id_space() const
Initialize row dof id space. Return true, if and only if the row dof id space was created...
Basic description of a dof.
void remove_reference()
Remove a reference from this.
virtual void update_table_dof_id_space() const
Update the table dof id space.
virtual void update_table_cache() const
Updates cached table properties.
bool is_table_dof() const
True if this is in the table_dofs part of some schema. Synonym for is_dof(true).
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).
virtual bool is_schematized(bool xauto_access) const
True if this poset has been prepared for use as a schema, that is, if the top member has been schemat...
bool invariant_check() const
True if invariant checking is enabled.
Iterates in postorder over dofs of a schema member anchor. Attaches a handle of type schema_poset_mem...
size_t dof_tuple_ub(bool xis_table_dof) const
The size in bytes of the table dof tuple (xis_table_dof true) or the row dof tuple defined by this sc...
static poset_path make_schema(const namespace_poset &xns, const poset_path &xparent_path, const std::string &xname)
Creates a schema member with name xname which is join-equivalent the schema with path xparent_path...
bool contains_dof(const schema_poset_member &xother, bool xin_table_dofs) const
True if xother is a dof in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_...
virtual void attach_handle_data_members()
Initializes _table_dof_subset_index and _row_dof_subposet_index;.
virtual void get_ext_ids(const std::string &xid_space_name, pod_index_type &xschema_poset_ext_id, pod_index_type &xschema_member_ext_id, pod_index_type &xbase_space_ext_id, pod_index_type &xfiber_schema_ext_id, pod_index_type &xlocal_schema_ext_id) const
Gets the external ids of this in the id space with name xid_space_name.
virtual poset_dof_iterator * dof_iterator(bool xis_table_dofs, int xversion=CURRENT_MEMBER_VERSION) const
A postorder iterator over the table (xis_table_dofs == true) or row (xis_table_dofs == false) dofs de...
void update_dof_id_space(bool xis_table_dof) const
Update the ids in the dof id space. If xis_table_dof, otherwise initialize table dof id space...
int_type pod_index_type
The plain old data index type.
std::string member_name() const
The member name part of the path.
virtual primitives_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) ...
void add_reference()
Add a reference to this.
primitive_type id() const
The id for the primitive type associated with this.
size_t align(const size_t xoffset, const size_t xalignment)
Smallest offset greater than or equal to xoffset that has alignment xalignment.
A handle for a scattered_insertion_index_space_state.
const scoped_index & row_dof_subposet_index() const
The index in host() of the subposet containing the the row dofs in the down set of this (const versio...
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
dof_descriptor_array * _table_dof_descriptors
The dof_descriptors_array for the table dof tuple defined by this schema.
static array_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, bool xis_persistent, size_type xcapacity)
Create a new array id space in the id space family xid_spaces at the next available id space index wi...
size_type _table_dof_tuple_ub
The size in bytes of the table dof tuple defined by this schema.
static std::string dof_subposet_name(const std::string &xname, bool xis_table_dof)
The standard name for the table (xis_table_dof true) or row (xis_table_dof false) dof subposet associ...
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
pod_index_type lb_id() const
The index of the lower bound member, if the lower bound contains a single member. ...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
dof_descriptor_array * row_dof_descriptors() const
The dof_descriptors_array for the row dof tuple defined by this schema. Synonym for dof_descriptors(f...
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.
scoped_index _row_dof_subposet_index
The index within host of the row dofs subposet associated with this.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual size_type offset(pod_index_type xdof_id, bool xis_table_dof) const
The offset for the table dof (xis_table_dof true) or row dof referred to by xdof_id in the schema def...
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) ...
Factory and container for a family of id spaces.
virtual pod_index_type subposet_id(const std::string &xname) const
The hub id of the subposet with name xname.
scoped_index _table_dof_subposet_index
The index within host of the table dofs subposet associated with this.
virtual void new_jem_state(abstract_poset_member *xother, bool xgreatest, bool xauto_access)
Creates a new jrm state in host() which is the greatest jem (xgreatest true) or least jem (xgreatest ...
bool row_conforms_to(const schema_poset_member &xother) const
True if the row dofs defined by this agree in type and in order with the dofs defined by xother...
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
const scoped_index & dof_subposet_index(bool xis_table_dof) const
The index in host() of the subposet containing the the table dofs (xis_table_dof true) or row dofs in...
virtual void update_row_dof_descriptors() const
Update the row dof descriptors.
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.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
void enable_invariant_check() const
Enable invariant checking.
size_t size() const
Get size dof.
bool is_factor() const
True if this represents a factor in the row dofs part of some schema.
static void make_row_dofs_schema(namespace_poset *xns, const std::string member_names[], const int num_members, const int member_dof_type, const std::string &schema_poset_name, const std::string &schema_member_name, const std::string &schema_inherits_name)
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 bool dof_map_is_ancestor_of(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (is derived from) the type of dof map required by this handle...
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
A client handle for a poset member which has been prepared for use as a schema.
virtual bool is_dof(bool xin_table_dofs) const
True if this is in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_table_do...
virtual schema_poset_member & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
scoped_index _table_cache_index
The index with respect to which the cached table properties were evaluated.
Whitespace-separated-value block; A block of objects of type T that can be conveniently initialized b...
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...
schema_poset_member()
Default constructor; creates a new, unattached schema_poset_member handle.
bool dof_tuple_is_homogeneous(bool xis_table_dof) const
True if all the table dofs (xis_table_dof == true) or all the row dofs (xis_table_dof == false) defin...
virtual void new_jrm_state(bool xauto_access=true)
Creates a new jrm (join-reducible member) state in host() and attaches this to it.
void update_dof_descriptors(bool xis_table_dof, dof_descriptor_array *&xdof_descriptors, size_type xdof_ct, size_type &xdof_tuple_ub) const
Update the dof descriptors. If xis_table_dof, otherwise initialize table dof id space. Otherwise, initialize the row dof id space.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
bool is_row_dof() const
True if this is in in the row_dofs part of some schema. Synonym for is_dof(false).
bool has_version(int xversion) const
True if xversion is a valid version for this.
void force(int i, bool value)
Sets the i-th member to value, extends the upper bound if necessary.
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.