SheafSystem  0.0.0.0
sheaf::primitives_poset_dof_map Class Reference

A map from schema poset member ids to dof values for primitives_poset members. More...

#include <primitives_poset_dof_map.h>

Inheritance diagram for sheaf::primitives_poset_dof_map:
sheaf::poset_dof_map sheaf::any

Public Member Functions

virtual const std::string & class_name () const
 The name of the actual (possibly derived) class of this instance. More...
 
 primitives_poset_dof_map ()
 Default constructor;. More...
 
virtual primitives_poset_dof_mapclone () const
 Virtual default constructor. More...
 
 primitives_poset_dof_map (const primitives_poset_dof_map &xother)
 Copy constructor. More...
 
virtual primitives_poset_dof_mapcopy () const
 Virtual copy constructor. More...
 
primitives_poset_dof_mapoperator= (const primitives_poset_dof_map &xother)
 Assignment operator. More...
 
virtual ~primitives_poset_dof_map ()
 Destructor. More...
 
virtual bool invariant () const
 The class invariant. More...
 
 primitives_poset_dof_map (const poset_state_handle *xhost, int xprimitive_index)
 Creates a dof map for the primitive with index xprimitive_index. More...
 
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 and schema version xschema_version. More...
 
virtual dof_tuple_type type_id () const
 An identifer for the type of dof tuple this is. More...
 
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. More...
 
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. More...
 
virtual void * dof_tuple ()
 The dof tuple (mutable version). More...
 
virtual const void * dof_tuple () const
 The dof tuple (const version). More...
 
virtual void get_dof_tuple (void *xbuf, size_t xbuflen) const
 Copies the entire dof tuple from internal storage into xbuf. More...
 
virtual void put_dof_tuple (const void *xbuf, size_t xbuflen)
 Copies the entire dof tuple from xbuf into internal storage. More...
 
size_t size () const
 Get size dof. More...
 
void put_size (size_t xsize)
 Put size dof. More...
 
size_t alignment () const
 Get alignment dof. More...
 
void put_alignment (size_t xalignment)
 Put alignment dof. More...
 
primitive_type type () const
 Get type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited from poset_dof_map. More...
 
void put_type (int xindex)
 Put type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited from poset_dof_map. More...
 
- Public Member Functions inherited from sheaf::poset_dof_map
poset_dof_mapoperator= (const poset_dof_map &xother)
 Assignment operator. More...
 
virtual ~poset_dof_map ()
 Destructor. More...
 
