Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

InvocableMap::Entry Class Reference

#include <coherence/util/InvocableMap.hpp>

List of all members.


Detailed Description

An InvocableMap::Entry contains additional information and exposes additional operations that the basic Map::Entry does not.

It allows non-existent entries to be represented, thus allowing their optional creation. It allows existent entries to be removed from the Map. It supports a number of optimizations that can ultimately be mapped through to indexes and other data structures of the underlying Map.


Public Types

typedef spec::Handle  Handle
  Entry Handle definition.
typedef spec::View  View
  Entry View definition.
typedef spec::Holder  Holder
  Entry Holder definition.

Public Member Functions

virtual Object::Holder  setValue (Object::Holder ohValue, bool fSynthetic)=0
  Store the value corresponding to this entry.
virtual void  update (ValueUpdater::View vUpdater, Object::Holder ohValue)=0
  Update the Entry's value.
virtual bool  isPresent () const =0
  Determine if this Entry exists in the Map.
virtual void  remove (bool fSynthetic)=0
  Remove this Entry from the Map if it is present in the Map.
virtual Object::Holder  extract (ValueExtractor::View vExtractor) const =0
 

Member Function Documentation

virtual Object::Holder setValue ( Object::Holder  ohValue,
bool  fSynthetic  
) [pure virtual]

Store the value corresponding to this entry.

If the entry does not exist, then the entry will be created by invoking this method, even with a NULL value (assuming the Map supports NULL values).

Unlike the other form of setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.

Parameters:
ohValue  the new value for this Entry
fSynthetic  pass true only if the insertion into or modification of the Map should be treated as a synthetic event
Returns:
the prior value

virtual void update ( ValueUpdater::View  vUpdater,
Object::Holder  ohValue  
) [pure virtual]

Update the Entry's value.

Calling this method is semantically equivalent to:

   Object::Handle hTarget = cast<Object::Handle>(
           hEntry->getValue());
   vUpdater->update(hTarget, ohValue);
   hEntry->setValue(hTarget, false);
 
The benefit of using this method is that it may allow the Entry implementation to significantly optimize the operation, such as for purposes of delta updates and backup maintenance.
Parameters:
vUpdater  a ValueUpdater used to modify the Entry's value
ohValue  the new value to use

virtual bool isPresent (  )  const [pure virtual]

Determine if this Entry exists in the Map.

If the Entry is not present, it can be created by calling setValue. If the Entry is present, it can be destroyed by calling remove.

Returns:
true iff this Entry is existent in the containing Map

virtual void remove ( bool  fSynthetic  )  [pure virtual]

Remove this Entry from the Map if it is present in the Map.

This method supports both the operation corresponding to Map::remove as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to calling remove(getKey()) on the containing Map.

Parameters:
fSynthetic  pass true only if the removal from the Map should be treated as a synthetic event

The documentation for this class was generated from the following file:
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.