SheafSystem  0.0.0.0
sheaf::name_multimap Class Reference

A partial multi-valued relation with total injective inverse between names and indices of type index_type. More...

#include <name_multimap.h>

Inheritance diagram for sheaf::name_multimap:
sheaf::any

Friends

SHEAF_DLL_SPEC size_t deep_size (const name_multimap &xp, bool xinclude_shallow)
 The deep size of the referenced object of type name_multimap; if xinclude_shallow, add the sizeof xp to the result. More...
 

NAME_MULTIMAP FACET

typedef pod_index_type index_type
 The type of the index in the map. More...
 
typedef std::pair< index_type, std::string > entry_type
 The type of an entry in the map. More...
 
typedef std::list< std::string > name_list_type
 The type of name list for this map. More...
 
typedef name_list_type::iterator name_iterator
 The iterator type for names. More...
 
typedef name_list_type::const_iterator const_name_iterator
 The const iterator type for names. More...
 
typedef std::map< index_type, name_list_type >::iterator iterator
 The iterator type for this map. More...
 
typedef std::map< index_type, name_list_type >::const_iterator const_iterator
 The const iterator type for this map. More...
 
 name_multimap ()
 Default constructor. More...
 
 name_multimap (const name_multimap &xother)
 Copy constructor. More...
 
 name_multimap (const std::string xnames[], size_type xnames_ub)
 Copy constructor. More...
 
virtual ~name_multimap ()
 Destructor. More...
 
std::string name (index_type xindex) const
 The primary (0-th) name associated with index xindex. More...
 
std::string name (index_type xindex, int xi) const
 The xi-th name associated with index xindex. More...
 
const name_list_typeall_names (index_type xindex) const
 All names associated with index xindex. More...
 
void all_names (index_type xindex, block< std::string > &xresult) const
 All the names associated with xindex. More...
 
index_type index (const std::string &xname) const
 The index associated with name xname. More...
 
void put_entry (const entry_type &xentry, bool xunique)
 Sets (xindex, xname) as an entry in the map. If xunique, deletes all other entries for xindex. More...
 
void put_entry (index_type xindex, const std::string &xname, bool xunique)
 Sets (xindex, xname) as an entry in the map. If xunique, deletes all other entries for xindex. More...
 
bool contains_name (const std::string &xname) const
 True if this already contains an entry with name xname. More...
 
bool contains_index (index_type xindex) const
 True if this already contains an entry with index xindex. More...
 
bool contains_entry (const entry_type &xentry) const
 True if this already contains an entry equal to xentry. More...
 
bool contains_entry (index_type xindex, const std::string &xname) const
 True if this already contains an entry equal to <xindex, xname>. More...
 
void delete_index (index_type xindex)
 Removes all entires for index xindex. More...
 
void delete_name (const std::string &xname)
 Removes the entry for name xname. More...
 
void clear ()
 Removes all entries. More...
 
bool empty () const
 True if and only if the map contains no entries. More...
 
const_iterator begin () const
 The initial value for iterators over this map. More...
 
const_iterator end () const
 The final value for iterators over this map. More...
 
int ct () const
 The number of index values in the map. More...
 
void print () const
 Prints the data members of this on cout. Intended for use debugging. More...
 
void print (std::ostream &xos, const name_multimap &xm) const
 Prints the data members of xm on stream xos. Intended for use debugging. More...
 
size_type name_ct (const index_type &xindex) const
 The number of names associated with key xindex. More...
 

ANY FACET

virtual name_multimapclone () const
 Virtual constructor; makes a new instance of the same type as this. 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...
 
bool operator== (const name_multimap &xother)
 Equality test; true if other has the same contents as this. More...
 
name_multimapoperator= (const name_multimap &xother)
 Assignment operator; make this a copy of xother. 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

A partial multi-valued relation with total injective inverse between names and indices of type index_type.

Definition at line 63 of file name_multimap.h.

Member Typedef Documentation

◆ const_iterator

The const iterator type for this map.

Definition at line 107 of file name_multimap.h.

◆ const_name_iterator

typedef name_list_type::const_iterator sheaf::name_multimap::const_name_iterator

The const iterator type for names.

Definition at line 97 of file name_multimap.h.

◆ entry_type

typedef std::pair<index_type, std::string> sheaf::name_multimap::entry_type

The type of an entry in the map.

Definition at line 82 of file name_multimap.h.

◆ index_type

The type of the index in the map.

Definition at line 77 of file name_multimap.h.

◆ iterator

The iterator type for this map.

Definition at line 102 of file name_multimap.h.

◆ name_iterator

