SheafSystem  0.0.0.0
sheaf::reserved_primary_index_space_state Class Reference

A computed implementation of abstract class primary_index_space_state. This representation is used for the reserved term of the hub id space. More...

#include <reserved_primary_index_space_state.h>

Inheritance diagram for sheaf::reserved_primary_index_space_state:
sheaf::primary_index_space_state sheaf::explicit_index_space_state sheaf::any

Public Member Functions

virtual const std::string & class_name () const
 The name of this class. More...
 
virtual reserved_primary_index_space_stateclone () const
 Virtual constructor; create a new instance of the same type at this. More...
 
- Public Member Functions inherited from sheaf::primary_index_space_state
pod_type offset () const
 The offset into the hub id space. More...
 
virtual void extend (size_type xct)
 Extend this id space to have ct() == xct. More...
 
pod_type hub_term_id () const
 The term id of this in the hub id space. More...
 
virtual bool contains (pod_type xid) const
 True if this space contains id xid. More...
 
virtual bool contains_unglued_hub (pod_type xid) const
 True if this space contains an id equivalent to xid in the unglued hub id space. More...
 
virtual pod_type pod (pod_type xid) const
 The pod index in this space equivalent to xid in the hub id space. More...
 
virtual pod_type unglued_hub_pod (pod_type xid) const
 The pod index in the unglued hub id space equivalent to xid in this id space. More...
 
- Public Member Functions inherited from sheaf::explicit_index_space_state
virtual ~explicit_index_space_state ()
 Destructor. More...
 
const index_space_collectionhost () const
 The host collection (const version). More...
 
index_space_collectionhost ()
 The host collection (mutable version). More...
 
pod_type index () const
 The index of this id space. More...
 
const index_space_familyid_spaces () const
 The id space family for this (const version). More...
 
index_space_familyid_spaces ()
 The id space family for this (mutable version). More...
 
const hub_index_space_handlehub_id_space () const
 The hub id space. More...
 
size_type ct () const
 The number of members. More...
 
bool is_empty () const
 True if there are no ids in the space. More...
 
pod_type begin () const
 Beginning id of this space. More...
 
pod_type end () const
 Ending id of this space. More...
 
bool is_gathered () const
 True if begin() == 0 and end() == ct(). More...
 
virtual bool contains (pod_type xid) const =0
 True if this space contains id xid. More...
 
bool contains (const scoped_index &xid) const
 True if this space contains an id equivalent to xid. synonym for contains_hub(xid.hub_pod()). More...
 
bool contains_hub (pod_type xid) const
 True if this space contains an id equivalent to xid in the unglued hub id space. synonym for contains_unglued_hub(xid) More...
 
virtual bool contains_unglued_hub (pod_type xid) const =0
 True if this space contains an id equivalent to xid in the unglued hub id space. More...
 
virtual bool contains_glued_hub (pod_type xid) const
 True if this space contains an id equivalent to xid in the hub id space. More...
 
bool contains (pod_type xid, const scoped_index &xhub_id) const
 True if this space contains an id xid equivalent to xhub_id in the hub id space. synonym for contains(xid, xhub_id.hub_pod()). More...
 
virtual bool contains (pod_type xid, pod_type xhub_id) const
 True if this space contains an id xid equivalent to xhub_id in the hub id space. More...
 
virtual pod_type pod (pod_type xid) const =0
 The pod index in this space equivalent to xid in the unglued hub id space. More...
 
pod_type pod (const scoped_index &xid) const
 The pod index in this space equivalent to xid. synonym for pod(xid.hub_pod()). More...
 
pod_type hub_pod (pod_type xid) const
 The pod index in the unglued hub id space equivalent to xid in this id space. synonym for unglued_hub_pod(xid). More...
 
virtual pod_type unglued_hub_pod (pod_type xid) const =0
 The pod index in the unglued hub id space equivalent to xid in this id space. More...
 
virtual pod_type glued_hub_pod (pod_type xid) const
 The pod index in the glued hub id space equivalent to xid in this id space. More...
 
bool is_persistent () const
 True if this id space should be written to disk. More...
 
virtual void new_product_structure (const abstract_product_structure &xproduct)
 Creates a new product structure for this id space by cloning the product structure, xproduct. More...
 
