20 #include "SheafSystem/primitives_poset_dof_map.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/dof_map_factory.h" 24 #include "SheafSystem/primitive_traits.h" 25 #include "SheafSystem/primitives_poset.h" 26 #include "SheafSystem/primitives_poset_schema.h" 27 #include "SheafSystem/std_string.h" 41 const string& result = static_class_name();
45 ensure(!result.empty());
60 static const string result(
"primitives_poset_dof_map");
64 ensure(!result.empty());
65 ensure(result ==
"primitives_poset_dof_map");
87 _dofs.index = NOT_A_PRIMITIVE_TYPE;
92 ensure(!is_initialized());
97 ensure(!is_table_dof_map());
100 ensure(ref_ct() == 0);
206 _dofs = xother._dofs;
336 ensure(
host() == xhost);
338 ensure(
index().same_scope(
host()->dof_tuple_hub_id_space(
false)));
360 require(xhost->
schema().
index() == xschema_mbr_id);
395 ensure(
host() == xhost);
397 ensure(
index().same_scope(
host()->dof_tuple_hub_id_space(
false)));
421 require(
schema().state_is_read_accessible());
423 require(unexecutable(
"xdof points to buffer of size xdof_size"));
442 post_fatal_error_message(
"invalid xdof_id in call to primitives_poset_dof_map::get_dof");
447 ensure(unexecutable(xdof holds dofs referred to by xdof_id and xis_poset_id));
460 require(
schema().state_is_read_accessible());
462 require(unexecutable(
"xdof points to buffer of size xdof_size"));
482 post_fatal_error_message(
"invalid xdof_id in call to primitives_poset_dof_map::put_dof");
487 ensure(unexecutable(_dofs holds dofs referred to by xdof_id and xis_poset_id));
547 require(unexecutable(xbuf points to buffer of
size xbuflen));
549 require(unexecutable(
"xbuf id properly aligned for primitive_descriptor"));
557 ensure(unexecutable(
dof tuple copied to xbuf));
572 require(unexecutable(xbuf points to buffer of
size xbuflen));
574 require(unexecutable(
"xbuf id properly aligned for primitive_descriptor"));
582 ensure(unexecutable(xbuf copied to
dof tuple));
608 ensure(
size() == xsize);
619 return _dofs.alignment;
630 _dofs.alignment = xalignment;
660 ensure(
type() == xtype);
693 ensure(
host() == xhost);
701 sheaf::primitives_poset_dof_map::
poset_state_handle * host() const
The poset which this is a handle to a component of.
bool is_table_dof_map() const
True if this is a table dof map.
static primitive_descriptor descriptor(pod_index_type xid)
Primitive descriptor for the primitive type with id xid.
const int PRIMITIVES_SCHEMA_DOF_CT
Number of dofs defined by primitives schema.
void put_alignment(size_t xalignment)
Put alignment dof.
virtual poset_state * state_obj() const
State object for this poset.
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_type(int xindex)
Put type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited...
virtual schema_poset_member & schema()
The schema on which this is allocated (mutable version).
primitive_value dof(pod_index_type xdof_id) const
The dof referred to by xdof_id.
unsigned int _ref_ct
The number of references to this map /.
A client handle for a general, abstract partially order set.
virtual void * dof_tuple()
The dof tuple (mutable version).
schema_poset_member & schema()
Schema (mutable version)
bool _is_table_dof_map
True if this is a table dof map.
bool is_initialized() const
True if this has been initialized, that is, if the schema has been set and the dof map storage alloca...
virtual bool invariant() const
The class invariant.
virtual void put_host(const poset_state_handle *xhost)
Sets host() to xhost.
virtual void get_dof(pod_index_type xdof_id, void *xdof, size_type xdof_size) const
Copies the dof referred to by xdof_id into xdof.
virtual int version() const
The current version.
void invalidate()
Make this id invalid.
const scoped_index & index() const
The index of the component state this handle is attached to.
The general, abstract map from dof ids to dof values.
primitives_poset_dof_map()
Default constructor;.
poset_table_state * table() const
Table (dof tuples).
virtual primitives_poset_dof_map * clone() const
Virtual default constructor.
const hub_index_space_handle & dof_tuple_hub_id_space(bool xauto_access) const
The dof tuple hub id space.
size_t _dof_tuple_ub
The size of the dof tuple.
static const std::string & static_class_name()
The name of this class.
static dof_map_factory & factory()
The dof map factory.
void put_scope(const index_space_handle &xid_space)
Sets the scope to xid_space.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
primitives_poset_dof_map & operator=(const primitives_poset_dof_map &xother)
Assignment operator.
primitive_type
Type ids for sheaf primitives.
primitive_type type() const
Get type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited...
virtual bool invariant() const
The class invariant.
A map from schema poset member ids to dof values for primitives_poset members.
size_t dof_tuple_ub() const
The size of the dof tuple in bytes.
virtual void get_dof_tuple(void *xbuf, size_t xbuflen) const
Copies the entire dof tuple from internal storage into xbuf.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual ~primitives_poset_dof_map()
Destructor.
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
scoped_index _index
The poset member for which this stores the dofs.
virtual void init_row_dof_map(const poset_state_handle *xhost, pod_index_type xschema_mbr_id, int xschema_version)
Initializes this as a map for row dofs in host xhost, with schema member specified by xschema_mbr_id ...
dof_tuple_type
Identifiers for dof tuple types.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
size_t alignment() const
Get alignment dof.
virtual void put_dof(pod_index_type xdof_id, const void *xdof, size_type xdof_size)
Sets the dof referred to by xdof_id to the value at xdof.
Traits for primitive type T.
int _dof_ct
The number of dofs in this map.
int dof_ct() const
The number of dofs in this map.
virtual poset_state_handle * host() const
The poset which owns this.
bool invariant_check() const
True if invariant checking is enabled.
schema_poset_member * _schema
The schema on which this is instantiated.
int_type pod_index_type
The plain old data index type.
primitive_type id() const
The id for the primitive type associated with this.
void put_size(size_t xsize)
Put size dof.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple from xbuf into internal storage.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
poset_state_handle * _host
The host of the poset member for which this stores the dofs.
void insert_prototype(const poset_dof_map *xprototype)
Sets xprototype as the prototype for its client class.
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.
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.
size_t size() const
Get size dof.
virtual primitives_poset_dof_map * copy() const
Virtual copy constructor.
unsigned int ref_ct() const
The number of references to this map.
const scoped_index & index() const
The index of this in host() dof tuple table.