SheafSystem  0.0.0.0
sheaf::array_index_space_interval Class Reference

An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids are stored in a two dimensional array. More...

#include <array_index_space_interval.h>

Inheritance diagram for sheaf::array_index_space_interval:
sheaf::index_space_interval sheaf::index_space_collection sheaf::any

Public Member Functions

virtual const std::string & class_name () const
 The name of this class. More...
 
virtual array_index_space_intervalclone () const
 Virtual constructor; create a new instance of the same type at this. More...
 
- Public Member Functions inherited from sheaf::index_space_interval
virtual ~index_space_interval ()
 Destructor. More...
 
pod_type begin () const
 Beginning space id of this interval in the id space family scope. More...
 
pod_type end () const
 Ending space id of this interval in the id space family scope. More...
 
bool in_bounds (pod_type xspace_id) const
 True if id xspace_id is in the bounds [begin(), end()). More...
 
virtual const index_space_familyid_spaces () const
 The id space family for this (const version). More...
 
virtual index_space_familyid_spaces ()
 The id space family for this (mutable version). More...
 
virtual bool contains (pod_type xlocal_id) const
 True if this collection contains the id space with local id xlocal_id. More...
 
virtual bool contains_family (pod_type xspace_id) const
 True if this collection contains the id space with family id xspace_id. More...
 
virtual pod_type local_scope (pod_type xspace_id) const
 Id relative to this collection equivalent to the id space family id xspace_id. More...
 
virtual pod_type family_scope (pod_type xlocal_id) const
 Id relative to the id space family equivalent to the local id xlocal_id. More...
 
- Public Member Functions inherited from sheaf::index_space_collection
virtual ~index_space_collection ()
 Destructor. More...
 
virtual bool contains (pod_type xlocal_id) const =0
 True if this collection contains the id space with local id xlocal_id. More...
 
virtual bool contains_family (pod_type xspace_id) const =0
 True if this collection contains the id space with family id xspace_id. More...
 
virtual pod_type local_scope (pod_type xspace_id) const =0
 Id relative to this collection equivalent to the id space family id xspace_id. More...
 
virtual pod_type family_scope (pod_type xlocal_id) const =0
 Id relative to the id space family equivalent to the local id xlocal_id. More...
 
const hub_index_space_handlehub_id_space () const
 The hub id space. More...
 
virtual void remove (pod_type xlocal_id)=0
 Remove the id space with id xlocal_id. More...
 
virtual size_type ct (pod_type xlocal_id) const =0
 The number of members for the id space with id xlocal_id. More...
 
bool is_empty (pod_type xlocal_id) const
 True if there are no ids in the space with id xlocal_id. More...
 
virtual pod_type begin (pod_type xlocal_id) const =0
 Beginning id of the space with id xlocal_id. More...
 
virtual pod_type end (pod_type xlocal_id) const =0
 Ending id of the space with id xlocal_id. More...
 
bool is_gathered (pod_type xlocal_id) const
 True if begin(xlocal_id) == 0 and end(xlocal_id) == ct(xlocal_id). More...
 
virtual bool contains (pod_type xlocal_id, pod_type xid) const =0
 True if the space with id xlocal_id contains id xid. More...
 
bool contains (pod_type xlocal_id, const scoped_index &xid) const
 True if the space with id xlocal_id contains an id equivalent to xid. synonym for contains_hub(xlocal_id, xid.hub_pod()). More...
 
bool contains_hub (pod_type xlocal_id, pod_type xid) const
 True if the space with id xlocal_id contains an id equivalent to xid in the hub id space. synonym for contains_unglued_hub(xlocal_id, xid) More...
 
virtual bool contains_unglued_hub (pod_type xlocal_id, pod_type xid) const =0
 True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space. More...
 
bool contains_glued_hub (pod_type xlocal_id, pod_type xid) const
 True if the space with id xlocal_id contains an id equivalent to xid in the glued hub id space. More...
 
