#include <coherence/lang/Immutable.hpp>
Inherits TypedHandle< T >.
If the passed Object is immutable (as defined by Object::isImmutable()) then the handle simply holds a const pointer to the Object. If the passed Object is not immutable, then a clone attempt is made, and held via a const pointer. If the supplied Object is not immutable and not cloneable then assignment will fail with a CloneNotSupport exception.
Public Member Functions | |
Immutable () | |
Construct a NULL handle. | |
Immutable (const T *po) | |
Construct an Immutable handle to the given Object. | |
template<class O> | |
I (const TypedHandle< O > &that) | |
Construct an Immutable handle from another Handle. | |
I (const Immutable< T > &that) | |
Construct an Immutable handle from another Handle. | |
Protected Member Functions | |
Immutable< T > & | set (const T *cpo, const ChainedHandleElement *pThat) |
Set this handle to point to immutable version of the given object, or unset the handle. |
Immutable | ( | const T * | po | ) | [inline] |
I | ( | const TypedHandle< O > & | that | ) | [inline] |
I | ( | const Immutable< T > & | that | ) | [inline] |
Immutable<T>& set | ( | const T * | cpo, | |
const ChainedHandleElement * | pThat | |||
) | [inline, protected] |
Set this handle to point to immutable version of the given object, or unset the handle.
If the given pointer points to the immutable object, then this handle will point it. If the given pointer points to the mutable object, then this handle will point to the clone of that object. If the given pointer is NULL, then this handle will point to no object.
cpo | pointer to the target object | |
pThat | pointer to the source ChainedHandleElement |