24 #ifndef SHEAF_DLL_SPEC_H 25 #include "SheafSystem/sheaf_dll_spec.h" 29 #include "SheafSystem/pod_types.h" 32 #ifndef STD_UNORDERED_MAP_H 33 #include "SheafSystem/std_unordered_map.h" 37 #include "SheafSystem/std_string.h" 45 template <
typename T1,
typename T2>
62 template<
typename internal_index_type,
typename external_index_type>
100 external_index_type
external_id(internal_index_type xinternal_id)
const;
105 internal_index_type
internal_id(external_index_type xexternal_id)
const;
110 void put_ids(internal_index_type xinternal_id,
111 external_index_type xexternal_id);
224 unordered::unordered_map<internal_index_type, external_index_type>::const_iterator
const_iterator;
229 const_iterator
begin()
const;
234 const_iterator
end()
const;
246 void print(std::ostream& xos,
256 typedef unordered::unordered_map<internal_index_type, external_index_type> external_map_type;
261 external_map_type _to_external;
266 typedef unordered::unordered_map<external_index_type, internal_index_type> internal_map_type;
271 internal_map_type _to_internal;
276 bool _internal_ids_sequential;
281 bool _external_ids_sequential;
288 internal_index_type _scratch_internal_id;
295 external_index_type _scratch_external_id;
300 internal_index_type _internal_id_ub;
305 external_index_type _external_id_ub;
315 void unguarded_put_ids(internal_index_type xinternal_id,
316 external_index_type xexternal_id);
326 template<
typename internal_index_type,
typename external_index_type>
328 operator<<(std::ostream& xos, const record_map<internal_index_type, external_index_type>& xp);
333 #endif // ifndef RECORD_MAP_H internal_index_type internal_id(external_index_type xexternal_id) const
The internal id corresponding to xexternal_id.
external_index_type external_id(internal_index_type xinternal_id) const
The external id corresponding to xinternal_id.
void put_scratch_external_id(external_index_type xid)
Sets the value of the external id scratch register to xid.
bool operator==(const record_map &xother) const
True if same external_id and internal_id.
void put_scratch_internal_id(internal_index_type xid)
Sets the value of the internal id scratch register to xid.
bool is_empty() const
True if there are no entries in the map.
const_iterator end() const
The end of the range of internal ids contained in this.
bool contains_internal_id(internal_index_type xint_id) const
True if this map contains an entry for internal index xint_id.
record_map()
Default constructor.
external_index_type external_id_ub() const
The maximum external id in this map.
bool external_ids_sequential() const
True if sequentially assigning external ids.
size_type ct() const
The number of entries in the map.
internal_index_type internal_id_ub() const
The maximum internal id in this map.
const_iterator begin() const
The beginning of the range of internal ids contained in this.
internal_index_type scratch_internal_id() const
The value of the internal id scratch register. The scratch register is a convenient place for a clien...
bool ub_is_max() const
True if internal_id_ub and external_id_ub are in fact maxima; i.e. if there exists an entry (int_id...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
void clear()
Removes all entries.
bool internal_ids_sequential() const
True if sequentially assigning internal ids.
void remove_internal_id(internal_index_type xinternal_id)
Removes xinternal_id and its external image from the map.
virtual bool invariant() const
The class invariant.
unordered::unordered_map< internal_index_type, external_index_type >::const_iterator const_iterator
The type of const iterator for this.
Namespace for the sheaves component of the sheaf system.
external_index_type scratch_external_id() const
The value of the external id scratch register. The scratch register is a convenient place for a clien...
void put_ids(internal_index_type xinternal_id, external_index_type xexternal_id)
Defines the mapping between xinternal_id and xexternal_id.
external_index_type put_internal_id(internal_index_type xinternal_id)
Defines a mapping between xinternal_id and a sequentially assigned external id. Returns the external ...
bool contains_external_id(external_index_type xext_id) const
True if this map contains an entry for external index xext_id.
Insert record_map& p into ostream& os.
void remove_external_id(external_index_type xexternal_id)
Removes xexternal_id and its internal image from the map.
virtual ~record_map()
Destructor.
internal_index_type put_external_id(external_index_type xexternal_id)
Defines a mapping between xexternal_id and a sequentially assigned internal id.
void print() const
Prints the data members of this on cout. Intended for use debugging.
record_map & operator=(const record_map &xother)
Assignment operator.