SheafSystem  0.0.0.0
sheaf::implicit_entry_map< E, I > Class Template Reference

A map in which the entries may be implicit. More...

#include <implicit_entry_map.h>

Inheritance diagram for sheaf::implicit_entry_map< E, I >:
sheaf::any

Friends

class implicit_entry_map_iterator< E, I >
 
class index_space_family
 
size_t deep_size (const implicit_entry_map< E, I > &xmap, bool xinclude_shallow)
 The deep size of the referenced object of type implicit_entry_map<E, I>; if xinclude_shallow, add the sizeof xvalue to the result. More...
 

IMPLICIT_ENTRY_MAP FACET

typedef pod_index_type pod_type
 The "plain old data" index type for this. More...
 
typedef rc_ptr< E > explicit_value_type
 The type of an explicit value. More...
 
typedef rc_ptr< I > interval_type
 The type of an interval. More...
 
typedef implicit_entry_map_iterator< E, I > iterator_type
 The type of iterator for this map. More...
 
 implicit_entry_map ()
 Default Constructor. More...
 
 ~implicit_entry_map ()
 Destructor. More...
 
bool contains_explicit_entry (pod_type xid) const
 True if and only if this map contains an explicit entry for xid. More...
 
bool contains_implicit_entry (pod_type xid) const
 True if and only if this map contains an implicit entry for xid. More...
 
bool contains_entry (pod_type xid) const
 True if and only if contains_explicit_entry(xid) or contains_implicit_entry(xid). More...
 
E & value (pod_type xid) const
 The value at xid. If this map contains an explicit entry at xid, the explicit value is returned. Otherwise, a value is created by the implicit interval at xid and returned. More...
 
E & operator[] (pod_type xid) const
 The value at xid. If this map contains an explicit entry at xid, the explicit value is returned. Otherwise, a value is created by the implicit interval and returned. synonym for value(xid). More...
 
void insert_explicit_entry (pod_type xid, E &xvalue)
 Insert the explicit value xvalue at xid. More...
 
void insert_implicit_interval (I &xinterval)
 Insert the implicit interval xinterval. More...
 
void remove_explicit_entry (pod_type xid)
 Remove the explicit entry at xid. More...
 
void remove_implicit_interval (pod_type xid)
 Remove the entire interval that contains xid. More...
 
void remove_entry (pod_type xid, bool xremove_interval)
 Remove the entry at xid. If xremove_interval remove the entire interval at xid otherwise only remove the implicit entry at xid. More...
 
implicit_entry_map_iterator< E, I > * iterator () const
 An iterator for the entries of this map. More...
 
pod_type begin () const
 The beginning id of this. More...
 
pod_type end () const
 The ending id of this. More...
 
size_type ct () const
 The number of entries in this. More...
 
static const explicit_value_typenull_explicit_value ()
 Null explicit value. More...
 
static const interval_typenull_interval ()
 Null implicit interval. More...
 
const explicit_value_typeexplicit_value (pod_type xid) const
 The explicit value at xid. More...
 
const interval_typeimplicit_interval (pod_type xid) const
 The implicit interval that contains xid. More...
 

ANY FACET

virtual bool is_ancestor_of (const any *other) const
 Conformance test; true if other conforms to this. More...
 
virtual implicit_entry_map< E, I > * clone () const
 Virtual constructor, makes a new instance of the same type as this. More...
 
virtual bool invariant () const
 Class invariant. More...
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Detailed Description

template<typename E, typename I>
class sheaf::implicit_entry_map< E, I >

A map in which the entries may be implicit.

Definition at line 52 of file implicit_entry_map.h.

Member Typedef Documentation

◆ explicit_value_type

template<typename E, typename I>
typedef rc_ptr<E> sheaf::implicit_entry_map< E, I >::explicit_value_type

The type of an explicit value.

Definition at line 91 of file implicit_entry_map.h.

◆ interval_type

template<typename E, typename I>
typedef rc_ptr<I> sheaf::implicit_entry_map< E, I >::interval_type

The type of an interval.

Definition at line 96 of file implicit_entry_map.h.

◆ iterator_type

template<typename E, typename I>
typedef implicit_entry_map_iterator<E, I> sheaf::implicit_entry_map< E, I >::iterator_type

The type of iterator for this map.

Definition at line 101 of file implicit_entry_map.h.