bool contains (pod_type xlocal_id, pod_type xid, const scoped_index &xhub_id) const
 True if the space with id xlocal_id contains an id xid equivalent to xhub_id in the hub id space. synonym for contains(xlocal_id, xid, xhub_id.hub_pod()). More...
 
virtual bool contains (pod_type xlocal_id, pod_type xid, pod_type xhub_id) const =0
 True if the space with id xlocal_id contains an id xid equivalent to xhub_id in the hub id space. More...
 
virtual pod_type pod (pod_type xlocal_id, pod_type xid) const =0
 The pod index in the space with id xlocal_id equivalent to xid in the hub id space. More...
 
pod_type pod (pod_type xlocal_id, const scoped_index &xid) const
 The pod index in the space with id xlocal_id equivalent to xid. synonym for pod(xlocal_id, id.hub_pod()). More...
 
pod_type hub_pod (pod_type xlocal_id, pod_type xid) const
 The pod index in the glued hub id space equivalent to xid in the id space with id xlocal_id. synonym for unglued_hub_pod(xlocal_id, xid). More...
 
virtual pod_type unglued_hub_pod (pod_type xlocal_id, pod_type xid) const =0
 The pod index in the glued hub id space equivalent to xid in the id space with id xlocal_id. More...
 
pod_type glued_hub_pod (pod_type xlocal_id, pod_type xid) const
 The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id. More...
 
virtual bool is_persistent (pod_type xlocal_id) const =0
 True if the id space with id xlocal_id should be written to disk. More...
 
virtual void new_product_structure (pod_type xlocal_id, const abstract_product_structure &xproduct)=0
 Creates a new product structure for the id space with id xlocal_id by cloning the product structure, xproduct. More...
 
virtual void delete_product_structure (pod_type xlocal_id)=0
 Deletes the product structure for the id space with id xlocal_id. More...
 
virtual const abstract_product_structureproduct_structure (pod_type xlocal_id) const =0
 The product structure for the id space with id xlocal_id (const version). More...
 
virtual abstract_product_structureproduct_structure (pod_type xlocal_id)=0
 The product structure for the id space with id xlocal_id (mutable version). More...
 
virtual bool has_product_structure (pod_type xlocal_id) const =0
 True if the id space with id xlocal_id has a product structure. More...
 
virtual index_space_handleget_id_space (pod_type xlocal_id) const =0
 Allocates an id space handle from the handle pool attached to state with id xlocal_id. More...
 
virtual index_space_iteratorget_id_space_iterator (pod_type xlocal_id) const =0
 Allocates an id space iterator from the iterator pool attached to state with id xlocal_id. 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...
 

Friends

class namespace_poset
 
SHEAF_DLL_SPEC size_t deep_size (const array_index_space_interval &xn, bool xinclude_shallow)
 The deep size of array_index_space_interval& xn. More...
 

SPACE FACTORY FACET

static const array_index_space_intervalnew_space (index_space_family &xid_spaces, size_type xub, block< pod_type > &xhub_ids, size_type xids_per_space, bool xowns_hub_ids)
 Create a new interval of id spaces with an array representation in the id space family xid_spaces with upper bound xub, hub id array xhub_ids, the number of ids per space xids_per_space and ownership mode xowns_hub_ids. Return a reference to the id space interval. More...
 

ARRAY_INDEX_SPACE_INTERVAL FACET

block< pod_type > * _hub_ids
 The array of hub ids. More...
 
size_type _ids_per_space
 The number of ids per id space. More...
 
bool _owns_hub_ids
 True if this interval is responsible for the memory management of _hub_ids. More...
 
virtual ~array_index_space_interval ()
 Destructor. More...
 
const block< pod_type > & hub_ids () const
 The array of hub ids. More...
 
size_type ids_per_space () const
 The number of ids per id space. More...
 
bool owns_hub_ids () const
 True if this interval owns the array of hub ids. If owns_hub_ids(), this interval is responsible for the memory management of hub_ids(). Otherwise, the user is response for the memory management. More...
 
 array_index_space_interval ()
 Default constructor. More...
 
 array_index_space_interval (const array_index_space_interval &xother)
 Copy constructor; disabled. More...
 

