SheafSystem  0.0.0.0
sheaf::poset_bounds_descriptor Class Reference

A description of a (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation. More...

#include <poset_bounds_descriptor.h>

Inheritance diagram for sheaf::poset_bounds_descriptor:
sheaf::any

Public Types

enum  specification_mode {
  MEMBER_MEMBER, MEMBER_SUBPOSET, SUBPOSET_MEMBER, SUBPOSET_SUBPOSET,
  NOT_A_MODE
}
 Enumeration for mode of specifying the lower and upper bounds. More...
 

Public Member Functions

 poset_bounds_descriptor (const poset_bounds_descriptor &xother)
 Copy constructor. More...
 
poset_bounds_descriptoroperator= (const poset_bounds_descriptor &xother)
 Assignment operator. More...
 
bool operator== (const poset_bounds_descriptor &xother) const
 Comparison operator. More...
 
virtual poset_bounds_descriptorclone () const
 Virtual constructor; makes a new instance of the same type as this. More...
 
virtual ~poset_bounds_descriptor ()
 Destructor. More...
 
virtual bool invariant () const
 Class invariant. More...
 
virtual bool is_ancestor_of (const any *other) const
 Conformance test; true if other conforms to this. More...
 
 poset_bounds_descriptor (specification_mode xmode, pod_index_type xlb_id, pod_index_type xub_id)
 Constructs an instance with mode() xmode, lb_id() xlbid, and ub_id() xub_id. More...
 
 poset_bounds_descriptor (specification_mode xmode, const scoped_index &xlb_id, const scoped_index &xub_id)
 Constructs an instance with mode() xmode, lb_id() xlbid, and ub_id() xub_id. More...
 
specification_mode mode () const
 Specification mode for this. More...
 
bool lb_is_member () const
 True if mode == MEMBER_MEMBER or MEMBER_SUBPOSET. More...
 
bool ub_is_member () const
 True if mode == MEMBER_MEMBER or SUBPOSET_MEMBER. More...
 
pod_index_type lb_id () const
 The index of the lower bound. More...
 
void put_lb_id (pod_index_type xlb_id)
 Sets the index of the lower bound to xlb_id. More...
 
void put_lb_id (const scoped_index &xlb_id)
 Sets the index of the lower bound to xlb_id. More...
 
pod_index_type ub_id () const
 The index of the upper bound member, if the upper bound contains a single member. More...
 
void put_ub_id (pod_index_type xub_id)
 Sets the index of the upper bound to xub_id. More...
 
void put_ub_id (const scoped_index &xub_id)
 Sets the index of the upper bound to xub_id. More...
 
bool lb_is_valid_for (const poset_state_handle &xposet) const
 True if the lower bound member or subposet mentioned in this descriptor exists in xposet. More...
 
bool ub_is_valid_for (const poset_state_handle &xposet) const
 True if the upper bound member or subposet mentioned in this descriptor exists in xposet. More...
 
bool is_valid_for (const poset_state_handle &xposet) const
 True if the members and/or subposets mentioned in this descriptor exist in xposet. More...
 
bool lb_member_is_bottom () const
 True if lb_is_member() and lb_id() is sheaf_constants::BOTTOM_INDEX. More...
 
bool ub_member_is_not_top () const
 True if ub_is_member() and ub_id() is not sheaf_constants::TOP_INDEX. More...
 
- Public Member Functions inherited from sheaf::any
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 int mode_to_int (specification_mode xmode)
 Converts mode xmode to an int. More...
 
static specification_mode int_to_mode (int xmode)
 Converts int xmode to a mode. More...
 

Static Public Attributes

static const poset_bounds_descriptorBOTTOM_TOP = *(new poset_bounds_descriptor(MEMBER_MEMBER, BOTTOM_INDEX, TOP_INDEX))
 An instance with lb() == {bottom} and ub() == {top}. More...
 
static const poset_bounds_descriptorBOTTOM_BOTTOM = *(new poset_bounds_descriptor(MEMBER_MEMBER, BOTTOM_INDEX, BOTTOM_INDEX))
 An instance with lb() == {bottom} and ub() == {bottom}. More...
 

Protected Member Functions

 poset_bounds_descriptor ()
 Default constructor. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Friends

class poset_bounds
 

Detailed Description

A description of a (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation.

Definition at line 48 of file poset_bounds_descriptor.h.

Member Enumeration Documentation

◆ specification_mode

Enumeration for mode of specifying the lower and upper bounds.

Definition at line 99 of file poset_bounds_descriptor.h.

Constructor & Destructor Documentation

◆ poset_bounds_descriptor() [1/4]

sheaf::poset_bounds_descriptor::poset_bounds_descriptor ( const poset_bounds_descriptor xother)

Copy constructor.

Postcondition
  • *this == xother

Definition at line 52 of file poset_bounds_descriptor.cc.

References invariant(), and operator=().

◆ ~poset_bounds_descriptor()

sheaf::poset_bounds_descriptor::~poset_bounds_descriptor ( )
virtual

Destructor.

Definition at line 136 of file poset_bounds_descriptor.cc.

References invariant().

Referenced by clone().

◆ poset_bounds_descriptor() [2/4]

sheaf::poset_bounds_descriptor::poset_bounds_descriptor ( specification_mode  xmode,
pod_index_type  xlb_id,
pod_index_type  xub_id 
)

Constructs an instance with mode() xmode, lb_id() xlbid, and ub_id() xub_id.

Postcondition

Definition at line 285 of file poset_bounds_descriptor.cc.

References invariant(), lb_id(), mode(), poset_bounds_descriptor(), and ub_id().

◆ poset_bounds_descriptor() [3/4]

sheaf::poset_bounds_descriptor::poset_bounds_descriptor ( specification_mode  xmode,
const scoped_index xlb_id,
const scoped_index xub_id 
)

Constructs an instance with mode() xmode, lb_id() xlbid, and ub_id() xub_id.

Postcondition

Definition at line 309 of file poset_bounds_descriptor.cc.

References sheaf::scoped_index::hub_pod(), invariant(), lb_id(), mode(), and ub_id().

◆ poset_bounds_descriptor() [4/4]

sheaf::poset_bounds_descriptor::poset_bounds_descriptor ( )
protected

Default constructor.

Postcondition

Definition at line 29 of file poset_bounds_descriptor.cc.

References sheaf::invalid_pod_index(), invariant(), sheaf::is_valid(), lb_id(), mode(), and ub_id().

Referenced by clone(), int_to_mode(), poset_bounds_descriptor(), and ub_member_is_not_top().

Member Function Documentation

◆ clone()

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

Virtual constructor; makes a new instance of the same type as this.

Postcondition
  • result != 0
  • is_same_type(result)

Reimplemented from sheaf::any.

Definition at line 115 of file poset_bounds_descriptor.cc.

References sheaf::any::is_same_type(), poset_bounds_descriptor(), and ~poset_bounds_descriptor().

Referenced by operator==().

◆ int_to_mode()

sheaf::poset_bounds_descriptor::specification_mode sheaf::poset_bounds_descriptor::int_to_mode ( int  xmode)
static

Converts int xmode to a mode.

Precondition
  • (0 <= xmode) && (xmode <= 3)

Definition at line 251 of file poset_bounds_descriptor.cc.

References poset_bounds_descriptor().

Referenced by mode_to_int(), and sheaf::dof_tuple_col_bounds_record::transfer_internal_buffer_to_poset().

◆ invariant()

bool sheaf::poset_bounds_descriptor::invariant ( ) const
virtual

◆ is_ancestor_of()

bool sheaf::poset_bounds_descriptor::is_ancestor_of ( const any other) const
virtual

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::any.

Definition at line 188 of file poset_bounds_descriptor.cc.

References mode_to_int().

Referenced by invariant().

◆ is_valid_for()

bool sheaf::poset_bounds_descriptor::is_valid_for ( const poset_state_handle xposet) const

True if the members and/or subposets mentioned in this descriptor exist in xposet.

Precondition
  • xposet.state_is_read_accessible()
Postcondition
  • result == (lb_is_valid_for(xposet) && ub_is_valid_for(xposet))

Definition at line 559 of file poset_bounds_descriptor.cc.

References lb_is_valid_for(), lb_member_is_bottom(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and ub_is_valid_for().

Referenced by ub_is_valid_for().

◆ lb_id()

◆ lb_is_member()

bool sheaf::poset_bounds_descriptor::lb_is_member ( ) const

True if mode == MEMBER_MEMBER or MEMBER_SUBPOSET.

Postcondition
  • result == ((mode() == MEMBER_MEMBER) || (mode() == MEMBER_SUBPOSET))

Definition at line 356 of file poset_bounds_descriptor.cc.

References mode(), and ub_is_member().

Referenced by lb_is_valid_for(), lb_member_is_bottom(), mode(), sheaf::dof_tuple_col_bounds_record::transfer_poset_to_internal_buffer(), and sheaf::poset_scaffold::translate_dof_tuple_col_bounds().

◆ lb_is_valid_for()

bool sheaf::poset_bounds_descriptor::lb_is_valid_for ( const poset_state_handle xposet) const

True if the lower bound member or subposet mentioned in this descriptor exists in xposet.

Precondition
  • xposet.state_is_read_accessible()
Postcondition
  • !lb_is_member() ? (lb_id() == TOC_INDEX) || xposet.includes_subposet(lb_id()) : true

Definition at line 492 of file poset_bounds_descriptor.cc.

References sheaf::poset_state_handle::contains_member(), sheaf::poset_state_handle::includes_subposet(), lb_id(), lb_is_member(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and ub_is_valid_for().

Referenced by sheaf::poset_state_handle::bound_contains_member(), is_valid_for(), and put_ub_id().

◆ lb_member_is_bottom()

bool sheaf::poset_bounds_descriptor::lb_member_is_bottom ( ) const

True if lb_is_member() and lb_id() is sheaf_constants::BOTTOM_INDEX.

Postcondition

Definition at line 585 of file poset_bounds_descriptor.cc.

References lb_id(), lb_is_member(), and ub_member_is_not_top().

Referenced by is_valid_for().

◆ mode()

◆ mode_to_int()

int sheaf::poset_bounds_descriptor::mode_to_int ( specification_mode  xmode)
static

Converts mode xmode to an int.

Issue:
The C++ standard says this map is unnecessary. But we've implemented anyway, just in case not all compilers follow the standard.

Definition at line 211 of file poset_bounds_descriptor.cc.

References int_to_mode().

Referenced by is_ancestor_of(), and sheaf::dof_tuple_col_bounds_record::transfer_poset_to_internal_buffer().

◆ operator=()

sheaf::poset_bounds_descriptor & sheaf::poset_bounds_descriptor::operator= ( const poset_bounds_descriptor xother)

Assignment operator.

Postcondition
  • *this == xother

Definition at line 68 of file poset_bounds_descriptor.cc.

References invariant(), and operator==().

Referenced by poset_bounds_descriptor().

◆ operator==()

bool sheaf::poset_bounds_descriptor::operator== ( const poset_bounds_descriptor xother) const

Comparison operator.

Postcondition

Definition at line 91 of file poset_bounds_descriptor.cc.

References clone(), and invariant().

Referenced by operator=().

◆ put_lb_id() [1/2]

void sheaf::poset_bounds_descriptor::put_lb_id ( pod_index_type  xlb_id)

Sets the index of the lower bound to xlb_id.

Postcondition

Definition at line 409 of file poset_bounds_descriptor.cc.

References lb_id().

Referenced by lb_id(), sheaf::poset_bounds::put_lb_id(), sheaf::dof_tuple_col_bounds_record::transfer_poset_to_internal_buffer(), and sheaf::poset_scaffold::translate_dof_tuple_col_bounds().

◆ put_lb_id() [2/2]

void sheaf::poset_bounds_descriptor::put_lb_id ( const scoped_index xlb_id)

Sets the index of the lower bound to xlb_id.

Postcondition

Definition at line 428 of file poset_bounds_descriptor.cc.

References sheaf::scoped_index::hub_pod(), lb_id(), and ub_id().

◆ put_ub_id() [1/2]

void sheaf::poset_bounds_descriptor::put_ub_id ( pod_index_type  xub_id)

Sets the index of the upper bound to xub_id.

Postcondition

Definition at line 454 of file poset_bounds_descriptor.cc.

References ub_id().

Referenced by sheaf::poset_bounds::put_ub_id(), sheaf::dof_tuple_col_bounds_record::transfer_poset_to_internal_buffer(), sheaf::poset_scaffold::translate_dof_tuple_col_bounds(), and ub_id().

◆ put_ub_id() [2/2]

void sheaf::poset_bounds_descriptor::put_ub_id ( const scoped_index xub_id)

Sets the index of the upper bound to xub_id.

Postcondition

Definition at line 473 of file poset_bounds_descriptor.cc.

References sheaf::scoped_index::hub_pod(), lb_is_valid_for(), and ub_id().

◆ ub_id()

◆ ub_is_member()

bool sheaf::poset_bounds_descriptor::ub_is_member ( ) const

True if mode == MEMBER_MEMBER or SUBPOSET_MEMBER.

Postcondition
  • result == ((mode() == MEMBER_MEMBER) || (mode() == SUBPOSET_MEMBER))

Definition at line 379 of file poset_bounds_descriptor.cc.

References lb_id(), and mode().

Referenced by lb_is_member(), sheaf::dof_tuple_col_bounds_record::transfer_poset_to_internal_buffer(), sheaf::poset_scaffold::translate_dof_tuple_col_bounds(), ub_is_valid_for(), and ub_member_is_not_top().

◆ ub_is_valid_for()

bool sheaf::poset_bounds_descriptor::ub_is_valid_for ( const poset_state_handle xposet) const

True if the upper bound member or subposet mentioned in this descriptor exists in xposet.

Precondition
  • xposet.state_is_read_accessible()
Postcondition
  • result == (ub_is_member() ? xposet.contains_member(ub_id()) : xposet.includes_subposet(ub_id()))

Definition at line 530 of file poset_bounds_descriptor.cc.

References sheaf::poset_state_handle::contains_member(), sheaf::poset_state_handle::includes_subposet(), is_valid_for(), sheaf::read_write_monitor_handle::state_is_read_accessible(), ub_id(), and ub_is_member().

Referenced by sheaf::poset_state_handle::bound_contains_member(), is_valid_for(), and lb_is_valid_for().

◆ ub_member_is_not_top()

bool sheaf::poset_bounds_descriptor::ub_member_is_not_top ( ) const

Member Data Documentation

◆ BOTTOM_BOTTOM

const sheaf::poset_bounds_descriptor & sheaf::poset_bounds_descriptor::BOTTOM_BOTTOM = *(new poset_bounds_descriptor(MEMBER_MEMBER, BOTTOM_INDEX, BOTTOM_INDEX))
static

An instance with lb() == {bottom} and ub() == {bottom}.

Definition at line 213 of file poset_bounds_descriptor.h.

Referenced by ub_member_is_not_top().

◆ BOTTOM_TOP

const sheaf::poset_bounds_descriptor & sheaf::poset_bounds_descriptor::BOTTOM_TOP = *(new poset_bounds_descriptor(MEMBER_MEMBER, BOTTOM_INDEX, TOP_INDEX))
static

An instance with lb() == {bottom} and ub() == {top}.

Definition at line 208 of file poset_bounds_descriptor.h.

Referenced by sheaf::poset_scaffold::poset_scaffold(), sheaf::storage_agent::transaction::transaction(), and ub_member_is_not_top().


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