21 #ifndef POSET_STATE_HANDLE_H 22 #define POSET_STATE_HANDLE_H 24 #ifndef SHEAF_DLL_SPEC_H 25 #include "SheafSystem/sheaf_dll_spec.h" 28 #ifndef ABSTRACT_POSET_MEMBER_H 29 #include "SheafSystem/abstract_poset_member.h" 33 #include "SheafSystem/pool.h" 36 #ifndef POSET_CRG_STATE_H 37 #include "SheafSystem/poset_crg_state.h" 40 #ifndef POSET_MEMBER_H 41 #include "SheafSystem/poset_member.h" 44 #ifndef POSET_POWERSET_STATE_H 45 #include "SheafSystem/poset_powerset_state.h" 49 #include "SheafSystem/poset_state.h" 52 #ifndef POSET_TABLE_STATE_H 53 #include "SheafSystem/poset_table_state.h" 56 #ifndef READ_WRITE_MONITOR_HANDLE_H 57 #include "SheafSystem/read_write_monitor_handle.h" 60 #ifndef SCHEMA_POSET_MEMBER_H 61 #include "SheafSystem/schema_poset_member.h" 64 #ifndef SCOPED_INDEX_H 65 #include "SheafSystem/scoped_index.h" 69 #include "SheafSystem/sheaf.h" 72 #ifndef STD_IOSTREAM_H 73 #include "SheafSystem/std_iostream.h" 77 #include "SheafSystem/std_string.h" 81 #include "SheafSystem/subposet.h" 84 #ifndef NAME_MULTIMAP_H 85 #include "SheafSystem/name_multimap.h" 92 template <
typename T>
class block;
93 template <
typename T>
class depth_first_itr;
94 class namespace_poset;
95 class primitives_poset;
96 class depth_first_iterator;
97 class index_equivalence_iterator;
99 class implict_crg_interval;
100 class index_iterator;
101 class namespace_poset_member;
103 class poset_component;
105 class poset_handle_factory;
106 class subposet_names_record;
108 class subposet_state;
117 std::ostream &
operator << (std::ostream &os,
const poset_state_handle& p);
129 size_t deep_size(
const poset_state_handle& xp,
130 bool xinclude_shallow =
true,
131 size_t xresults[4] = 0);
140 friend class block_poset_builder;
156 friend class subposet_joiner;
178 new_poset_handle(
const std::string& xclass_name,
poset_type xsheaf_base_class_id);
233 virtual const char* class_name()
const;
247 virtual void begin_jim_edit_mode(
bool xauto_access =
true);
252 virtual void end_jim_edit_mode(
bool xensure_lattice_invariant =
true,
253 bool xauto_access =
true);
258 bool in_jim_edit_mode()
const;
264 int jim_edit_depth(
bool xauto_access)
const;
272 bool is_external()
const;
277 virtual void get_read_access()
const;
285 virtual void get_read_write_access(
bool xrelease_read_only_access =
false);
291 virtual void release_access(
bool xall =
false)
const;
296 virtual bool is_attached()
const;
339 virtual void attach_to_state(
const namespace_poset* xhost,
const std::string& xname);
349 virtual void detach_from_state();
376 virtual void initialize_handle_data_members(
const namespace_poset& xns);
383 virtual void attach_handle_data_members();
388 void ensure_lattice_invariant();
394 virtual void terminate_access();
432 virtual std::string name()
const;
437 virtual std::string name(
bool xauto_access)
const;
442 virtual poset_path path(
bool xauto_access =
true)
const;
461 const std::string& xposet_name,
462 bool xauto_link =
true);
551 virtual pod_index_type new_member_interval(
const std::string& xinterval_type,
564 void new_member_interval(
const std::string& xinterval_type,
size_type xsize,
590 virtual int member_ct()
const;
596 virtual int standard_member_ct()
const;
602 bool has_standard_member_ct()
const;
619 virtual bool contains_member(
pod_index_type xmbr_hub_id,
bool xauto_access =
true)
const;
625 bool contains_member(
const scoped_index& xmbr_id,
bool xauto_access =
true)
const;
631 virtual bool contains_member(
pod_index_type xmbr_hub_id,
int xversion,
bool xauto_access =
true)
const;
637 bool contains_member(
const scoped_index& xmbr_id,
int xversion,
bool xauto_access =
true)
const;
642 virtual bool contains_member(
const std::string& xname,
bool xauto_access =
true)
const;
652 bool contains_members(
const scoped_index* xmbrs,
int xmbrs_ct,
bool xauto_access =
true)
const;
657 bool contains_members(
pod_index_type* xmbrs,
int xmbrs_ct,
bool xauto_access =
true)
const;
662 bool contains_members(
const std::string* xnames,
int xnames_ct,
bool xauto_access =
true)
const;
682 bool is_empty()
const;
689 virtual bool is_jim(
pod_index_type xmbr_hub_id,
bool xin_current_version =
true)
const;
696 bool is_jim(
const scoped_index& xmbr_id,
bool xin_current_version =
true)
const;
703 bool is_jim(
const std::string& xname,
bool xin_current_version =
true)
const;
752 return *(state_obj()->crg());
758 virtual void initialize_standard_members();
765 crg().put_standard_member_ct(xct);
773 table().put_standard_row_dof_tuple_ct(xct);
779 bool index_in_bounds(
const scoped_index& xmbr_id)
const;
840 const std::string& xinterval_type,
862 virtual std::string member_name(
pod_index_type xmbr_hub_id,
bool xauto_access =
false)
const;
867 std::string member_name(
const scoped_index& xmbr_id,
bool xauto_access =
false)
const;
874 bool xauto_access =
false)
const;
881 bool xauto_access =
false)
const;
897 const std::string& xname,
898 bool xauto_access =
false)
const;
904 const std::string& xname,
905 bool xauto_access =
false)
const;
912 const std::string& xname,
914 bool xauto_access =
false);
921 const std::string& xname,
923 bool xauto_access =
false);
928 void delete_member_name(
const std::string& xname,
bool xauto_access =
false);
934 bool xauto_access =
false);
939 void delete_all_member_names(
const scoped_index& xmbr_id,
940 bool xauto_access =
false);
952 member_name_map_type& member_name_map(
bool xrequire_write_access =
false);
985 virtual const scoped_index& member_id(
bool xauto_access)
const;
995 virtual pod_index_type member_id(
const std::string& xname,
bool xauto_access)
const;
1000 void member_id(
const std::string& xname,
scoped_index& result,
bool xauto_access)
const;
1007 void update_standard_member_id_spaces();
1012 void clear_member_id_spaces(
bool xauto_access);
1026 void extend_last_member_term(
size_type xct,
bool xauto_access);
1212 template <
typename handle_type>
1213 handle_type& get_cover_id_space(
bool xlower,
pod_index_type xmbr_index)
const;
1219 template<
typename handle_type>
1220 bool cover_id_space_handle_conforms_to(
bool xlower,
pod_index_type xmbr_index)
const;
1250 bool cover_contains_iterator(
bool xlower,
1259 bool cover_contains_iterator(
bool xlower,
1268 bool cover_is_empty(
bool xlower,
pod_index_type xmbr_hub_id)
const;
1275 bool cover_is_empty(
bool xlower,
const scoped_index& xmbr_id)
const;
1282 bool cover_is_singleton(
bool xlower,
pod_index_type xmbr_hub_id)
const;
1289 bool cover_is_singleton(
bool xlower,
const scoped_index& xmbr_id)
const;
1308 bool cover_contains_member(
bool xlower,
1317 bool cover_contains_member(
bool xlower,
1328 bool cover_is_equal(
bool xlower,
1339 bool cover_is_equal(
bool xlower,
1353 void first_cover_member(
bool xlower,
const scoped_index& xmbr_id,
1368 void insert_cover_member(
const scoped_index& xother_mbr_id,
1389 void insert_cover_member(
const scoped_index& xother_mbr_id,
1406 void remove_cover_member(
const scoped_index& xother_mbr_id,
1435 template <
typename filter_type>
1436 void remove_cover_members(
const filter_type& xfilter,
1445 template <
typename filter_type>
1446 void remove_cover_members(
const filter_type& xfilter,
1455 void replace_cover_member(
const scoped_index& xold_other_mbr_hub_id,
1479 void clear_cover(
bool xlower,
const scoped_index& xmbr_id);
1486 void copy_cover(
bool xlower,
1495 void copy_cover(
bool xlower,
1512 void append_upper_cover_of_bottom(
const scoped_index& xmbr_begin,
1546 virtual int standard_subposet_ct()
const;
1552 bool has_standard_subposet_ct()
const;
1562 virtual pod_index_type subposet_id(
const std::string& xname)
const;
1567 virtual void subposet_id(
const std::string& xname,
scoped_index& result)
const;
1584 bool xauto_access =
true)
const;
1589 bool includes_subposet(
const scoped_index& xsubposet_id,
1590 bool xauto_access =
true)
const;
1595 bool includes_subposet(
const std::string& xname,
bool xauto_access =
true)
const;
1600 bool includes_subposet(
const subposet* xs,
bool xauto_access =
true)
const;
1620 void new_subposet(
bool xinitialize,
scoped_index& result);
1642 void delete_subposet(
const scoped_index& xsubposet_id);
1647 virtual const subposet& whole()
const;
1657 virtual const subposet& jims()
const;
1667 const subposet& table_dof_subposet()
const;
1677 const subposet& row_dof_subposet()
const;
1682 static const std::string& coarsest_common_refinement_name();
1699 virtual const subposet& resident()
const;
1709 virtual void initialize_standard_subposets(
const std::string& xname);
1714 void put_standard_subposet_ct(
int xct);
1730 virtual std::string subposet_name(
pod_index_type xsubposet_hub_id,
bool xauto_access =
false)
const;
1735 std::string subposet_name(
const scoped_index& xsubposet_id,
bool xauto_access =
false)
const;
1742 bool xauto_access =
false)
const;
1747 void all_subposet_names(
const scoped_index& xsubposet_id,
1749 bool xauto_access =
false)
const;
1764 bool subposet_has_name(
pod_index_type xsubposet_hub_id,
const std::string& xname,
bool xauto_access =
false)
const;
1769 bool subposet_has_name(
const scoped_index& xsubposet_id,
const std::string& xname,
bool xauto_access =
false)
const;
1776 const std::string& xname,
1784 void put_subposet_name(
const scoped_index& xsubposet_id,
1785 const std::string& xname,
1792 void delete_subposet_name(
const std::string& xname,
bool xauto_access =
false);
1798 bool xauto_access =
false);
1803 void delete_all_subposet_names(
const scoped_index& xsubposet_id,
1804 bool xauto_access =
false);
1840 virtual const scoped_index& subposet_id(
bool xauto_access)
const;
1895 bool schema_is(
const std::string& xschema_name)
const;
1925 virtual bool table_dof_map_conforms(
const poset_dof_map* xdof_map)
const;
1931 virtual bool row_dof_map_conforms(
const poset_dof_map* xdof_map)
const;
1941 virtual const array_poset_dof_map& table_dof_map(
bool xrequire_write_access =
false)
const;
1947 void table_dof_tuple(
void* xbuf,
size_t xbuflen)
const;
1967 const void*
table_dofs(
bool xauto_access)
const;
1979 void initialize_table_dofs(
void* xtable_dofs,
size_t xtable_dof_ub);
2002 bool xrequire_write_access =
false)
const;
2009 bool xrequire_write_access =
false)
const;
2047 void member_dof_tuple(
pod_index_type xmbr_hub_id,
void* xbuf,
size_t xbuf_len,
bool xauto_access)
const;
2053 void put_member_dof_tuple(
pod_index_type xmbr_hub_id,
void* xbuf,
size_t xbuf_len,
bool xauto_access);
2077 void put_member_dof_tuple_id(
const scoped_index& xmbr_id,
2089 bool contains_row_dof_tuple(
const scoped_index& xtuple_id)
const;
2100 int standard_row_dof_tuple_ct()
const;
2106 bool has_standard_row_dof_tuple_ct()
const;
2141 virtual const scoped_index& dof_tuple_id(
bool xauto_access)
const;
2166 virtual bool is_schematized(
bool xauto_access)
const;
2172 virtual void schematize(
subposet* xtable_dof_subposet,
2174 bool xall_members =
false);
2181 void initialize_dof_id_space(
subposet& xdof_subposet);
2198 virtual int version_ct()
const;
2203 virtual int version()
const;
2213 void version_index(
int xversion,
scoped_index& result)
const;
2223 void version_jims_index(
int xversion,
scoped_index& result)
const;
2228 bool has_version(
int xversion)
const;
2233 bool is_version()
const;
2240 static const std::string& VERSION_PREFIX();
2245 static int VERSION_PREFIX_LENGTH();
2250 bool is_version_name(
const std::string& xname)
const;
2255 std::string version_to_name(
int xversion)
const;
2260 int version_from_name(
const std::string& xname)
const;
2265 void put_version(
int xversion);
2304 new_schema_handle(
const std::string& xid_space_name,
2333 bool bound_contains_member(
const poset_bounds& xbounds,
2342 const std::string& xid_space_name,
2343 bool xauto_access)
const;
2350 const std::string& xid_space_name,
2351 bool xauto_access)
const;
2358 const std::string& xid_space_name,
2359 bool xauto_access)
const;
2366 const std::string& xid_space_name,
2367 bool xauto_access)
const;
2374 const std::string& xid_space_name,
2375 bool xauto_access)
const;
2399 void to_stream(std::ostream& xos = std::cout);
2404 std::string to_string();
2423 virtual bool is_ancestor_of(
const any* other)
const;
2434 virtual bool invariant()
const;
2452 #endif // POSET_STATE_HANDLE_H SHEAF_DLL_SPEC void lower(const met &xmetric, const ed &xvector, ed &xresult, bool xauto_access)
Lower vector (pre-allocated version for persistent type).
A client handle for a subposet.
The data structure representing the cover relation graph of a poset.
The private state of a partially ordered set.
An abstract iterator over the ids of an id space.
A wrapper/adapter for the table dof tuple record. Intended for transferring data between the kernel a...
poset_state_handle(const poset_state_handle &xother)
Copy constructor; disabled.
The default name space; a poset which contains other posets as members.
A factory for creating poset handles.
poset_type
Identifiers for poset types.
A handle for a hidden read_write_monitor state.
A client handle for a general, abstract partially order set.
A wrapper/adapter for the subposet names record. Intended for transferring subposet name data between...
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
void put_standard_row_dof_tuple_ct(int xct)
Sets the number of standard row dof tuples automatically allocated by the constructor.
A partial multi-valued relation with total injective inverse between names and indices of type index_...
abstract_poset_member * _top
Top member of poset.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
A (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation...
Features shared by poset_member and subposet. Subposet and poset_member objects can be attached...
namespace_poset * _name_space
The namespace this poset resides in.
The general, abstract map from dof ids to dof values.
An implementation of class sum_index_space_handle that has a primary sum id space state...
abstract_poset_member * _bottom
Bottom members of poset.
The poset containing the primitive type definitions.
Abstract base class with useful features for all objects.
A record_set containing records of type member_record.
A record buffer for transferring member data between the kernel and the i/o subsystem.
The general depth-first iterator over the intersection of a poset member anchor's whole with its down...
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
poset_crg_state::member_name_map_type member_name_map_type
The type of the member name map.
A map from schema poset member ids to dof values for primitives_poset members.
An index within the external ("client") scope of a given id space.
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.
subposet _resident
The subposet of members with resident dof tuples.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
void put_standard_member_ct(int xct)
Sets the number of standard members automatically allocated by the constructor.
scoped_index _index
The member index of this poset in the namespace.
A record_set which contains dof tuple records. Supports both record selection and record restriction ...
Iterates over the subset of Zn defined by the characteristic function host().
poset_state * _state
State object for this poset.
poset_crg_state & crg() const
The cover relation graph.
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
A poset specific collection of data converters, various buffers and other data used while transferrin...
poset_state_handle & operator=(const poset_state_handle &xother)
Assignment operator; disabled.
schema_poset_member schema_type
The type of schema member for this class.
An abstract client handle for a member of a poset.
Factory and container for a family of id spaces.
An array representation of abstract class poset_dof_map.
Computes the join of given poset members.
The set of subsets of a poset.
Traverser to compute intersection of the down set (up set) of the anchor with a given subposet...
A client handle for a poset member which has been prepared for use as a schema.
The data structure representing the table containing the dof tuples of the members of a poset...
Agent responsible for importing and exporting posets from an external name space which resides on dis...