INDEX_SPACE_COLLECTION FACET

virtual bool operator== (const index_space_collection &xother) const
 True if this is equivalent to xother. More...
 
virtual size_type deep_size (bool xinclude_shallow) const
 The deep size of this. More...
 
virtual array_index_space_intervaloperator= (const index_space_collection &xother)
 Assignment operator. More...
 
virtual explicit_index_space_stateexplicit_state (pod_type xlocal_id) const
 The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xlocal_id. More...
 

INDEX SPACE FACET

virtual void remove (pod_type xlocal_id)
 Remove the id space with id xlocal_id. More...
 
virtual size_type ct (pod_type xlocal_id) const
 The number of members for the id space with id xlocal_id. More...
 
virtual pod_type begin (pod_type xlocal_id) const
 Beginning id of the space with id xlocal_id. More...
 
virtual pod_type end (pod_type xlocal_id) const
 Ending id of the space with id xlocal_id. More...
 
virtual bool contains (pod_type xlocal_id, pod_type xid) const
 True if the space with id xlocal_id contains id xid. More...
 
virtual bool contains_unglued_hub (pod_type xlocal_id, pod_type xid) const
 True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space. More...
 
virtual bool contains (pod_type xlocal_id, pod_type xid, pod_type xhub_id) const
 True if the space with id xlocal_id contains an id xid equivalent to xhub_id in the hub id space. More...
 
virtual pod_type pod (pod_type xlocal_id, pod_type xid) const
 The pod index in the space with id xlocal_id equivalent to xid in the hub id space. More...
 
virtual pod_type unglued_hub_pod (pod_type xlocal_id, pod_type xid) const
 The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id. More...
 
virtual bool is_persistent (pod_type xlocal_id) const
 True if the id space with id xlocal_id should be written to disk. More...
 

PRODUCT STRUCTURE FACET

virtual void new_product_structure (pod_type xlocal_id, const abstract_product_structure &xproduct)
 Creates a new product structure for the id space with id xlocal_id by cloning the product structure, xproduct. More...
 
virtual void delete_product_structure (pod_type xlocal_id)
 Deletes the product structure for the id space with id xlocal_id. More...
 
virtual const abstract_product_structureproduct_structure (pod_type xlocal_id) const
 The product structure for the id space with id xlocal_id (const version). More...
 
virtual abstract_product_structureproduct_structure (pod_type xlocal_id)
 The product structure for the id space with id xlocal_id (mutable version). More...
 
virtual bool has_product_structure (pod_type xlocal_id) const
 True if the id space with id xlocal_id has a product structure. More...
 

HANDLE POOL FACET

list_pool< forwarding_index_space_handle_handles
 The handle pool. More...
 
virtual index_space_handleget_id_space (pod_type xlocal_id) const
 Allocates an id space handle from the handle pool attached to state with id xlocal_id. More...
 
virtual void release_id_space (index_space_handle &xid_space) const
 Returns the id space handle xid_space to the handle pool. More...
 
virtual bool allocated_id_space (const index_space_handle &xid_space) const
 True if and only if id space handle xid_space was allocated by the handle pool. More...
 

ITERATOR POOL FACET

list_pool< array_implicit_index_space_iterator_iterators
 The iterator pool. More...
 
virtual index_space_iteratorget_id_space_iterator (pod_type xlocal_id) const
 Allocates an id space iterator from the iterator pool attached to state with id xlocal_id. More...
 
virtual void release_id_space_iterator (index_space_iterator &xitr) const
 Returns the id space iterator xitr to the iterator pool. More...
 
virtual bool allocated_id_space_iterator (const index_space_iterator &xitr) const
 True if and only if id space iterator xitr was allocated by the iterator pool. More...
 

ANY FACET

virtual bool is_ancestor_of (const any *other) const
 Conformance test; true if other conforms to this. More...
 
virtual bool invariant () const
 Class invariant. More...
 

