Immutable Class Template Reference

#include <coherence/lang/Immutable.hpp>

Inherits TypedHandle< T >.

List of all members.


Detailed Description

template<class T>
class coherence::lang::Immutable< T >

A Handle implementation which upon assignment ensures that it will reference an immutable Object.

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.

Author:
mf 2007.07.05

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 > &h)
 Construct an Immutable handle from another Handle.
 I (const Immutable< T > &h)
 Construct an Immutable handle from another Handle.
 ~Immutable ()
 Destruct the handle.

Protected Member Functions

Immutable< T > & set (const T *cpo)
 Set this handle to point to immutable version of the given object, or unset the handle.

Constructor & Destructor Documentation

Immutable ( const T *  po  )  [inline]

Construct an Immutable handle to the given Object.

Parameters:
po the pointer to the Object to reference


Member Function Documentation

I ( const TypedHandle< O > &  h  )  [inline]

Construct an Immutable handle from another Handle.

Parameters:
h another handle

I ( const Immutable< T > &  h  )  [inline]

Construct an Immutable handle from another Handle.

Parameters:
h another handle

Immutable<T>& set ( const T *  cpo  )  [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.


The documentation for this class was generated from the following file: Copyright (c) 2000-2008 Oracle. All rights reserved.