Yggdrasill  0.2
Public Types | Public Member Functions | List of all members
ygg::CombinerPack< KeyT, AggValueT, Combiners > Class Template Reference

This class represents the pack of combiners associated with every node of a Dynamic Segment Tree. More...

#include <dynamic_segment_tree.hpp>

Public Types

using MyType = CombinerPack< KeyT, AggValueT, Combiners... >
 
using pack = std::tuple< Combiners... >
 

Public Member Functions

bool rebuild (KeyT my_point, const MyType *left_child, AggValueT left_edge_val, const MyType *right_child, AggValueT right_edge_val)
 Rebuilds all combiners at this node from its children's combiners. More...
 
bool collect_left (KeyT my_point, const MyType *left_child_combiner, AggValueT edge_val)
 
bool collect_right (KeyT my_point, const MyType *right_child_combiner, AggValueT edge_val)
 
bool traverse_left_edge_up (KeyT new_point, AggValueT edge_val)
 
bool traverse_right_edge_up (KeyT new_point, AggValueT edge_val)
 
template<class Combiner >
Combiner::ValueT get () const
 Returns the combined value of a combiner contained in this CombinerPack. More...
 
template<class Combiner >
const Combiner & get_combiner () const
 Returns a combiner contained in this CombinerPack. More...
 

Detailed Description

template<class KeyT, class AggValueT, class... Combiners>
class ygg::CombinerPack< KeyT, AggValueT, Combiners >

This class represents the pack of combiners associated with every node of a Dynamic Segment Tree.

A DynamicSegmentTree can have multiple combiners associated with each node. See TODO for details. Every combiner allows to retrieve a different combined metric (such as maximum, minimum, …) of the aggregate values over arbitrary ranges in the Dynamic Segment Tree.

Template Parameters
KeyTThe type of the interval borders
AggValueTThe type of the aggregate values in your DynamicSegmentTree
CombinersA list of combiner classes

Member Function Documentation

◆ get()

template<class KeyT , class AggValueT , class... Combiners>
template<class Combiner >
Combiner::ValueT ygg::CombinerPack< KeyT, AggValueT, Combiners >::get ( ) const

Returns the combined value of a combiner contained in this CombinerPack.

Template Parameters
CombinerThe class of the combiner that you want the combined value of
Returns
The combined value of the combiner specified in the Combiner template parameter

◆ get_combiner()

template<class KeyT , class AggValueT , class... Combiners>
template<class Combiner >
const Combiner& ygg::CombinerPack< KeyT, AggValueT, Combiners >::get_combiner ( ) const

Returns a combiner contained in this CombinerPack.

Template Parameters
CombinerThe class of the combiner that you want
Returns
The combiner specified in the Combiner template parameter

◆ rebuild()

template<class KeyT , class AggValueT , class... Combiners>
bool ygg::CombinerPack< KeyT, AggValueT, Combiners >::rebuild ( KeyT  my_point,
const MyType left_child,
AggValueT  left_edge_val,
const MyType right_child,
AggValueT  right_edge_val 
)

Rebuilds all combiners at this node from its children's combiners.

This method calls the rebuild() method on all combiners attached to this node with the respective combined values from the left / right child.

Parameters
my_pointThe point of the node this CombinerPack belongs to
left_childThe CombinerPack of the left child (or nullptr)
left_edge_valThe agg_left value of this node
right_childThe CombinerPack of the right child (or nullptr)
right_edge_valThe agg_right value of this node
Returns
TODO IGNORED

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