Additional Inherited Members

- Public Types inherited from sheaf::index_space_collection
typedef pod_index_type pod_type
 The "plain old data" index type for this. More...
 
- Static Public Member Functions inherited from sheaf::index_space_interval
static factory< index_space_interval > & id_space_interval_factory ()
 A factory for making descendants of this class. More...
 
- Protected Member Functions inherited from sheaf::index_space_interval
 index_space_interval ()
 Default constructor. More...
 
 index_space_interval (const index_space_interval &xother)
 Copy constructor; disabled. More...
 
void new_state (index_space_family &xid_spaces, size_type xub)
 Create a new id space interval in the id space family xid_spaces with upper bound xub. More...
 
virtual bool supports_persistent_id_spaces () const
 True, if this interval supports persistent id spaces. More...
 
- Protected Member Functions inherited from sheaf::index_space_collection
 index_space_collection ()
 Default constructor. More...
 
 index_space_collection (const index_space_collection &xother)
 Copy constructor; disabled. More...
 
virtual explicit_index_space_stateexplicit_state (pod_type xlocal_id) const =0
 The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xlocal_id. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 
- Protected Attributes inherited from sheaf::index_space_interval
pod_type _begin
 Beginning space id of this interval in the id space family scope. More...
 
pod_type _end
 Ending space id of this interval in the id space family scope. More...
 
index_space_family_id_spaces
 The index space family of this collection. More...
 

Detailed Description

An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids are stored in a two dimensional array.

Definition at line 58 of file array_index_space_interval.h.

Constructor & Destructor Documentation

◆ ~array_index_space_interval()

sheaf::array_index_space_interval::~array_index_space_interval ( )
virtual

Destructor.

Definition at line 107 of file array_index_space_interval.cc.

References _hub_ids, _owns_hub_ids, and hub_ids().

Referenced by new_space().

◆ array_index_space_interval() [1/2]

sheaf::array_index_space_interval::array_index_space_interval ( )
protected

Default constructor.

Postcondition

Definition at line 179 of file array_index_space_interval.cc.

References _hub_ids, _owns_hub_ids, class_name(), and invariant().

Referenced by clone(), new_space(), and owns_hub_ids().

◆ array_index_space_interval() [2/2]

sheaf::array_index_space_interval::array_index_space_interval ( const array_index_space_interval xother)
inlineprotected

Copy constructor; disabled.

Definition at line 129 of file array_index_space_interval.h.

Member Function Documentation

◆ allocated_id_space()

bool sheaf::array_index_space_interval::allocated_id_space ( const index_space_handle xid_space) const
virtual

True if and only if id space handle xid_space was allocated by the handle pool.

Postcondition
  • is_basic_query

Implements sheaf::index_space_collection.

Definition at line 844 of file array_index_space_interval.cc.

References _handles, and get_id_space_iterator().

Referenced by release_id_space().

◆ allocated_id_space_iterator()

bool sheaf::array_index_space_interval::allocated_id_space_iterator ( const index_space_iterator xitr) const
virtual

True if and only if id space iterator xitr was allocated by the iterator pool.

Postcondition
  • is_basic_query

Implements sheaf::index_space_collection.

Definition at line 926 of file array_index_space_interval.cc.

References _iterators, and is_ancestor_of().

Referenced by release_id_space_iterator().

◆ begin()

sheaf::index_space_collection::pod_type sheaf::array_index_space_interval::begin ( pod_type  xlocal_id) const
virtual

Beginning id of the space with id xlocal_id.

Precondition
  • contains(xlocal_id)
Postcondition
  • is_basic_query

Definition at line 436 of file array_index_space_interval.cc.

References contains(), and sheaf::index_space_interval::end().

Referenced by new_space().

◆ class_name()

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

The name of this class.

Reimplemented from sheaf::index_space_interval.

Definition at line 220 of file array_index_space_interval.cc.

References clone().

Referenced by array_index_space_interval().

◆ clone()

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

Virtual constructor; create a new instance of the same type at this.

