#include <coherence/util/TypedCollections.hpp>
Inherits Object, and Converter.
Public Types | ||||
typedef spec::Handle | Handle | |||
EntryConverter Handle definition. | ||||
typedef spec::View | View | |||
EntryConverter View definition. | ||||
typedef spec::Holder | Holder | |||
EntryConverter Holder definition. | ||||
Public Member Functions | ||||
virtual Object::Holder | convert (Object::Holder oh) const | |||
Convert an Object referenced by the supplied holder.
| ||||
virtual bool | isImmutable () const | |||
Return true iff no further changes can be made to the Object, that would effect the outcome of a call to its equals method.Except for Objects which are naturally immutable (such as String), being immutable generally implies that the Object is only referenced via const pointers or views. Objects which hold references to child Objects, may need to take the immutability of their children into account when determining their own immutability. This extended check is not performed by the default implementation, but can be integrated into the immutability checks by overriding this method, as well as making use of MemberHandles to reference child Objects. A typical derived implementation may look as follows:
bool isImmutable() const { if (m_fImmutable) // check recorded state { return true; // already marked as immutable, avoid calculation } else if (Object::isImmutable()) // ensure shallow immutability { // ensure deep immutability if (m_child1->isImmutable() && m_child2->isImmutable() ... && m_childN->isImmutable()) { // record and return immutability return m_fImmutable = true; } // some Objects which comprise this Object are still mutable } return false; } The default implementation return true iff the Object is only referenced via const pointers and or views.
| ||||
Protected Member Functions | ||||
EntryConverter () | ||||
Create new EntryConverter instance. | ||||
EntryConverter (const EntryConverter &) | ||||
Copy constructor. |