◆ pod_type

template<typename E, typename I>
typedef pod_index_type sheaf::implicit_entry_map< E, I >::pod_type

The "plain old data" index type for this.

Definition at line 86 of file implicit_entry_map.h.

Constructor & Destructor Documentation

◆ implicit_entry_map()

template<typename E , typename I >
sheaf::implicit_entry_map< E, I >::implicit_entry_map ( )

Default Constructor.

Definition at line 55 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::~implicit_entry_map().

◆ ~implicit_entry_map()

Member Function Documentation

◆ begin()

◆ clone()

template<typename E , typename I >
implicit_entry_map< E, I > * sheaf::implicit_entry_map< E, I >::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 815 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::invariant(), and sheaf::any::is_same_type().

Referenced by sheaf::implicit_entry_map< E, I >::is_ancestor_of().

◆ contains_entry()

◆ contains_explicit_entry()

◆ contains_implicit_entry()

template<typename E , typename I >
bool sheaf::implicit_entry_map< E, I >::contains_implicit_entry ( pod_type  xid) const

◆ ct()

◆ end()

◆ explicit_value()

template<typename E , typename I >
const implicit_entry_map< E, I >::explicit_value_type & sheaf::implicit_entry_map< E, I >::explicit_value ( pod_type  xid) const
protected

◆ implicit_interval()

◆ insert_explicit_entry()

template<typename E, typename I >
void sheaf::implicit_entry_map< E, I >::insert_explicit_entry ( pod_type  xid,
E &  xvalue 
)

Insert the explicit value xvalue at xid.

Precondition
  • !contains_explicit_entry(xid)
Postcondition
  • contains_explicit_entry(xid)

Definition at line 243 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::begin(), sheaf::implicit_entry_map< E, I >::contains_explicit_entry(), sheaf::implicit_entry_map< E, I >::ct(), sheaf::implicit_entry_map< E, I >::end(), and sheaf::implicit_entry_map< E, I >::insert_implicit_interval().

Referenced by sheaf::implicit_entry_map< E, I >::operator[]().

◆ insert_implicit_interval()

template<typename E , typename I>
void sheaf::implicit_entry_map< E, I >::insert_implicit_interval ( I &  xinterval)

Insert the implicit interval xinterval.

Todo:
Make precondition executable.
Precondition
  • -unexecutable( "interval is empty" )
Todo:
Make postcondition executable.
Postcondition
  • -unexecutable( "interval is full" )
  • ct() == old_ct + xinterval.ct()
  • end() >= xinterval.end()

Definition at line 278 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::begin(), sheaf::implicit_entry_map< E, I >::ct(), sheaf::implicit_entry_map< E, I >::end(), and sheaf::implicit_entry_map< E, I >::remove_explicit_entry().

Referenced by sheaf::implicit_entry_map< E, I >::insert_explicit_entry().

◆ invariant()

template<typename E , typename I >
bool sheaf::implicit_entry_map< E, I >::invariant ( ) const
virtual

◆ is_ancestor_of()

template<typename E , typename I >
bool sheaf::implicit_entry_map< E, I >::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 795 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::clone().

Referenced by sheaf::implicit_entry_map< E, I >::implicit_interval().

◆ iterator()

template<typename E , typename I >
implicit_entry_map_iterator< E, I > * sheaf::implicit_entry_map< E, I >::iterator ( ) const

An iterator for the entries of this map.

Postcondition
  • result != 0

Definition at line 584 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::begin().

Referenced by sheaf::implicit_entry_map< E, I >::remove_entry().

◆ null_explicit_value()

template<typename E , typename I >
const implicit_entry_map< E, I >::explicit_value_type & sheaf::implicit_entry_map< E, I >::null_explicit_value ( )
staticprotected

◆ null_interval()

template<typename E , typename I >
const implicit_entry_map< E, I >::interval_type & sheaf::implicit_entry_map< E, I >::null_interval ( )
staticprotected

◆ operator[]()

template<typename E , typename I >
E & sheaf::implicit_entry_map< E, I >::operator[] ( pod_type  xid) const

The value at xid. If this map contains an explicit entry at xid, the explicit value is returned. Otherwise, a value is created by the implicit interval and returned. synonym for value(xid).

Precondition
  • contains_entry(xid)