Postcondition
  • result != 0
  • is_same_type(result)

Implements sheaf::index_space_interval.

Definition at line 228 of file array_index_space_interval.cc.

References array_index_space_interval(), sheaf::index_space_interval::id_space_interval_factory(), sheaf::any::is_same_type(), and operator==().

Referenced by class_name().

◆ contains() [1/2]

bool sheaf::array_index_space_interval::contains ( pod_type  xlocal_id,
pod_type  xid 
) const
virtual

True if the space with id xlocal_id contains id xid.

Precondition
  • contains(xlocal_id)
Postcondition
  • is_basic_query

Definition at line 478 of file array_index_space_interval.cc.

References _ids_per_space, and contains_unglued_hub().

Referenced by begin(), contains(), contains_unglued_hub(), ct(), delete_product_structure(), end(), get_id_space(), get_id_space_iterator(), has_product_structure(), is_persistent(), new_product_structure(), pod(), product_structure(), remove(), and unglued_hub_pod().

◆ contains() [2/2]

bool sheaf::array_index_space_interval::contains ( pod_type  xlocal_id,
pod_type  xid,
pod_type  xhub_id 
) const
virtual

True if the space with id xlocal_id contains an id xid equivalent to xhub_id in the hub id space.

Precondition
  • contains(xlocal_id)
Postcondition
  • is_basic_query

Definition at line 540 of file array_index_space_interval.cc.

References _ids_per_space, contains(), and pod().

◆ contains_unglued_hub()

bool sheaf::array_index_space_interval::contains_unglued_hub ( pod_type  xlocal_id,
pod_type  xid 
) const
virtual

True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space.

Precondition
  • contains(xlocal_id)
Issue:
Using a linear search to minimize storage. For _ids_per_space, of 4 and under a linear search is as efficient as hashing. For 8 ids per space it is probably slightly slower. However, no extra storage is needed for the linear search. This function is probably not used enough by the user to justify the extra storage. If we find hashing necessary, we should use lazy instantiation to create maps from hub ids per id space.
Postcondition
  • is_basic_query

Definition at line 499 of file array_index_space_interval.cc.

References _hub_ids, _ids_per_space, and contains().

Referenced by contains(), and unglued_hub_pod().

◆ ct()

sheaf::size_type sheaf::array_index_space_interval::ct ( pod_type  xlocal_id) const
virtual

The number of members for the id space with id xlocal_id.

Precondition
  • contains(xlocal_id)
Postcondition
  • is_basic_query

Definition at line 415 of file array_index_space_interval.cc.

References _ids_per_space, sheaf::index_space_interval::begin(), and contains().

Referenced by remove().

◆ deep_size()

sheaf::size_type sheaf::array_index_space_interval::deep_size ( bool  xinclude_shallow) const
virtual

The deep size of this.

Postcondition
  • result >= 0

Implements sheaf::index_space_collection.

Definition at line 305 of file array_index_space_interval.cc.

References sheaf::deep_size(), and operator=().

◆ delete_product_structure()

void sheaf::array_index_space_interval::delete_product_structure ( pod_type  xlocal_id)
virtual

Deletes the product structure for the id space with id xlocal_id.

Precondition
  • contains(xlocal_id)
Todo:
Implement.

Not Implemented.

Postcondition
  • !has_product_structure(xlocal_id)

Definition at line 684 of file array_index_space_interval.cc.

References contains(), has_product_structure(), and product_structure().

Referenced by new_product_structure().

◆ end()

sheaf::index_space_collection::pod_type sheaf::array_index_space_interval::end ( pod_type  xlocal_id) const
virtual

Ending id of the space with id xlocal_id.

Precondition
  • contains(xlocal_id)
Postcondition
  • is_basic_query

Definition at line 457 of file array_index_space_interval.cc.

References _ids_per_space, and contains().

Referenced by new_space().

◆ explicit_state()

sheaf::explicit_index_space_state * sheaf::array_index_space_interval::explicit_state ( pod_type  xlocal_id) const
protectedvirtual