virtual void delete_product_structure ()
 Deletes the product structure for this id space. More...
 
const abstract_product_structureproduct_structure () const
 The product structure for this id space (const version). More...
 
abstract_product_structureproduct_structure ()
 The product structure for this id space (mutable version). More...
 
bool has_product_structure () const
 True if this id space has a product structure. 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
 

SPACE FACTORY FACET

static reserved_primary_index_space_handle new_space (index_space_family &xid_spaces, const std::string &xname, pod_type xoffset, size_type xct)
 Create a new reserved primary id space in the id space family xid_space at the next available id space index with name xname, ooffset xoffset and count xct. Returns a handle to the id space created. More...
 
static reserved_primary_index_space_handle new_space (index_space_family &xid_spaces, pod_type xid, const std::string &xname, pod_type xoffset, size_type xct)
 Create a new reserved primary id space in the id space family xid_space at the id space index xid with name xname, offset xoffset and count xct. Returns a handle to the id space created. More...
 

RESERVED_PRIMARY_INDEX_SPACE_STATE FACET

 reserved_primary_index_space_state ()
 Default constructor. More...
 
 reserved_primary_index_space_state (const reserved_primary_index_space_state &xother)
 Copy constructor; disabled. More...
 
virtual ~reserved_primary_index_space_state ()
 Destructor. More...
 

RESERVED PRIMARY INDEX SPACE FACET

pod_type _next_hub_id
 The next available hub id for allocation. More...
 
pod_type new_id ()
 Allocate the next available id in this space. Returns the allocated id in the hub id space. More...
 
pod_type new_hub_id (pod_type xhub_id)
 Allocate the hub id xhub_id in this space. Returns the allocated id in the hub id space. More...
 
pod_type next_hub_id () const
 The next available hub id for allocation. More...
 
bool is_next_id_available () const
 True if and only if the next id is available for allocation. More...
 
bool is_hub_id_available (pod_type xhub_id) const
 True if and only if the hub id xhub_id is available for allocation. More...
 

EXPLICIT_INDEX_SPACE_STATE FACET

virtual reserved_primary_index_space_stateoperator= (const explicit_index_space_state &xother)
 Assignment operator. More...
 