typedef name_list_type::iterator sheaf::name_multimap::name_iterator

The iterator type for names.

Definition at line 92 of file name_multimap.h.

◆ name_list_type

typedef std::list<std::string> sheaf::name_multimap::name_list_type

The type of name list for this map.

Definition at line 87 of file name_multimap.h.

Constructor & Destructor Documentation

◆ name_multimap() [1/3]

sheaf::name_multimap::name_multimap ( )

Default constructor.

Postcondition

Definition at line 36 of file name_multimap.cc.

Referenced by name_multimap().

◆ name_multimap() [2/3]

sheaf::name_multimap::name_multimap ( const name_multimap xother)

Copy constructor.

Postcondition
  • *this == xother

Definition at line 54 of file name_multimap.cc.

References name_multimap().

◆ name_multimap() [3/3]

sheaf::name_multimap::name_multimap ( const std::string  xnames[],
size_type  xnames_ub 
)

Copy constructor.

Postcondition
  • for(int i = ( 0 ); i < ( xnames_ub ); ++ i ) !xnames[i].empty() ? name(index_type(i)) == xnames[i] : true

Definition at line 73 of file name_multimap.cc.

References ~name_multimap().

◆ ~name_multimap()

sheaf::name_multimap::~name_multimap ( )
virtual

Destructor.

Definition at line 99 of file name_multimap.cc.

References name().

Referenced by name_multimap().

Member Function Documentation

◆ all_names() [1/2]

const sheaf::name_multimap::name_list_type & sheaf::name_multimap::all_names ( index_type  xindex) const

All names associated with index xindex.

Definition at line 185 of file name_multimap.cc.

Referenced by sheaf::member_record::internalize(), name(), and sheaf::operator<<().

◆ all_names() [2/2]

void sheaf::name_multimap::all_names ( index_type  xindex,
block< std::string > &  xresult 
) const

All the names associated with xindex.

Postcondition
  • xresult.ct() == name_ct(xindex)

Definition at line 207 of file name_multimap.cc.

References sheaf::auto_block< T, S >::ct(), index(), sheaf::auto_block< T, S >::push_back(), sheaf::auto_block< T, S >::reserve(), and sheaf::auto_block< T, S >::set_ct().

◆ begin()

sheaf::name_multimap::const_iterator sheaf::name_multimap::begin ( ) const

The initial value for iterators over this map.

Definition at line 539 of file name_multimap.cc.

References end().

Referenced by empty(), print(), sheaf::poset_scaffold::put_member_names_to_poset(), and sheaf::member_names_record::transfer_poset_to_internal_buffer().

◆ clear()

void sheaf::name_multimap::clear ( )

Removes all entries.

Postcondition

Definition at line 491 of file name_multimap.cc.

References empty().

Referenced by delete_name(), sheaf::poset_scaffold::get_member_names_from_poset(), and sheaf::poset_scaffold::put_member_names_to_poset().

◆ clone()

sheaf::name_multimap * sheaf::name_multimap::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 616 of file name_multimap.cc.

References invariant().

Referenced by name_ct().

◆ contains_entry() [1/2]

bool sheaf::name_multimap::contains_entry ( const entry_type xentry) const

True if this already contains an entry equal to xentry.

Precondition
  • !xentry.second.empty()

Definition at line 387 of file name_multimap.cc.

References delete_index().

Referenced by contains_entry(), and contains_index().

◆ contains_entry() [2/2]

bool sheaf::name_multimap::contains_entry ( index_type  xindex,
const std::string &  xname 
) const

True if this already contains an entry equal to <xindex, xname>.

Precondition

Definition at line 364 of file name_multimap.cc.

References contains_entry().

◆ contains_index()

bool sheaf::name_multimap::contains_index ( index_type  xindex) const

True if this already contains an entry with index xindex.

Definition at line 349 of file name_multimap.cc.

References contains_entry().

Referenced by contains_name(), and sheaf::index_space_family::delete_state().

◆ contains_name()

bool sheaf::name_multimap::contains_name ( const std::string &  xname) const

True if this already contains an entry with name xname.

Precondition

Definition at line 328 of file name_multimap.cc.

References contains_index().

Referenced by sheaf::index_space_family::delete_space(), and put_entry().

◆ ct()

int sheaf::name_multimap::ct ( ) const

The number of index values in the map.

Definition at line 553 of file name_multimap.cc.

References print().

Referenced by end().

◆ delete_index()

void sheaf::name_multimap::delete_index ( index_type  xindex)

Removes all entires for index xindex.

Postcondition
  • !contains_index(xindex)

Definition at line 408 of file name_multimap.cc.