The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xlocal_id.

Todo:
Check to see if there is an override.
Postcondition
  • is_basic_query

Definition at line 364 of file array_index_space_interval.cc.

References remove().

Referenced by operator=().

◆ get_id_space()

sheaf::index_space_handle & sheaf::array_index_space_interval::get_id_space ( pod_type  xlocal_id) const
virtual

Allocates an id space handle from the handle pool attached to state with id xlocal_id.

Precondition
  • contains(xlocal_id)
Postcondition
  • result.is_attached()

Definition at line 795 of file array_index_space_interval.cc.

References _handles, sheaf::index_space_handle::attach_to(), contains(), sheaf::index_space_handle::is_attached(), and release_id_space().

Referenced by has_product_structure().

◆ get_id_space_iterator()

sheaf::index_space_iterator & sheaf::array_index_space_interval::get_id_space_iterator ( pod_type  xlocal_id) const
virtual

Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.

Precondition
  • contains(xlocal_id)
Postcondition
  • result.is_attached()

Definition at line 877 of file array_index_space_interval.cc.

References _iterators, sheaf::index_space_iterator::attach_to(), contains(), sheaf::index_space_iterator::is_attached(), and release_id_space_iterator().

Referenced by allocated_id_space().

◆ has_product_structure()

bool sheaf::array_index_space_interval::has_product_structure ( pod_type  xlocal_id) const
virtual

True if the id space with id xlocal_id has a product structure.

Precondition
  • contains(xlocal_id)
Todo:
Implement.

Not Implemented.

Postcondition
  • is_basic_query

Definition at line 759 of file array_index_space_interval.cc.

References contains(), and get_id_space().

Referenced by delete_product_structure(), new_product_structure(), and product_structure().

◆ hub_ids()

const sheaf::block< sheaf::array_index_space_interval::pod_type > & sheaf::array_index_space_interval::hub_ids ( ) const

The array of hub ids.

Postcondition
  • is_basic_query

Definition at line 127 of file array_index_space_interval.cc.

References _hub_ids, and ids_per_space().

Referenced by sheaf::array_implicit_index_space_iterator::attach_to(), new_space(), and ~array_index_space_interval().

◆ ids_per_space()

sheaf::size_type sheaf::array_index_space_interval::ids_per_space ( ) const

The number of ids per id space.

Postcondition
  • is_basic_query

Definition at line 144 of file array_index_space_interval.cc.

References _ids_per_space, and owns_hub_ids().

Referenced by sheaf::array_implicit_index_space_iterator::attach_to(), hub_ids(), and new_space().

◆ invariant()

◆ is_ancestor_of()

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

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::index_space_interval.

Definition at line 959 of file array_index_space_interval.cc.

References invariant().

Referenced by allocated_id_space_iterator(), operator=(), and operator==().

◆ is_persistent()

bool sheaf::array_index_space_interval::is_persistent ( pod_type  xlocal_id) const
virtual

True if the id space with id xlocal_id should be written to disk.

Precondition
  • contains(xlocal_id)
Postcondition
  • is_basic_query

Definition at line 628 of file array_index_space_interval.cc.

References contains(), and new_product_structure().

Referenced by unglued_hub_pod().

◆ new_product_structure()

void sheaf::array_index_space_interval::new_product_structure ( pod_type  xlocal_id,
const abstract_product_structure xproduct 
)
virtual

Creates a new product structure for the id space with id xlocal_id by cloning the product structure, xproduct.

Precondition
  • contains(xlocal_id)
Todo:
Implement.

Not Implemented.

Postcondition
  • has_product_structure(xlocal_id)

Definition at line 660 of file array_index_space_interval.cc.

References contains(), delete_product_structure(), and has_product_structure().

Referenced by is_persistent().

◆ new_space()

const sheaf::array_index_space_interval & sheaf::array_index_space_interval::new_space ( index_space_family xid_spaces,
size_type  xub,
block< pod_type > &  xhub_ids,
size_type  xids_per_space,
bool  xowns_hub_ids 
)
static

