#include <coherence/util/filter/ExtractorFilter.hpp>
Inherits Object, EntryFilter, and PortableObject.
Inherited by ComparisonFilter, and ValueChangeEventFilter.
Public Types | ||||
typedef spec::Handle | Handle | |||
ExtractorFilter Handle definition. | ||||
typedef spec::View | View | |||
ExtractorFilter View definition. | ||||
typedef spec::Holder | Holder | |||
ExtractorFilter Holder definition. | ||||
Public Member Functions | ||||
virtual bool | evaluateEntry (Map::Entry::View vEntry) const | |||
Apply the test to a Map::Entry.
| ||||
virtual bool | evaluate (Object::View v) const | |||
Apply the test to the object.
| ||||
virtual void | readExternal (PofReader::Handle hIn) | |||
virtual void | writeExternal (PofWriter::Handle hOut) const | |||
virtual TypedHandle < const String > | toString () const | |||
Output a human-readable description of this Object to the given stream. Note that when overriding this method the return type must be TypedHandle<const String> rather then String::View. These two types are assignment compatible but not equivalent and declaring the override with String::View will not be a compatible override. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toString method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents and is generally how toString() will be implemented.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::View vs = COH_TO_STRING(vKey << " = " << vValue); The COH_TO_STRING macro is also the most common way to implement the toString method. For example:
virtual TypedHandle<const String> Person::toString() const { return COH_TO_STRING("Name: " << f_sName << " SSN: " << f_nSSN); }
| ||||
virtual ValueExtractor::View | getValueExtractor () const | |||
Obtain the ValueExtractor used by this filter. | ||||
Static Public Attributes | ||||
static const size32_t | eval_cost | |||
The evaluation cost as a factor to the single index access operation. | ||||
Protected Member Functions | ||||
ExtractorFilter () | ||||
Default constructor (necessary for the PortableObject interface). | ||||
ExtractorFilter (ValueExtractor::View vExtractor) | ||||
Construct a ExtractorFilter for a given ValueExtractor. | ||||
virtual bool | evaluateExtracted (Object::View vExtracted) const =0 | |||
Evaluate the specified extracted value. | ||||
virtual Object::View | extract (Object::View v) const | |||
Get the result of ValueExtractor invocation. | ||||
Protected Attributes | ||||
FinalView < ValueExtractor > | f_vExtractor | |||
The ValueExtractor used by this filter. |
ExtractorFilter | ( | ValueExtractor::View | vExtractor | ) | [protected] |
Construct a ExtractorFilter for a given ValueExtractor.
vExtractor | the ValueExtractor to use by this filter |
virtual bool evaluateExtracted | ( | Object::View | vExtracted | ) | const [protected, pure virtual] |
Evaluate the specified extracted value.
vExtracted | an extracted value to evaluate |
Implemented in ContainsAllFilter, ContainsAnyFilter, ContainsFilter, EqualsFilter, GreaterEqualsFilter, GreaterFilter, InFilter, LessEqualsFilter, LessFilter, LikeFilter, NotEqualsFilter, and ValueChangeEventFilter.
virtual Object::View extract | ( | Object::View | v | ) | const [protected, virtual] |
Get the result of ValueExtractor invocation.
v | the object on which to invoke the ValueExtractor; must not be NULL |
virtual ValueExtractor::View getValueExtractor | ( | ) | const [virtual] |
const size32_t eval_cost [static] |
The evaluation cost as a factor to the single index access operation.