|
LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Define unique class.
More...
#include <unique.hh>

Public Types | |
| typedef unique< T, C > | value_type |
| typedef T | data_type |
Public Member Functions | |
Ctor & Dtor. | |
| unique (const data_type &s) | |
Construct a unique. | |
| virtual | ~unique () |
Operators. | |
| virtual value_type & | operator= (const value_type &rhs) |
Assign a unique to this unique. | |
| virtual bool | operator== (const value_type &rhs) const |
Compare two unique for equality. | |
| virtual bool | operator!= (const value_type &rhs) const |
Compare two unique for inequality. | |
| virtual bool | operator< (const value_type &rhs) const |
Compare two sunique for order. | |
Protected Types | |
| typedef std::set< T, C > | object_set_type |
| The unique's object type. | |
| typedef object_set_type::size_type | object_size_type |
| The type for the size of the unique set. | |
Static Protected Member Functions | |
| static object_set_type & | object_set_instance () |
| Return the set of uniques. | |
Protected Attributes | |
| const data_type * | obj_ |
| Pointer to the unique referenced object. | |
Accessors. | |
| virtual const data_type & | object_get () const |
Return the object referenced by this. | |
| virtual | operator const data_type & () const |
| static object_size_type | object_map_size () |
| Return the number of referenced objects. | |
Define unique class.
Implementation of the flyweight pattern. Map identical objects to a unique reference.
| typedef T misc::unique< T, C >::data_type |
|
protected |
The unique's object type.
|
protected |
The type for the size of the unique set.
| typedef unique<T, C> misc::unique< T, C >::value_type |
| misc::unique< T, C >::unique | ( | const data_type & | s | ) |
Construct a unique.
| s | referenced object |
|
virtual |
|
virtual |
Return the object referenced by this.
Referenced by misc::symbol::fresh().
|
static |
Return the number of referenced objects.
|
staticprotected |
Return the set of uniques.
|
virtual |
|
inlinevirtual |
Compare two unique for inequality.
| rhs | unique to compare with. |
References type::operator==().
|
inlinevirtual |
Compare two sunique for order.
| rhs | unique to compare with. |
References assertion, and misc::unique< T, C >::obj_.
|
inlinevirtual |
Assign a unique to this unique.
| rhs | unique to copy. |
References misc::unique< T, C >::obj_.
|
inlinevirtual |
Compare two unique for equality.
| rhs | unique to compare with. |
References misc::unique< T, C >::obj_.
|
protected |
Pointer to the unique referenced object.
Referenced by misc::unique< T, C >::operator<(), misc::unique< T, C >::operator=(), and misc::unique< T, C >::operator==().