Create a new interval of id spaces with an array representation in the id space family xid_spaces with upper bound xub, hub id array xhub_ids, the number of ids per space xids_per_space and ownership mode xowns_hub_ids. Return a reference to the id space interval.

Precondition
  • xub > 0
  • xids_per_space > 0
  • xhub_ids.ub() >= xub*xids_per_space
Postcondition
  • &result.id_spaces() == &xid_spaces
  • result.begin() == old_id_spaces_end
  • result.end() == xid_spaces.end()
  • result.end() == result.begin() + xub
  • result.hub_ids() == xhub_ids
  • result.ids_per_space() == xids_per_space
  • result.owns_hub_ids() == xowns_hub_ids

Definition at line 38 of file array_index_space_interval.cc.

References array_index_space_interval(), begin(), sheaf::index_space_family::end(), end(), hub_ids(), sheaf::index_space_interval::id_spaces(), ids_per_space(), owns_hub_ids(), sheaf::auto_block< T, S >::ub(), and ~array_index_space_interval().

◆ operator=()

sheaf::array_index_space_interval & sheaf::array_index_space_interval::operator= ( const index_space_collection xother)
protectedvirtual

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Postcondition
  • (*this) == xother

Reimplemented from sheaf::index_space_interval.

Definition at line 326 of file array_index_space_interval.cc.

References _hub_ids, _ids_per_space, _owns_hub_ids, explicit_state(), invariant(), is_ancestor_of(), and sheaf::index_space_interval::operator=().

Referenced by deep_size().

◆ operator==()

bool sheaf::array_index_space_interval::operator== ( const index_space_collection xother) const
virtual

True if this is equivalent to xother.

Precondition
  • is_ancestor_of(&xother)

Reimplemented from sheaf::index_space_interval.

Definition at line 279 of file array_index_space_interval.cc.

References _hub_ids, _ids_per_space, _owns_hub_ids, deep_size, is_ancestor_of(), and sheaf::index_space_interval::operator==().

Referenced by clone().

◆ owns_hub_ids()

bool sheaf::array_index_space_interval::owns_hub_ids ( ) const

True if this interval owns the array of hub ids. If owns_hub_ids(), this interval is responsible for the memory management of hub_ids(). Otherwise, the user is response for the memory management.

Postcondition
  • is_basic_query

Definition at line 161 of file array_index_space_interval.cc.

References _owns_hub_ids, and array_index_space_interval().

Referenced by ids_per_space(), and new_space().

◆ pod()

sheaf::index_space_collection::pod_type sheaf::array_index_space_interval::pod ( pod_type  xlocal_id,
pod_type  xid 
) const
virtual

The pod index in the space with id xlocal_id equivalent to xid in the hub id space.

Precondition
  • contains(xlocal_id)
Issue:
Using a linear search to minimize storage. For _ids_per_space, of 4 and under a linear search is as efficient as hashing. For 8 ids per space it is probably slightly slower. However, no extra storage is needed for the linear search. This function is probably not used enough by the user to justify the extra storage. If we find hashing necessary, we should use lazy instantiation to create maps from hub ids per id space.
Postcondition
  • !is_valid(result) || contains(xlocal_id, result)

Definition at line 563 of file array_index_space_interval.cc.

References _hub_ids, _ids_per_space, contains(), sheaf::invalid_pod_index(), sheaf::is_valid(), and unglued_hub_pod().

Referenced by contains().

◆ product_structure() [1/2]

const sheaf::abstract_product_structure & sheaf::array_index_space_interval::product_structure ( pod_type  xlocal_id) const
virtual

The product structure for the id space with id xlocal_id (const version).

Precondition
  • contains(xlocal_id)
  • has_product_structure(xlocal_id)
Todo:
Implement.

Not Implemented.

Postcondition
  • is_basic_query

Definition at line 707 of file array_index_space_interval.cc.

References contains(), and has_product_structure().

Referenced by delete_product_structure().

