#include <coherence/util/aggregator/AbstractAggregator.hpp>
Inherits Object, PortableObject, and InvocableMap::ParallelAwareAggregator.
Inherited by AbstractComparableAggregator, AbstractFloat64Aggregator, AbstractInteger64Aggregator, and DistinctValues.
Public Types | ||||
typedef spec::Handle | Handle | |||
AbstractAggregator Handle definition. | ||||
typedef spec::View | View | |||
AbstractAggregator View definition. | ||||
typedef spec::Holder | Holder | |||
AbstractAggregator Holder definition. | ||||
Public Member Functions | ||||
virtual Object::Holder | aggregate (Set::View vSetEntries) | |||
Process a set of InvocableMap::Entry objects in order to produce an aggregated result.
| ||||
virtual InvocableMap::EntryAggregator::Handle | getParallelAggregator () | |||
Get an aggregator that can take the place of this aggregator in situations in which the InvocableMap can aggregate in parallel.
| ||||
virtual Object::Holder | aggregateResults (Collection::View vCollResults) | |||
Aggregate the results of the parallel aggregations.
| ||||
virtual void | readExternal (PofReader::Handle hIn) | |||
virtual void | writeExternal (PofWriter::Handle hOut) const | |||
virtual bool | equals (Object::View v) const | |||
virtual size32_t | hashCode () const | |||
Return a hash code value for the Object. This method is supported for the benefit of hash-based containers.
The general contract of
The default implementation is identity based.
| ||||
virtual void | toStream (std::ostream &out) const | |||
Output a human-readable description of this Object to the given stream. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream 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.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
| ||||
virtual ValueExtractor::View | getValueExtractor () const | |||
Determine the ValueExtractor whose values this aggregator is aggregating. | ||||
Protected Member Functions | ||||
virtual void | init (bool fFinal)=0 | |||
Initialize the aggregation result. | ||||
virtual void | process (Object::View vO, bool fFinal)=0 | |||
Incorporate one aggregatable value into the result. | ||||
virtual Object::Holder | finalizeResult (bool fFinal)=0 | |||
Obtain the result of the aggregation. | ||||
Protected Attributes | ||||
bool | m_fParallel | |||
Set to true if this aggregator realizes that it is going to be used in parallel. | ||||
MemberView < ValueExtractor > | m_vExtractor | |||
The ValueExtractor that obtains the value to aggregate from the value that is stored in the Map. |
virtual void init | ( | bool | fFinal | ) | [protected, pure virtual] |
Initialize the aggregation result.
fFinal | true is passed if the aggregation process that is being initialized must produce a final aggregation result; this will only be false if a parallel approach is being used and the initial (partial) aggregation process is being initialized |
Implemented in AbstractComparableAggregator, AbstractFloat64Aggregator, AbstractInteger64Aggregator, DistinctValues, Float64Average, Float64Max, Float64Min, Float64Sum, Integer64Max, Integer64Min, and Integer64Sum.
virtual void process | ( | Object::View | vO, | |
bool | fFinal | |||
) | [protected, pure virtual] |
Incorporate one aggregatable value into the result.
If the fFinal
parameter is true, the given object is a partial result (returned by an individual parallel aggregator) that should be incorporated into the final result; otherwise, the object is a value extracted from an coherence::util::InvocableMap::Entry.
vO | the value to incorporate into the aggregated result | |
fFinal | true to indicate that the given object is a partial result returned by a parallel aggregator |
Implemented in ComparableMax, ComparableMin, DistinctValues, Float64Average, Float64Max, Float64Min, Float64Sum, Integer64Max, Integer64Min, and Integer64Sum.
virtual Object::Holder finalizeResult | ( | bool | fFinal | ) | [protected, pure virtual] |
Obtain the result of the aggregation.
If the fFinal
parameter is true, the returned object must be the final result of the aggregation; otherwise, the returned object will be treated as a partial result that should be incorporated into the final result.
fFinal | true to indicate that the final result of the aggregation process should be returned; this will only be false if a parallel approach is being used |
Implemented in AbstractComparableAggregator, AbstractFloat64Aggregator, AbstractInteger64Aggregator, DistinctValues, and Float64Average.
virtual ValueExtractor::View getValueExtractor | ( | ) | const [virtual] |
Determine the ValueExtractor whose values this aggregator is aggregating.