|
LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
A renaming mapping defaulting to identity: Mapping a class with itself (endomorphism). Unless a value is already mapped onto another, map it to itself if nonstrict. This is a special case of std::map. More...
#include <endomap.hh>


Public Types | |
| enum | strictness_type { nonstrict, strict } |
| typedef map< T, T > | super_type |
| Super class type. | |
| typedef map_type::key_type | key_type |
| The map's key type. | |
| typedef map_type::mapped_type | mapped_type |
| The type of object associated with the keys. | |
| typedef map_type::value_type | value_type |
| typedef map_type::key_compare | key_compare |
| Type of the function object that compares two keys for ordering. | |
| typedef map_type::iterator | iterator |
| Iterator used to iterate through a map. | |
| typedef map_type::const_iterator | const_iterator |
| Const iterator used to iterate through a map. | |
Public Member Functions | |
| virtual endo_map * | clone () const |
| Return a duplicate of this. | |
| virtual T & | operator[] (const T &t) |
| virtual T | operator() (const T &t) const override |
| Lookup for t, returning it if unknown. | |
| key_compare | key_comp () const |
| Returns the key_compare object used by the map. | |
| virtual T | operator[] (const T &t) const |
| Lookup for the value associated to t. | |
| virtual std::list< T > | operator() (const std::list< T > &ts) const |
| virtual std::pair< iterator, bool > | insert (const std::pair< const T, T > &x) |
| Inserts x into the map. | |
| virtual void | insert (const map &other) |
| Copy the contents of other to this. | |
| std::pair< iterator, bool > | emplace (Args &&...args) |
| Insert a new element built in-place using args into the map. | |
| virtual bool | empty () const |
| Is the map empty ? | |
| virtual size_t | size () const |
| Number of known identifiers. | |
| virtual T | take (const T &t) |
| Remove and return mapping for t from the map. | |
| virtual void | clear () |
| Erase all of the elements. | |
| virtual std::ostream & | print (std::ostream &ostr) const |
| Description of known mappings. | |
Constructors and destructor. | |
| endo_map () | |
| virtual | ~endo_map () |
| virtual iterator | find (const T &t) |
| virtual const_iterator | find (const T &t) const |
| virtual iterator | xfind (const T &t) |
| virtual const_iterator | xfind (const T &t) const |
Iterating. | |
| virtual iterator | begin () |
| virtual const_iterator | begin () const |
| virtual iterator | end () |
| virtual const_iterator | end () const |
| virtual iterator | lower_bound (const T &k) |
| virtual const_iterator | lower_bound (const T &k) const |
Protected Types | |
| typedef std::map< T, T > | map_type |
Protected Attributes | |
| strictness_type | strictness_ |
| If strict, queries for an unknown (unmapped) Identifier is an error. | |
| map_type | map_ |
| Mapping from T to N. | |
A renaming mapping defaulting to identity: Mapping a class with itself (endomorphism). Unless a value is already mapped onto another, map it to itself if nonstrict. This is a special case of std::map.
|
inherited |
Const iterator used to iterate through a map.
Iterator used to iterate through a map.
|
inherited |
Type of the function object that compares two keys for ordering.
|
inherited |
The type of object associated with the keys.
| typedef map<T, T> misc::endo_map< T >::super_type |
Super class type.
|
inherited |
The type of object, std::pair<const key_type, data_type>, stored in the map.
| enum misc::endo_map::strictness_type |
| misc::endo_map< T >::endo_map | ( | ) |
|
virtual |
|
virtualinherited |
|
virtualinherited |
Erase all of the elements.
|
virtual |
Return a duplicate of this.
Reimplemented from misc::map< T, T >.
Insert a new element built in-place using args into the map.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Inserts x into the map.
Copy the contents of other to this.
|
inherited |
Returns the key_compare object used by the map.
Finds the first element whose key is not less than k.
|
virtualinherited |
|
overridevirtual |
Lookup for t, returning it if unknown.
Reimplemented from misc::map< T, T >.
References misc::find().
|
virtualinherited |
Lookup for a list ts of T's, throwing std::range_error if one or several elements are not found.
|
virtual |
Return a reference to the value associated to t.
If t was not inserted before, then, contrary to std::map, we insert t -> t into the map, instead of `t -> T()'. This spares the construction of a new T, which may have nasty effects if this constructor has side effects (e.g., incrementing a counter).
Reimplemented from misc::map< T, T >.
|
virtualinherited |
Lookup for the value associated to t.
|
virtualinherited |
Description of known mappings.
|
virtualinherited |
Number of known identifiers.
|
virtualinherited |
Remove and return mapping for t from the map.
Lookup for t and throw an exception if not available.
|
virtualinherited |
|
protected |
If strict, queries for an unknown (unmapped) Identifier is an error.