References delete_name().

Referenced by contains_entry(), sheaf::index_space_family::delete_state(), and sheaf::poset_scaffold::put_member_names_to_poset().

◆ delete_name()

void sheaf::name_multimap::delete_name ( const std::string &  xname)

Removes the entry for name xname.

Precondition
Postcondition
  • !contains_name(xname)

Definition at line 438 of file name_multimap.cc.

References clear().

Referenced by delete_index().

◆ empty()

bool sheaf::name_multimap::empty ( ) const

True if and only if the map contains no entries.

Definition at line 515 of file name_multimap.cc.

References begin().

Referenced by clear().

◆ end()

sheaf::name_multimap::const_iterator sheaf::name_multimap::end ( ) const

The final value for iterators over this map.

Definition at line 546 of file name_multimap.cc.

References ct().

Referenced by begin(), print(), sheaf::poset_scaffold::put_member_names_to_poset(), and sheaf::member_names_record::transfer_poset_to_internal_buffer().

◆ index()

◆ invariant()

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

Class invariant.

Invariant
  • _index_to_name_map.size() <= _name_to_index_map.size()

Reimplemented from sheaf::any.

Definition at line 638 of file name_multimap.cc.

References is_ancestor_of().

Referenced by clone().

◆ is_ancestor_of()

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

Conformance test; true if other conforms to this.

Precondition
  • xother != 0

Reimplemented from sheaf::any.

Definition at line 672 of file name_multimap.cc.

References operator==().

Referenced by invariant().

◆ name() [1/2]

std::string sheaf::name_multimap::name ( index_type  xindex) const

The primary (0-th) name associated with index xindex.

Postcondition
  • result.empty() == !contains_index(xindex)

Definition at line 116 of file name_multimap.cc.

Referenced by fields::field_vd::embed_property(), sheaf::index_space_family::name(), and ~name_multimap().

◆ name() [2/2]

std::string sheaf::name_multimap::name ( index_type  xindex,
int  xi 
) const

The xi-th name associated with index xindex.

Postcondition
  • (!result.empty()) == ((0 <= xi) && (xi < name_ct(xindex)))

Definition at line 152 of file name_multimap.cc.

References all_names().

◆ name_ct()

sheaf::size_type sheaf::name_multimap::name_ct ( const index_type xindex) const

The number of names associated with key xindex.

Definition at line 598 of file name_multimap.cc.

References clone().

Referenced by print().

◆ operator=()

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

Assignment operator; make this a copy of xother.

Postcondition
  • *this == xother

Definition at line 711 of file name_multimap.cc.

References sheaf::operator<<().

Referenced by operator==().

◆ operator==()

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

Equality test; true if other has the same contents as this.

Definition at line 692 of file name_multimap.cc.

References operator=().

Referenced by is_ancestor_of().

◆ print() [1/2]

void sheaf::name_multimap::print ( ) const

Prints the data members of this on cout. Intended for use debugging.

Definition at line 560 of file name_multimap.cc.

Referenced by ct(), and sheaf::operator<<().

◆ print() [2/2]

void sheaf::name_multimap::print ( std::ostream &  xos,
const name_multimap xm 
) const

Prints the data members of xm on stream xos. Intended for use debugging.

Definition at line 567 of file name_multimap.cc.

References begin(), end(), and name_ct().

◆ put_entry() [1/2]

void sheaf::name_multimap::put_entry ( const entry_type xentry,
bool  xunique 
)

Sets (xindex, xname) as an entry in the map. If xunique, deletes all other entries for xindex.

Precondition
  • !xentry.second.empty()
  • !contains_name(xentry.second)
Postcondition
  • contains_entry(xentry)

Definition at line 276 of file name_multimap.cc.

Referenced by sheaf::member_record::externalize(), index(), sheaf::index_space_family::put_name(), and sheaf::member_names_record::transfer_internal_buffer_to_poset().

◆ put_entry() [2/2]

void sheaf::name_multimap::put_entry ( index_type  xindex,
const std::string &  xname,
bool  xunique 
)

Sets (xindex, xname) as an entry in the map. If xunique, deletes all other entries for xindex.

Precondition
  • !contains_name(xname)
Postcondition
  • contains_entry(xindex, xname)

Definition at line 305 of file name_multimap.cc.

References contains_name().

Friends And Related Function Documentation

◆ deep_size

SHEAF_DLL_SPEC size_t deep_size ( const name_multimap xp,
bool  xinclude_shallow 
)
friend

The deep size of the referenced object of type name_multimap; if xinclude_shallow, add the sizeof xp to the result.


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