StreamBase C++ API  7.6.2dev
sb::PluginAggregate Class Referenceabstract

A plugin aggregate function. More...

#include <PluginAggregate.hpp>

Inheritance diagram for sb::PluginAggregate:

Public Member Functions

virtual ~PluginAggregate ()
 Virtual destructor. More...
 
virtual void typecheck (const Schema &arg_types)
 Check to make sure the argument types are valid for this aggregate function. More...
 
virtual void initialize ()=0
 Initialize any window state. More...
 
virtual void increment (const Tuple &args)=0
 Add the values passed as parameters to the window state. More...
 
virtual void calculate (Tuple &retval)=0
 Calculate the value of the aggregate over the values in the window. More...
 
virtual void release ()
 Clear internal state. More...
 
virtual std::string save ()
 Return a binary string containing the checkpoint state of this object. More...
 
virtual void load (std::string data)
 Recover the state of this object from the argument, a binary string that was returned by a previous invocation of save() More...
 

Detailed Description

A plugin aggregate function.

Constructor & Destructor Documentation

virtual sb::PluginAggregate::~PluginAggregate ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

virtual void sb::PluginAggregate::calculate ( Tuple retval)
pure virtual

Calculate the value of the aggregate over the values in the window.

initialize() will be called first. No guarantee that increment() will ever be called.

virtual void sb::PluginAggregate::increment ( const Tuple args)
pure virtual

Add the values passed as parameters to the window state.

initialize() will be called first.

virtual void sb::PluginAggregate::initialize ( )
pure virtual

Initialize any window state.

Clear the window values, if any. Instances of PluginAggregate may be reused for multiple windows.

virtual void sb::PluginAggregate::load ( std::string  data)
inlinevirtual

Recover the state of this object from the argument, a binary string that was returned by a previous invocation of save()

virtual void sb::PluginAggregate::release ( )
inlinevirtual

Clear internal state.

This method is called after this use of the aggregate is finished.

virtual std::string sb::PluginAggregate::save ( )
inlinevirtual

Return a binary string containing the checkpoint state of this object.

This string will be passed to the load() method if a checkpoint is loaded.

virtual void sb::PluginAggregate::typecheck ( const Schema arg_types)
inlinevirtual

Check to make sure the argument types are valid for this aggregate function.

Parameters
arg_typesThe types of the arguments to this function.
Returns
the type of the return value.
Exceptions
TypecheckExceptionif the argument types are not appropriate.

The documentation for this class was generated from the following file: