Processor Class Reference

Protocol class that defines Processor interface. More...

#include "keyvalue/mngt/Processor.h"

Inheritance diagram for Processor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual const char * getName () const =0
 Gets Processor's name.
virtual value::Result getResult (const DataSet &data) const =0
 Gets result of processing a DataSet.
virtual value::Result getResult (const value::Variant &data) const =0
 Gets result of processing a value::Variant.

Detailed Description

Protocol class that defines Processor interface.


Member Function Documentation

virtual const char* getName (  )  const [pure virtual]

Gets Processor's name.

Returns:
The name.

Implemented in Builder< ObjectType >, and Calculator< Tag >.

virtual value::Result getResult ( const DataSet data  )  const [pure virtual]

Gets result of processing a DataSet.

Parameters:
data : DataSet to be processed.

This is a low level method which bypasses the memoization technique implemented by DataSet (see DataSet::mustUpdate()). Therefore, if processor is a Processor and data is a DataSet, then rather than processor.getResult(data); call data.process(processor);

processor.getResult(const DataSet& data) call data.process(processor).

Returns:
The result.

Implemented in Builder< ObjectType >, and Calculator< Tag >.

virtual value::Result getResult ( const value::Variant data  )  const [pure virtual]

Gets result of processing a value::Variant.

In general, the data that processors need to perform their duties is so rich that must be stored in a DataSet. Nevertheless, in some particular cases, a single value::Variant might be enough. For instance, consider a builder that creates a curve given a few points on it. Normally, this processor needs the set of points together with interpolator and extrapolator methods. In this general case, a DataSet is necessary to hold all this information. However, when the curve is known to be constant, then a single number - the constant - is enough to build the whole curve. Rather than creating a DataSet to store a single double value, it would be more convenient if the processor could accept just this value (or more generally, a value::Variant). That is the reason for this method.

Parameters:
data : value::Variant to be processed.
Returns:
The result.

Implemented in Builder< ObjectType >, and Calculator< Tag >.


Generated on Sat Mar 20 15:08:30 2010 for KeyValue by  doxygen 1.6.1