| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler > Class Template Reference

Generic Accumulator, templated by. More...

`#include <GaudiKernel/Counters.h>`

Inheritance diagram for Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >:
[legend]

## Public Types
using | OutputType = std::decay_t< std::result_of_t< OutputTransform(InnerType)> >

## Public Member Functions
GenericAccumulator | operator+= (const InputType by)
| GenericAccumulator ()
template<typename... Args>
| GenericAccumulator (std::in_place_t, Args &&... args)
| GenericAccumulator (const GenericAccumulator &other)
GenericAccumulator & | operator= (const GenericAccumulator &other)
OutputType | value () const
void | reset ()
template<atomicity ato, typename VH >
void | mergeAndReset (GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > &&other)

## Protected Member Functions
void | reset (InnerType in)

## Private Attributes
ValueHandler::InternalType | m_value

## Friends
template<typename , typename , atomicity , typename , typename , typename >
class | GenericAccumulator

## Detailed Description

### template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>
class Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >

Generic Accumulator, templated by.

- InputType : the type of input data coming to this Accumulator
- InnerType : the type of the accumulated value. May be different from InputType, e.g. for a pure counter where InputType is double and InnerType is unsigned long
- Atomicity : the desired atomicity : none or full
- InputTransform : a function to be applied to the values pushed in
  - default to identity
  - other typical functions : square for a sumn of squares, constant 1 for a count
- OutputTransform : a function to be applied to returned value
  - default to identity
  - one could think of sqrt for and RMS accumulator, InputTransform begin square
- ValueHandler : the handler of the internal value, that is a functor providing :
  - the way to increment the internal value (e.g. +, min, max) as the operator()
  - the type of the internal value (typically Arithmetic or std::atomic<Arithmetic>)
  - the default value for the internal type

Definition at line 337 of file Counters.h.

## Member Typedef Documentation

## ◆ OutputType

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

using Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::OutputType = std::decay_t<std::result_of_t<OutputTransform( InnerType )> >

Definition at line 342 of file Counters.h.

## Constructor & Destructor Documentation

## ◆ GenericAccumulator() [1/3]

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::GenericAccumulator | ( |  | ) |
| inline

Definition at line 347 of file Counters.h.

347 : m_value( ValueHandler::DefaultValue() ) {}
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## ◆ GenericAccumulator() [2/3]

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>
template<typename... Args>

Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::GenericAccumulator | ( | std::in_place_t | ,
|  | Args &&... | args
| ) |  |
| inline

Definition at line 349 of file Counters.h.

349 : m_value( std::forward<Args>( args )... ) {}
gaudirun.args
args
Definition: gaudirun.py:307
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## ◆ GenericAccumulator() [3/3]

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::GenericAccumulator | ( | const GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler > & | other | ) |
| inline

Definition at line 350 of file Counters.h.

350 : m_value( ValueHandler::getValue( other.m_value ) ) {}
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## Member Function Documentation

## ◆ mergeAndReset()

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>
template<atomicity ato, typename VH >

void Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::mergeAndReset | ( | GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > && | other | ) |
| inline

Definition at line 358 of file Counters.h.

358 {
359 ValueHandler::merge( m_value, VH::exchange( other.m_value, VH::DefaultValue() ) );
360 }
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:420
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## ◆ operator+=()

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

GenericAccumulator Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::operator+= | ( | const InputType | by | ) |
| inline

Definition at line 343 of file Counters.h.

343 {
344 ValueHandler::merge( m_value, InputTransform{}( by ) );
345 return *this;
346 }
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:420
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## ◆ operator=()

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

GenericAccumulator& Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::operator= | ( | const GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler > & | other | ) |
| inline

Definition at line 351 of file Counters.h.

351 {
352 m_value = ValueHandler::getValue( other.m_value );
353 return *this;
354 }
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## ◆ reset() [1/2]

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

void Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::reset | ( |  | ) |
| inline

Definition at line 356 of file Counters.h.

356 { reset( ValueHandler::DefaultValue() ); }
Gaudi::Accumulators::GenericAccumulator::reset
void reset()
Definition: Counters.h:356

## ◆ reset() [2/2]

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

void Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::reset | ( | InnerType | in | ) |
| inline protected

Definition at line 363 of file Counters.h.

363 { m_value = std::move( in ); }
std::move
T move(T... args)
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## ◆ value()

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

OutputType Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::value | ( |  | ) | const
| inline

Definition at line 355 of file Counters.h.

355 { return OutputTransform{}( ValueHandler::getValue( m_value ) ); }
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Counters.h:366

## Friends And Related Function Documentation

## ◆ GenericAccumulator

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>
template<typename , typename , atomicity , typename , typename , typename >

friend class GenericAccumulator
| friend

Definition at line 339 of file Counters.h.

## Member Data Documentation

## ◆ m_value

template<typename InputType, typename InnerType, atomicity Atomicity = atomicity::full, typename InputTransform = Identity, typename OutputTransform = Identity, typename ValueHandler = Adder<InnerType, Atomicity>>

ValueHandler::InternalType Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >::m_value
| private

Definition at line 366 of file Counters.h.

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

- GaudiKernel/GaudiKernel/Counters.h