Definition at line 223 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::contains_entry(), sheaf::implicit_entry_map< E, I >::insert_explicit_entry(), and sheaf::implicit_entry_map< E, I >::value().

Referenced by sheaf::implicit_entry_map< E, I >::value().

◆ remove_entry()

template<typename E , typename I >
void sheaf::implicit_entry_map< E, I >::remove_entry ( pod_type  xid,
bool  xremove_interval 
)

Remove the entry at xid. If xremove_interval remove the entire interval at xid otherwise only remove the implicit entry at xid.

Issue:
This can be more efficient. The calls to contains_* can be replaced with access to the data structures which can be used for the removal.
Issue:
This could be done more efficiently since we already found the previous and next pointers (see the implementation of remove_implicit_interval).
Postcondition
  • !contains_entry(xid)

Definition at line 454 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::contains_entry(), sheaf::implicit_entry_map< E, I >::contains_explicit_entry(), sheaf::implicit_entry_map< E, I >::contains_implicit_entry(), sheaf::implicit_entry_map< E, I >::iterator(), sheaf::implicit_entry_map< E, I >::remove_explicit_entry(), and sheaf::implicit_entry_map< E, I >::remove_implicit_interval().

Referenced by sheaf::implicit_entry_map< E, I >::remove_implicit_interval().

◆ remove_explicit_entry()

template<typename E , typename I >
void sheaf::implicit_entry_map< E, I >::remove_explicit_entry ( pod_type  xid)

Remove the explicit entry at xid.

Precondition
  • contains_explicit_entry(xid)
Postcondition
  • !contains_explicit_entry(xid)
  • ct() == old_ct - 1
  • ((ct() > 0) && (xid == old_begin)) ? begin() > xid : true
  • ((ct() > 0) && ((xid + 1) == old_end)) ? end() <= xid : true

Definition at line 326 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::begin(), sheaf::implicit_entry_map< E, I >::contains_explicit_entry(), sheaf::implicit_entry_map< E, I >::ct(), sheaf::implicit_entry_map< E, I >::end(), sheaf::is_valid(), and sheaf::implicit_entry_map< E, I >::remove_implicit_interval().

Referenced by sheaf::implicit_entry_map< E, I >::insert_implicit_interval(), and sheaf::implicit_entry_map< E, I >::remove_entry().

◆ remove_implicit_interval()

template<typename E , typename I >
void sheaf::implicit_entry_map< E, I >::remove_implicit_interval ( pod_type  xid)

Remove the entire interval that contains xid.

Precondition
  • contains_implicit_entry(xid)
Postcondition
  • !contains_implicit_entry(xid)
Todo:
Implement a set of functions which allow the postconditions for the count and extrema to be properly represented. Ex: interval_ct(xid), interval_begin(xid), interval_end(xid).

Definition at line 373 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::contains_implicit_entry(), and sheaf::implicit_entry_map< E, I >::remove_entry().

Referenced by sheaf::implicit_entry_map< E, I >::remove_entry(), and sheaf::implicit_entry_map< E, I >::remove_explicit_entry().

◆ value()

template<typename E , typename I >
E & sheaf::implicit_entry_map< E, I >::value ( pod_type  xid) const

The value at xid. If this map contains an explicit entry at xid, the explicit value is returned. Otherwise, a value is created by the implicit interval at xid and returned.

Precondition
  • contains_entry(xid)

Definition at line 187 of file implicit_entry_map.impl.h.

References sheaf::implicit_entry_map< E, I >::contains_entry(), sheaf::implicit_entry_map< E, I >::explicit_value(), sheaf::implicit_entry_map< E, I >::implicit_interval(), and sheaf::implicit_entry_map< E, I >::operator[]().

Referenced by sheaf::implicit_entry_map< E, I >::contains_entry(), and sheaf::implicit_entry_map< E, I >::operator[]().

Friends And Related Function Documentation

◆ deep_size

template<typename E, typename I>
size_t deep_size ( const implicit_entry_map< E, I > &  xmap,
bool  xinclude_shallow = true 
)
friend

The deep size of the referenced object of type implicit_entry_map<E, I>; if xinclude_shallow, add the sizeof xvalue to the result.

Issue:
Since the deletion will be handled by this map should the deep_size?
Todo:
Implement deep_size for rc_ptr.
Postcondition
  • result >= 0

Definition at line 876 of file implicit_entry_map.impl.h.


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