◆ product_structure() [2/2]

sheaf::abstract_product_structure & sheaf::array_index_space_interval::product_structure ( pod_type  xlocal_id)
virtual

The product structure for the id space with id xlocal_id (mutable version).

Precondition
  • contains(xlocal_id)
  • has_product_structure(xlocal_id)
Todo:
Implement.

Not Implemented.

Postcondition
  • is_basic_query

Definition at line 733 of file array_index_space_interval.cc.

References contains(), and has_product_structure().

◆ release_id_space()

void sheaf::array_index_space_interval::release_id_space ( index_space_handle xid_space) const
virtual

Returns the id space handle xid_space to the handle pool.

Precondition
  • allocated_id_space(xid_space)
Postcondition
  • is_basic_query

Implements sheaf::index_space_collection.

Definition at line 817 of file array_index_space_interval.cc.

References _handles, allocated_id_space(), and sheaf::index_space_handle::detach().

Referenced by get_id_space().

◆ release_id_space_iterator()

void sheaf::array_index_space_interval::release_id_space_iterator ( index_space_iterator xitr) const
virtual

Returns the id space iterator xitr to the iterator pool.

Precondition
  • allocated_id_space_iterator(xitr)
Postcondition
  • is_basic_query

Implements sheaf::index_space_collection.

Definition at line 899 of file array_index_space_interval.cc.

References _iterators, allocated_id_space_iterator(), and sheaf::index_space_iterator::detach().

Referenced by get_id_space_iterator().

◆ remove()

void sheaf::array_index_space_interval::remove ( pod_type  xlocal_id)
virtual

Remove the id space with id xlocal_id.

Todo:
Remove or implement.

Not Implemented.

Postcondition
  • !contains(xlocal_id)

Definition at line 394 of file array_index_space_interval.cc.

References contains(), and ct().

Referenced by explicit_state().

◆ unglued_hub_pod()

sheaf::index_space_collection::pod_type sheaf::array_index_space_interval::unglued_hub_pod ( pod_type  xlocal_id,
pod_type  xid 
) const
virtual

The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id.

Precondition
  • contains(xlocal_id)
Postcondition
  • !is_valid(result) || contains_unglued_hub(xlocal_id, result)

Definition at line 604 of file array_index_space_interval.cc.

References _hub_ids, _ids_per_space, contains(), contains_unglued_hub(), sheaf::invalid_pod_index(), is_persistent(), and sheaf::is_valid().

Referenced by pod().

Friends And Related Function Documentation

◆ deep_size

SHEAF_DLL_SPEC size_t deep_size ( const array_index_space_interval xn,
bool  xinclude_shallow 
)
friend

The deep size of array_index_space_interval& xn.

Referenced by sheaf::deep_size(), and operator==().

Member Data Documentation

◆ _handles

list_pool<forwarding_index_space_handle> sheaf::array_index_space_interval::_handles
mutableprotected

The handle pool.

Definition at line 374 of file array_index_space_interval.h.

Referenced by allocated_id_space(), sheaf::deep_size(), get_id_space(), and release_id_space().

◆ _hub_ids

block<pod_type>* sheaf::array_index_space_interval::_hub_ids
protected

◆ _ids_per_space

size_type sheaf::array_index_space_interval::_ids_per_space
protected

The number of ids per id space.

Definition at line 139 of file array_index_space_interval.h.

Referenced by contains(), contains_unglued_hub(), ct(), end(), ids_per_space(), operator=(), operator==(), pod(), and unglued_hub_pod().

◆ _iterators

list_pool<array_implicit_index_space_iterator> sheaf::array_index_space_interval::_iterators
mutableprotected

◆ _owns_hub_ids

bool sheaf::array_index_space_interval::_owns_hub_ids
protected

True if this interval is responsible for the memory management of _hub_ids.

Definition at line 145 of file array_index_space_interval.h.

Referenced by array_index_space_interval(), operator=(), operator==(), owns_hub_ids(), and ~array_index_space_interval().


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