void init_row_dof_map (const poset_state_handle *xhost, const scoped_index &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 and schema version xschema_version. More...
 
bool is_initialized () const
 True if this has been initialized, that is, if the schema has been set and the dof map storage allocated. More...
 
virtual poset_state_handlehost () const
 The poset which owns this. More...
 
const scoped_indexindex () const
 The index of this in host() dof tuple table. More...
 
virtual schema_poset_memberschema ()
 The schema on which this is allocated (mutable version). More...
 
virtual const schema_poset_memberschema () const
 The schema on which this is allocated (const version). More...
 
bool is_table_dof_map () const
 True if this is a table dof map. More...
 
int dof_ct () const
 The number of dofs in this map. More...
 
primitive_value dof (pod_index_type xdof_id) const
 The dof referred to by xdof_id. More...
 
primitive_value dof (const scoped_index &xdof_id) const
 The dof referred to by xdof_id. More...
 
primitive_value dof (const std::string &xname) const
 The dof with name xname. More...
 
void put_dof (pod_index_type xdof_id, const primitive_value &xdof)
 Sets the dof referred to by xdof_id to xdof. More...
 
void put_dof (const scoped_index &xdof_id, const primitive_value &xdof)
 Sets the dof referred to by xdof_id to xdof. More...
 
void put_dof (const std::string &xname, const primitive_value &xdof)
 Sets the dof with name xname to xdof. More...
 
void get_dof (const scoped_index &xdof_id, void *xdof, size_type xdof_size) const
 Copies the dof referred to by xdof_id into xdof. More...
 
void put_dof (const scoped_index &xdof_id, const void *xdof, size_type xdof_size)
 Sets the dof referred to by xdof_id to the value at xdof. More...
 
size_t dof_tuple_ub () const
 The size of the dof tuple in bytes. More...
 
void get_dof_tuple (arg_list &xargs) const
 Copies the entire dof tuple from internal storage into xargs. More...
 
void put_dof_tuple (const arg_list &xargs)
 Copies the entire dof tuple from xargs into internal storage. More...
 
void copy_dof_tuple (const poset_dof_map &xother)
 Copies the dof tuple of xother into this. More...
 
virtual void put_defaults ()
 Sets all dofs to defualt values. More...
 
unsigned int ref_ct () const
 The number of references to this map. More...
 
void inc_ref_ct ()
 Increase the number of references to this map by one;. More...
 
void dec_ref_ct ()
 Decrease the number of references to this map by one. More...
 
int version () const
 The version of the host of the schema this is defined on. More...
 
virtual const index_space_handleclient_id_space () const
 The map from library ids to clients ids for the schema this is defined on. More...
 
std::string to_string (const schema_poset_member &xschema) const
 Return schema member dof value as a string. More...
 
std::string to_string () const
 Return dof values as a formated string. More...
 
virtual bool supports_xfr_opt () const
 True if this dof map type supports dof tuple transfer optimization. /. More...
 
- Public Member Functions inherited from sheaf::any
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
bool is_same_type (const any *other) const
 True if other is the same type as this. More...
 
virtual ~any ()
 Destructor. More...
 
bool invariant_check () const
 True if invariant checking is enabled. More...
 
void enable_invariant_check () const
 Enable invariant checking. More...
 
void disable_invariant_check () const
 Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More...
 
int disable_invariance_check_request_depth () const
 Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More...
 

Static Public Member Functions

static const std::string & static_class_name ()
 The name of this class. More...
 
- Static Public Member Functions inherited from sheaf::poset_dof_map
static const std::string & static_class_name ()
 The name of this class. More...
 
static poset_dof_mapnew_dof_map (const std::string &xclass_name, dof_tuple_type xsheaf_base_class_id)
 Creates an uninitialized dof map of type xclass_name, if a prototype of that name exists, otherwise of type xsheaf_base_class_id. More...
 

Protected Member Functions

virtual void put_host (const poset_state_handle *xhost)
 Sets host() to xhost. More...
 
virtual void allocate_dofs ()
 Allocates dof storage. More...
 
- Protected Member Functions inherited from sheaf::poset_dof_map
 poset_dof_map ()
 Default constructor;. More...
 
 poset_dof_map (const poset_dof_map &xother)
 Copy constructor. More...
 
 poset_dof_map (const poset_state_handle *xhost, bool xis_table_dof_map)
 Creates a map for the table dofs (xis_table_dofs true) or row dofs (xis_table dofs false) for use in host xhost. More...
 
 poset_dof_map (const schema_poset_member *xschema, bool xis_table_dof_map)
 Creates a map for the table dofs (xis_table_dofs true) or row dofs (xis_table dofs false) for use in host xhost. More...
 
void put_index (const scoped_index &xindex)
 Sets the index of the member for which this provides the dofs. More...
 
void put_dof_ct (int xdof_ct)
 Sets dof_ct() to xdof_ct. More...
 
void put_dof_tuple_ub (size_t xub)
 Sets dof_tuple_ub() to xub. More...
 
void put_ref_ct (int xref_ct)
 Sets ref_ct() to xref_ct). More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Friends

class namespace_poset
 

Additional Inherited Members

- Static Protected Member Functions inherited from sheaf::poset_dof_map
static dof_map_factoryfactory ()
 The dof map factory. More...
 
- Protected Attributes inherited from sheaf::poset_dof_map
poset_state_handle_host
 The host of the poset member for which this stores the dofs. More...
 
scoped_index _index
 The poset member for which this stores the dofs. More...
 
schema_poset_member_schema
 The schema on which this is instantiated. More...
 