virtual bool operator== (const explicit_index_space_state &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...
 

HANDLE POOL FACET

static size_type handle_pool_ct ()
 The number of handles in the pool. More...
 
static size_type handle_pool_deep_size ()
 The deep size of the handle pool. More...
 
virtual index_space_handleget_id_space () const
 Allocates an id space handle from the handle pool. 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 ACET

static size_type iterator_pool_ct ()
 The number of iterators in the pool. More...
 
static size_type iterator_pool_deep_size ()
 The deep size of the iterator pool. More...
 
virtual index_space_iteratorget_iterator () const
 Allocates an id space iterator from the iterator pool. More...
 
virtual void release_iterator (index_space_iterator &xitr) const
 Returns the id space iterator xitr to the iterator pool. More...
 
virtual bool allocated_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::explicit_index_space_state
typedef pod_index_type pod_type
 The "plain old data" index type for this. More...
 
- Static Public Member Functions inherited from sheaf::primary_index_space_state
static primary_index_space_handle new_space (index_space_family &xid_spaces, const std::string &xname, pod_type xoffset, size_type xct)
 Create a new primary id space in the id space family xid_space at the next available id space index with name xname, ooffset xoffset and count xct. Returns a handle to the id space created. More...
 
static primary_index_space_handle new_space (index_space_family &xid_spaces, pod_type xid, const std::string &xname, pod_type xoffset, size_type xct)
 Create a new primary id space in the id space family xid_space at the id space index xid with name xname, offset xoffset and count xct. Returns a handle to the id space created. More...
 
static size_type handle_pool_ct ()
 The number of handles in the pool. More...
 
static size_type handle_pool_deep_size ()
 The deep size of the handle pool. More...
 
static size_type iterator_pool_ct ()
 The number of iterators in the pool. More...
 
static size_type iterator_pool_deep_size ()
 The deep size of the iterator pool. More...
 
- Static Public Member Functions inherited from sheaf::explicit_index_space_state
static factory< explicit_index_space_state > & id_space_factory ()
 A factory for making descendants of this class. More...
 
- Protected Member Functions inherited from sheaf::primary_index_space_state
 primary_index_space_state ()
 Default constructor. More...
 
 primary_index_space_state (const primary_index_space_state &xother)
 Copy constructor; disabled. More...
 
virtual ~primary_index_space_state ()
 Destructor. More...
 
void put_hub_term_id (pod_type xhub_term_id)
 Sets hub_term_id() to xhub_term_id. More...
 
- Protected Member Functions inherited from sheaf::explicit_index_space_state
 explicit_index_space_state ()
 Default constructor. More...
 
 explicit_index_space_state (const explicit_index_space_state &xother)
 Copy constructor; disabled. More...
 
void new_state (index_space_family &xid_spaces, const std::string &xname, bool xis_persistent)
 Create a new id space state in the id space family xid_spaces at the next available id space index with name xname, and persistence xis_persistent. More...
 
void new_state (index_space_family &xid_spaces, pod_type xid, const std::string &xname, bool xis_persistent)
 Create a new id space state in the id space family xid_spaces at the id space index xid with name xname, and persistence xis_persistent. More...
 
void invalidate_extrema ()
 Invalidate the extrema. More...
 
void attach (explicit_index_space_handle &xid_space) const
 Attach the id space handle xid_space to this state. More...
 
void attach (explicit_index_space_iterator &xitr) const
 Attach the id space iterator xitr to this state. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 
- Protected Attributes inherited from sheaf::primary_index_space_state
pod_type _offset
 The offset into the hub id space. More...
 
pod_type _hub_term_id
 The term id of this in the hub id space. More...
 
- Protected Attributes inherited from sheaf::explicit_index_space_state
index_space_collection_host
 The host collection. More...
 
pod_type _index
 The index of this id space. More...
 
size_type _ct
 The number of members. More...
 
pod_type _begin
 Beginning id of this space. More...
 
pod_type _end
 Ending id of this space. More...
 
bool _is_persistent
 True if this id space should be written to disk. More...
 
abstract_product_structure_product
 The product structure for this id space. More...
 

Detailed Description

A computed implementation of abstract class primary_index_space_state. This representation is used for the reserved term of the hub id space.

Definition at line 46 of file reserved_primary_index_space_state.h.

Constructor & Destructor Documentation

◆ reserved_primary_index_space_state() [1/2]

sheaf::reserved_primary_index_space_state::reserved_primary_index_space_state ( )
protected

◆ reserved_primary_index_space_state() [2/2]

sheaf::reserved_primary_index_space_state::reserved_primary_index_space_state ( const reserved_primary_index_space_state xother)
inlineprotected

Copy constructor; disabled.

Definition at line 104 of file reserved_primary_index_space_state.h.

◆ ~reserved_primary_index_space_state()

sheaf::reserved_primary_index_space_state::~reserved_primary_index_space_state ( )
protectedvirtual

Destructor.

Definition at line 166 of file reserved_primary_index_space_state.cc.

References new_id().

Referenced by reserved_primary_index_space_state().

Member Function Documentation

◆ allocated_id_space()

bool sheaf::reserved_primary_index_space_state::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

Reimplemented from sheaf::primary_index_space_state.

Definition at line 503 of file reserved_primary_index_space_state.cc.

References iterator_pool_ct().

Referenced by release_id_space().

◆ allocated_iterator()

bool sheaf::reserved_primary_index_space_state::allocated_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

Reimplemented from sheaf::primary_index_space_state.

Definition at line 640 of file reserved_primary_index_space_state.cc.

References class_name().

Referenced by release_iterator().

◆ class_name()

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

The name of this class.

Reimplemented from sheaf::primary_index_space_state.

Definition at line 692 of file reserved_primary_index_space_state.cc.

References clone().

Referenced by allocated_iterator().

◆ clone()

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

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

Postcondition
  • result != 0
  • is_same_type(result)

Reimplemented from sheaf::primary_index_space_state.

Definition at line 700 of file reserved_primary_index_space_state.cc.

References sheaf::explicit_index_space_state::id_space_factory(), is_ancestor_of(), sheaf::any::is_same_type(), and reserved_primary_index_space_state().

Referenced by class_name().

◆ deep_size()

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

The deep size of this.

Postcondition
  • result >= 0

Reimplemented from sheaf::primary_index_space_state.

Definition at line 350 of file reserved_primary_index_space_state.cc.

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

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

◆ get_id_space()

sheaf::index_space_handle & sheaf::reserved_primary_index_space_state::get_id_space ( ) const
virtual

Allocates an id space handle from the handle pool.

Postcondition
  • result.is_attached()

Reimplemented from sheaf::primary_index_space_state.

Definition at line 456 of file reserved_primary_index_space_state.cc.

References sheaf::explicit_index_space_state::attach(), sheaf::explicit_index_space_handle::is_attached(), and release_id_space().

Referenced by handle_pool_deep_size().

◆ get_iterator()

sheaf::index_space_iterator & sheaf::reserved_primary_index_space_state::get_iterator ( ) const
virtual

Allocates an id space iterator from the iterator pool.

Postcondition
  • result.is_attached()

Reimplemented from sheaf::primary_index_space_state.

Definition at line 593 of file reserved_primary_index_space_state.cc.

References sheaf::explicit_index_space_state::attach(), sheaf::explicit_index_space_iterator::is_attached(), and release_iterator().

Referenced by iterator_pool_deep_size().

◆ handle_pool_ct()

sheaf::size_type sheaf::reserved_primary_index_space_state::handle_pool_ct ( )
static

The number of handles in the pool.

Postcondition
  • result >= 0

Definition at line 418 of file reserved_primary_index_space_state.cc.

References handle_pool_deep_size().

Referenced by operator=().

◆ handle_pool_deep_size()

sheaf::size_type sheaf::reserved_primary_index_space_state::handle_pool_deep_size ( )
static

The deep size of the handle pool.

Postcondition
  • result >= 0

Definition at line 437 of file reserved_primary_index_space_state.cc.

References sheaf::deep_size(), and get_id_space().

Referenced by handle_pool_ct().

◆ invariant()

◆ is_ancestor_of()

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

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::primary_index_space_state.

Definition at line 750 of file reserved_primary_index_space_state.cc.

References invariant().

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

◆ is_hub_id_available()

bool sheaf::reserved_primary_index_space_state::is_hub_id_available ( pod_type  xhub_id) const

◆ is_next_id_available()

bool sheaf::reserved_primary_index_space_state::is_next_id_available ( ) const

True if and only if the next id is available for allocation.

Postcondition
  • is_basic_query

Definition at line 266 of file reserved_primary_index_space_state.cc.

References sheaf::explicit_index_space_state::_end, _next_hub_id, sheaf::primary_index_space_state::_offset, and is_hub_id_available().

Referenced by sheaf::reserved_primary_index_space_handle::is_next_id_available(), new_id(), and next_hub_id().

◆ iterator_pool_ct()

sheaf::size_type sheaf::reserved_primary_index_space_state::iterator_pool_ct ( )
static

The number of iterators in the pool.

Postcondition
  • result >= 0

Definition at line 555 of file reserved_primary_index_space_state.cc.

References iterator_pool_deep_size().

Referenced by allocated_id_space().

◆ iterator_pool_deep_size()

sheaf::size_type sheaf::reserved_primary_index_space_state::iterator_pool_deep_size ( )
static

The deep size of the iterator pool.

Postcondition
  • result >= 0

Definition at line 574 of file reserved_primary_index_space_state.cc.

References sheaf::deep_size(), and get_iterator().

Referenced by iterator_pool_ct().

◆ new_hub_id()

sheaf::reserved_primary_index_space_state::pod_type sheaf::reserved_primary_index_space_state::new_hub_id ( pod_type  xhub_id)

Allocate the hub id xhub_id in this space. Returns the allocated id in the hub id space.

Precondition
  • is_hub_id_available(xhub_id)
Postcondition

Definition at line 219 of file reserved_primary_index_space_state.cc.

References _next_hub_id, sheaf::explicit_index_space_state::ct(), invariant(), is_hub_id_available(), and next_hub_id().

Referenced by sheaf::reserved_primary_index_space_handle::new_hub_id(), and new_id().

◆ new_id()

sheaf::reserved_primary_index_space_state::pod_type sheaf::reserved_primary_index_space_state::new_id ( )

Allocate the next available id in this space. Returns the allocated id in the hub id space.

Precondition
Postcondition

Definition at line 192 of file reserved_primary_index_space_state.cc.

References _next_hub_id, sheaf::explicit_index_space_state::ct(), invariant(), is_next_id_available(), new_hub_id(), and next_hub_id().

Referenced by sheaf::reserved_primary_index_space_handle::new_id(), and ~reserved_primary_index_space_state().

◆ new_space() [1/2]

sheaf::reserved_primary_index_space_handle sheaf::reserved_primary_index_space_state::new_space ( index_space_family xid_spaces,
const std::string &  xname,
pod_type  xoffset,
size_type  xct 
)
static

Create a new reserved primary id space in the id space family xid_space at the next available id space index with name xname, ooffset xoffset and count xct. Returns a handle to the id space created.

Precondition
  • !xname.empty()
  • !xid_spaces.contains(xname)
  • xoffset >= 0
  • xct > 0
Postcondition
  • &result.id_spaces() == &xid_spaces
  • xid_spaces.contains(xname)
  • result.conforms_to_state(xname)
  • result.name() == xname
  • result.offset() == xoffset
  • result.ct() == xct
  • result.next_hub_id() == xoffset

Definition at line 37 of file reserved_primary_index_space_state.cc.

References sheaf::explicit_index_space_state::_begin, sheaf::explicit_index_space_state::_ct, sheaf::explicit_index_space_state::_end, _next_hub_id, sheaf::primary_index_space_state::_offset, sheaf::reserved_primary_index_space_handle::conforms_to_state(), sheaf::index_space_family::contains(), sheaf::explicit_index_space_handle::ct(), sheaf::explicit_index_space_handle::id_spaces(), sheaf::explicit_index_space_handle::index(), sheaf::index_space_family::is_explicit_interval(), sheaf::explicit_index_space_handle::is_persistent(), sheaf::index_space_handle::name(), sheaf::explicit_index_space_state::new_state(), sheaf::reserved_primary_index_space_handle::next_hub_id(), sheaf::primary_index_space_handle::offset(), and reserved_primary_index_space_state().

Referenced by sheaf::primary_sum_index_space_state::new_reserved_term().

◆ new_space() [2/2]

static reserved_primary_index_space_handle sheaf::reserved_primary_index_space_state::new_space ( index_space_family xid_spaces,
pod_type  xid,
const std::string &  xname,
pod_type  xoffset,
size_type  xct 
)
static

Create a new reserved primary id space in the id space family xid_space at the id space index xid with name xname, offset xoffset and count xct. Returns a handle to the id space created.

◆ next_hub_id()

◆ operator=()

sheaf::reserved_primary_index_space_state & sheaf::reserved_primary_index_space_state::operator= ( const explicit_index_space_state xother)
protectedvirtual

Assignment operator.

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

Reimplemented from sheaf::primary_index_space_state.

Definition at line 371 of file reserved_primary_index_space_state.cc.

References _next_hub_id, handle_pool_ct(), invariant(), and is_ancestor_of().

Referenced by deep_size().

◆ operator==()

bool sheaf::reserved_primary_index_space_state::operator== ( const explicit_index_space_state xother) const
virtual

True if this is equivalent to xother.

Precondition
  • is_ancestor_of(&xother)

Reimplemented from sheaf::primary_index_space_state.

Definition at line 327 of file reserved_primary_index_space_state.cc.

References _next_hub_id, deep_size(), is_ancestor_of(), and sheaf::primary_index_space_state::operator==().

Referenced by is_hub_id_available().

◆ release_id_space()

void sheaf::reserved_primary_index_space_state::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

Reimplemented from sheaf::primary_index_space_state.

Definition at line 476 of file reserved_primary_index_space_state.cc.

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

Referenced by get_id_space().

◆ release_iterator()

void sheaf::reserved_primary_index_space_state::release_iterator ( index_space_iterator xitr) const
virtual

Returns the id space iterator xitr to the iterator pool.

Precondition
  • allocated_iterator(xitr)
Postcondition
  • is_basic_query

Reimplemented from sheaf::primary_index_space_state.

Definition at line 613 of file reserved_primary_index_space_state.cc.

References allocated_iterator(), and sheaf::index_space_iterator::detach().

Referenced by get_iterator().

Member Data Documentation

◆ _next_hub_id

pod_type sheaf::reserved_primary_index_space_state::_next_hub_id
protected

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