ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
ArrayAgg< T > Struct Template Reference

Aggregator implementing ARRAY_AGG; collects all non-NULL inputs into an array. More...

Inheritance diagram for ArrayAgg< T >:
Collaboration diagram for ArrayAgg< T >:

Public Member Functions

void add (const AggValue &x) override
 Incorporate one input value into the running aggregate.
 
AggValue finalize () const override
 Return the final aggregate result.
 
AggregationOperator op () const override
 Return the aggregation operator this accumulator implements.
 
ValueType resultType () const override
 Return the type of the value returned by finalize().
 
- Public Member Functions inherited from StandardAgg< T >
AggValue finalize () const override
 Return the accumulated value, or NULL if no inputs were seen.
 
ValueType inputType () const override
 Return the value type corresponding to T.
 
- Public Member Functions inherited from Aggregator
virtual ~Aggregator ()=default
 

Protected Attributes

std::vector< T > values
 Accumulated elements.
 
- Protected Attributes inherited from StandardAgg< T >
value {}
 Current accumulated value.
 
bool has = false
 true once the first non-NULL input has been seen
 

Detailed Description

template<class T>
struct ArrayAgg< T >

Aggregator implementing ARRAY_AGG; collects all non-NULL inputs into an array.

Definition at line 262 of file Aggregation.cpp.

Member Function Documentation

◆ add()

template<class T >
void ArrayAgg< T >::add ( const AggValue x)
inlineoverridevirtual

Incorporate one input value into the running aggregate.

Parameters
xInput value to add.

Implements Aggregator.

Definition at line 268 of file Aggregation.cpp.

Here is the call graph for this function:

◆ finalize()

template<class T >
AggValue ArrayAgg< T >::finalize ( ) const
inlineoverridevirtual

Return the final aggregate result.

Returns
The accumulated aggregate as an AggValue.

Implements Aggregator.

Definition at line 274 of file Aggregation.cpp.

◆ op()

template<class T >
AggregationOperator ArrayAgg< T >::op ( ) const
inlineoverridevirtual

Return the aggregation operator this accumulator implements.

Returns
The AggregationOperator enum value for this accumulator.

Implements Aggregator.

Definition at line 277 of file Aggregation.cpp.

◆ resultType()

template<class T >
ValueType ArrayAgg< T >::resultType ( ) const
inlineoverridevirtual

Return the type of the value returned by finalize().

Defaults to inputType(); override when the result type differs (e.g., AVG returns FLOAT regardless of the input type).

Returns
The ValueType of the value returned by finalize().

Reimplemented from Aggregator.

Definition at line 280 of file Aggregation.cpp.

Member Data Documentation

◆ values

template<class T >
std::vector<T> ArrayAgg< T >::values
protected

Accumulated elements.

Definition at line 264 of file Aggregation.cpp.


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