bool _is_table_dof_map
 True if this is a table dof map. More...
 
int _dof_ct
 The number of dofs in this map. More...
 
size_t _dof_tuple_ub
 The size of the dof tuple. More...
 
unsigned int _ref_ct
 The number of references to this map /. More...
 

Detailed Description

A map from schema poset member ids to dof values for primitives_poset members.

Definition at line 45 of file primitives_poset_dof_map.h.

Constructor & Destructor Documentation

◆ primitives_poset_dof_map() [1/3]

sheaf::primitives_poset_dof_map::primitives_poset_dof_map ( )

Default constructor;.

Postcondition
  • !is_initialized()
  • !is_table_dof_map()

Definition at line 75 of file primitives_poset_dof_map.cc.

References clone(), sheaf::is_valid(), and sheaf::PRIMITIVES_SCHEMA_DOF_CT.

Referenced by clone(), copy(), invariant(), put_host(), and static_class_name().

◆ primitives_poset_dof_map() [2/3]

sheaf::primitives_poset_dof_map::primitives_poset_dof_map ( const primitives_poset_dof_map xother)

Copy constructor.

Precondition
  • xother.is_initialized()
Postcondition
  • schema().is_same_state(&xother.schema())

Definition at line 131 of file primitives_poset_dof_map.cc.

References copy(), sheaf::poset_dof_map::dof_ct(), sheaf::poset_dof_map::dof_tuple_ub(), sheaf::poset_dof_map::host(), sheaf::poset_dof_map::index(), invariant(), sheaf::poset_dof_map::is_initialized(), sheaf::poset_dof_map::is_table_dof_map(), sheaf::poset_dof_map::ref_ct(), and sheaf::poset_dof_map::schema().

◆ ~primitives_poset_dof_map()

sheaf::primitives_poset_dof_map::~primitives_poset_dof_map ( )
virtual

Destructor.

Definition at line 228 of file primitives_poset_dof_map.cc.

References sheaf::poset_dof_map::_schema, and invariant().

Referenced by operator=().

◆ primitives_poset_dof_map() [3/3]

Member Function Documentation

◆ alignment()

size_t sheaf::primitives_poset_dof_map::alignment ( ) const

Get alignment dof.

Definition at line 617 of file primitives_poset_dof_map.cc.

References put_alignment().

Referenced by sheaf::schema_poset_member::alignment(), put_alignment(), and put_size().

◆ allocate_dofs()

virtual void sheaf::primitives_poset_dof_map::allocate_dofs ( )
inlineprotectedvirtual

Allocates dof storage.

Implements sheaf::poset_dof_map.

Definition at line 211 of file primitives_poset_dof_map.h.

◆ class_name()

const std::string & sheaf::primitives_poset_dof_map::class_name ( ) const
virtual

The name of the actual (possibly derived) class of this instance.

Postcondition
  • !result.empty()

Reimplemented from sheaf::poset_dof_map.

Definition at line 35 of file primitives_poset_dof_map.cc.

References static_class_name().

◆ clone()

sheaf::primitives_poset_dof_map * sheaf::primitives_poset_dof_map::clone ( ) const
virtual

Virtual default constructor.

Postcondition
  • result != 0
  • result->is_same_type(this)
  • postcondition_of(primitives_poset_dof_map())

Implements sheaf::poset_dof_map.

Definition at line 106 of file primitives_poset_dof_map.cc.

References sheaf::any::is_same_type(), and primitives_poset_dof_map().

Referenced by primitives_poset_dof_map().

◆ copy()

sheaf::primitives_poset_dof_map * sheaf::primitives_poset_dof_map::copy ( ) const
virtual

Virtual copy constructor.

Postcondition
  • result != 0
  • result->is_same_type(this)
  • postcondition_of(primitives_poset_dof_map(*this))

Implements sheaf::poset_dof_map.

Definition at line 158 of file primitives_poset_dof_map.cc.

References sheaf::any::is_same_type(), operator=(), and primitives_poset_dof_map().

