#include <coherence/util/extractor/AbstractExtractor.hpp>
Inherited by AbstractCompositeExtractor, ConditionalExtractor, EntryExtractor, IdentityExtractor, KeyExtractor, PofExtractor, and ReflectionExtractor.
It provides common functionality that allows any extending extractor to be used as a value Comparator.
Starting with Coherence 3.5, when used to extract information that is coming from a Map, subclasses have the additional ability to operate against the Map::Entry instead of just the value. In other words, like the EntryExtractor class, this allows an extractor implementation to extract a desired value using all available information on the corresponding Map::Entry object and is intended to be used in advanced custom scenarios, when application code needs to look at both key and value at the same time or can make some very specific assumptions regarding to the implementation details of the underlying Entry object. To maintain full backwards compatibility, the default behavior remains to extract from the Value property of the Map::Entry.
Note: subclasses are responsible for initialization and POF serialization of the m_nTarget field.
Public Types | |
typedef spec::Handle | Handle |
AbstractExtractor Handle definition. | |
typedef spec::View | View |
AbstractExtractor View definition. | |
typedef spec::Holder | Holder |
AbstractExtractor Holder definition. | |
Public Member Functions | |
virtual Object::Holder | extract (Object::Holder ohTarget) const |
virtual int32_t | compareEntries (QueryMap::Entry::View vEntry1, QueryMap::Entry::View vEntry2) const |
virtual int32_t | compare (Object::View v1, Object::View v2) const |
virtual Object::Holder | extractFromEntry (Map::Entry::Holder ohEntry) const |
Extract the value from the passed Entry object. | |
virtual Object::Holder | extractOriginalFromEntry (MapTrigger::Entry::Holder ohEntry) const |
Extract the value from the "original value" of the passed Entry object. | |
virtual int32_t | getTarget () const |
Return the target of the extractor. | |
Static Public Attributes | |
static const int32_t | value |
Indicates that the extractFromEntry operation should use the Entry's value. | |
static const int32_t | key |
Indicates that the extractFromEntry operation should use the Entry's value. | |
Protected Attributes | |
int32_t | m_nTarget |
Specifies which part of the entry should be used by the extractFromEntry operation. |
virtual Object::Holder extractFromEntry | ( | Map::Entry::Holder | ohEntry | ) | const [virtual] |
Extract the value from the passed Entry object.
The returned value should follow the conventions outlined in the extract method. By overriding this method, an extractor implementation is able to extract a desired value using all available information on the corresponding Map::Entry object and is intended to be used in advanced custom scenarios, when application code needs to look at both key and value at the same time or can make some very specific assumptions regarding to the implementation details of the underlying Entry object.
ohEntry | an Entry object to extract a desired value from |
Reimplemented in PofExtractor.
virtual Object::Holder extractOriginalFromEntry | ( | MapTrigger::Entry::Holder | ohEntry | ) | const [virtual] |
Extract the value from the "original value" of the passed Entry object.
This method's conventions are exactly the same as for the extractFromEntry method.
ohEntry | an Entry object whose original value should be used to extract the desired value from |
virtual int32_t getTarget | ( | ) | const [virtual] |
Return the target of the extractor.
const int32_t value [static] |
const int32_t key [static] |
int32_t m_nTarget [protected] |
Specifies which part of the entry should be used by the extractFromEntry operation.
Legal values are value (default) or key.
Note: subclasses are responsible for initialization and POF serialization of this field.