Referenced by primitives_poset_dof_map().

◆ dof_tuple() [1/2]

void * sheaf::primitives_poset_dof_map::dof_tuple ( )
virtual

The dof tuple (mutable version).

Postcondition

Implements sheaf::poset_dof_map.

Definition at line 500 of file primitives_poset_dof_map.cc.

References invariant().

Referenced by put_dof().

◆ dof_tuple() [2/2]

const void * sheaf::primitives_poset_dof_map::dof_tuple ( ) const
virtual

The dof tuple (const version).

Postcondition

Implements sheaf::poset_dof_map.

Definition at line 521 of file primitives_poset_dof_map.cc.

References get_dof_tuple(), and invariant().

◆ get_dof()

void sheaf::primitives_poset_dof_map::get_dof ( pod_index_type  xdof_id,
void *  xdof,
size_type  xdof_size 
) const
virtual

Copies the dof referred to by xdof_id into xdof.

Precondition
  • schema().dof_id_space(is_table_dof_map()).contains(xdof_id)
  • -unexecutable( "xdof points to buffer of size xdof_size" )
Postcondition
  • -unexecutable( xdof holds dofs referred to by xdof_id and xis_poset_id )

Reimplemented from sheaf::poset_dof_map.

Definition at line 417 of file primitives_poset_dof_map.cc.

References sheaf::poset_dof_map::is_table_dof_map(), put_dof(), and sheaf::poset_dof_map::schema().

Referenced by init_row_dof_map().

◆ get_dof_tuple()

void sheaf::primitives_poset_dof_map::get_dof_tuple ( void *  xbuf,
size_t  xbuflen 
) const
virtual

Copies the entire dof tuple from internal storage into xbuf.

Precondition
  • xbuf != 0
  • -unexecutable( xbuf points to buffer of size xbuflen )
  • xbuflen >= sizeof(primitive_descriptor)
  • -unexecutable( "xbuf id properly aligned for primitive_descriptor" )
Postcondition
  • -unexecutable( dof tuple copied to xbuf )

Implements sheaf::poset_dof_map.

Definition at line 542 of file primitives_poset_dof_map.cc.

References sheaf::poset_dof_map::dof(), put_dof_tuple(), size(), and sheaf::tuple().

Referenced by dof_tuple().

◆ init_row_dof_map()

void sheaf::primitives_poset_dof_map::init_row_dof_map ( const poset_state_handle xhost,
pod_index_type  xschema_mbr_id,
int  xschema_version 
)
virtual

Initializes this as a map for row dofs in host xhost, with schema member specified by xschema_mbr_id and schema version xschema_version.

Precondition
  • xhost != 0
  • xhost->state_is_read_accessible()
Hack:
schema id and version ignored for this class.
Postcondition
  • !is_table_dof_map()

Reimplemented from sheaf::poset_dof_map.

Definition at line 351 of file primitives_poset_dof_map.cc.

References sheaf::poset_dof_map::_dof_ct, sheaf::poset_dof_map::_dof_tuple_ub, sheaf::poset_dof_map::_host, sheaf::poset_dof_map::_index, sheaf::poset_dof_map::_is_table_dof_map, sheaf::poset_dof_map::_ref_ct, sheaf::poset_dof_map::_schema, sheaf::poset_dof_map::dof_ct(), sheaf::poset_dof_map::dof_tuple_ub(), get_dof(), sheaf::poset_dof_map::host(), sheaf::poset_component::host(), sheaf::poset_dof_map::index(), sheaf::poset_component::index(), sheaf::scoped_index::invalidate(), invariant(), sheaf::poset_dof_map::is_initialized(), sheaf::poset_dof_map::is_table_dof_map(), sheaf::is_valid(), sheaf::PRIMITIVES_SCHEMA_DOF_CT, sheaf::scoped_index::put_scope(), sheaf::poset_table_state::schema(), sheaf::poset_state_handle::schema(), sheaf::read_write_monitor_handle::state_is_read_accessible(), sheaf::poset_state_handle::state_obj(), sheaf::poset_state::table(), and sheaf::poset_state_handle::version().

Referenced by primitives_poset_dof_map().

◆ invariant()

◆ operator=()

◆ put_alignment()

void sheaf::primitives_poset_dof_map::put_alignment ( size_t  xalignment)

Put alignment dof.

Postcondition

Definition at line 624 of file primitives_poset_dof_map.cc.

References alignment(), and type().

Referenced by alignment().

◆ put_dof()

void sheaf::primitives_poset_dof_map::put_dof ( pod_index_type  xdof_id,
const void *  xdof,
size_type  xdof_size 
)
virtual

Sets the dof referred to by xdof_id to the value at xdof.

Precondition
  • schema().dof_id_space(is_table_dof_map()).contains(xdof_id)
  • -unexecutable( "xdof points to buffer of size xdof_size" )
Postcondition
  • -unexecutable( _dofs holds dofs referred to by xdof_id and xis_poset_id )

Reimplemented from sheaf::poset_dof_map.

Definition at line 456 of file primitives_poset_dof_map.cc.

References dof_tuple(), sheaf::poset_dof_map::is_table_dof_map(), and sheaf::poset_dof_map::schema().

Referenced by get_dof().

◆ put_dof_tuple()

void sheaf::primitives_poset_dof_map::put_dof_tuple ( const void *  xbuf,
size_t  xbuflen 
)
virtual

Copies the entire dof tuple from xbuf into internal storage.

Precondition
  • xbuf != 0
  • -unexecutable( xbuf points to buffer of size xbuflen )
  • xbuflen >= sizeof(primitive_descriptor)
  • -unexecutable( "xbuf id properly aligned for primitive_descriptor" )
Postcondition
  • -unexecutable( xbuf copied to dof tuple )

Implements sheaf::poset_dof_map.

Definition at line 567 of file primitives_poset_dof_map.cc.

References sheaf::poset_dof_map::dof(), size(), and sheaf::tuple().

Referenced by get_dof_tuple().

◆ put_host()

◆ put_size()

void sheaf::primitives_poset_dof_map::put_size ( size_t  xsize)

Put size dof.

Postcondition

Definition at line 598 of file primitives_poset_dof_map.cc.

References alignment(), and size().

Referenced by size().

◆ put_type()

void sheaf::primitives_poset_dof_map::put_type ( int  xindex)

Put type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited from poset_dof_map.

Postcondition

Definition at line 650 of file primitives_poset_dof_map.cc.

References put_host(), and type().

Referenced by sheaf::schema_poset_member::new_jim_state(), and type().

◆ size()

size_t sheaf::primitives_poset_dof_map::size ( ) const

Get size dof.

Definition at line 591 of file primitives_poset_dof_map.cc.

References put_size().

Referenced by get_dof_tuple(), put_dof_tuple(), put_size(), and sheaf::schema_poset_member::size().

◆ static_class_name()

const std::string & sheaf::primitives_poset_dof_map::static_class_name ( )
static

The name of this class.

Postcondition
  • !result.empty()
  • result == "primitives_poset_dof_map"

Definition at line 54 of file primitives_poset_dof_map.cc.

References primitives_poset_dof_map().

Referenced by class_name().

◆ type()

sheaf::primitive_type sheaf::primitives_poset_dof_map::type ( ) const

Get type dof. Note: have to use "type" in name in order to avoid name conflict with index() inherited from poset_dof_map.

Definition at line 643 of file primitives_poset_dof_map.cc.

References sheaf::primitive_attributes::id(), and put_type().

Referenced by put_alignment(), put_type(), and sheaf::schema_poset_member::type().

◆ type_id()

virtual dof_tuple_type sheaf::primitives_poset_dof_map::type_id ( ) const
inlinevirtual

An identifer for the type of dof tuple this is.

Implements sheaf::poset_dof_map.

Definition at line 120 of file primitives_poset_dof_map.h.

References sheaf::poset_dof_map::get_dof(), and sheaf::poset_dof_map::put_dof().


The documentation for this class was generated from the following files: