The Gaudi Framework  v37r0 (b608885e)
Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases > Class Template Reference

AccumulatorSet is an Accumulator that holds a set of Accumulators templated by same Arithmetic and Atomicity and increase them altogether. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators.h>

Inheritance diagram for Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >:
Collaboration diagram for Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >:

Public Types

using InputType = InputTypeT
 
using OutputType = std::tuple< typename Bases< Atomicity, Arithmetic >::OutputType... >
 
using InternalType = std::tuple< typename Bases< Atomicity, Arithmetic >::InternalType... >
 
using JSONStringEntriesType = std::tuple< typename Bases< Atomicity, Arithmetic >::JSONStringEntriesType... >
 

Public Member Functions

constexpr AccumulatorSet ()=default
 
template<atomicity ato>
 AccumulatorSet (construct_empty_t, const AccumulatorSet< Arithmetic, ato, InputType, Bases... > &)
 constructor of an empty AccumulatorSet, copying the (non existent) config from another GenericAccumulator More...
 
AccumulatorSetoperator+= (const InputType by)
 
OutputType value () const
 
void reset ()
 
template<atomicity Ato>
void mergeAndReset (AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &other)
 
template<atomicity Ato>
void operator+ (AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &&other)
 

Protected Member Functions

 AccumulatorSet (const InternalType &t)
 
void reset (const InternalType &t)
 

Static Protected Member Functions

static InternalType extractJSONData (const nlohmann::json &j, const JSONStringEntriesType &entries)
 

Static Private Member Functions

template<size_t... Is>
static InternalType extractJSONDataHelper (const nlohmann::json &j, const JSONStringEntriesType &entries, std::index_sequence< Is... >)
 
static InternalType extractJSONDataHelper (const nlohmann::json &j, typename Bases< Atomicity, Arithmetic >::JSONStringEntriesType... entries)
 

Detailed Description

template<typename Arithmetic, atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
class Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >

AccumulatorSet is an Accumulator that holds a set of Accumulators templated by same Arithmetic and Atomicity and increase them altogether.

See also
Gaudi::Accumulators for detailed documentation

Definition at line 494 of file Accumulators.h.

Member Typedef Documentation

◆ InputType

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
using Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::InputType = InputTypeT

Definition at line 496 of file Accumulators.h.

◆ InternalType

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
using Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::InternalType = std::tuple<typename Bases<Atomicity, Arithmetic>::InternalType...>

Definition at line 498 of file Accumulators.h.

◆ JSONStringEntriesType

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
using Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::JSONStringEntriesType = std::tuple<typename Bases<Atomicity, Arithmetic>::JSONStringEntriesType...>

Definition at line 499 of file Accumulators.h.

◆ OutputType

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
using Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::OutputType = std::tuple<typename Bases<Atomicity, Arithmetic>::OutputType...>

Definition at line 497 of file Accumulators.h.

Constructor & Destructor Documentation

◆ AccumulatorSet() [1/3]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
constexpr Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::AccumulatorSet ( )
constexprdefault

◆ AccumulatorSet() [2/3]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
template<atomicity ato>
Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::AccumulatorSet ( construct_empty_t  ,
const AccumulatorSet< Arithmetic, ato, InputType, Bases... > &   
)
inline

constructor of an empty AccumulatorSet, copying the (non existent) config from another GenericAccumulator

Definition at line 503 of file Accumulators.h.

504  : AccumulatorSet() {}

◆ AccumulatorSet() [3/3]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::AccumulatorSet ( const InternalType t)
inlineprotected

Definition at line 521 of file Accumulators.h.

521 : AccumulatorSet() { reset( t ); }

Member Function Documentation

◆ extractJSONData()

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
static InternalType Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::extractJSONData ( const nlohmann::json &  j,
const JSONStringEntriesType entries 
)
inlinestaticprotected

Definition at line 525 of file Accumulators.h.

525  {
526  return extractJSONDataHelper( j, entries, std::index_sequence_for<Bases<Atomicity, Arithmetic>...>{} );
527  }

◆ extractJSONDataHelper() [1/2]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
template<size_t... Is>
static InternalType Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::extractJSONDataHelper ( const nlohmann::json &  j,
const JSONStringEntriesType entries,
std::index_sequence< Is... >   
)
inlinestaticprivate

Definition at line 531 of file Accumulators.h.

532  {
533  return extractJSONDataHelper( j, std::get<Is>( entries )... );
534  }

◆ extractJSONDataHelper() [2/2]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
static InternalType Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::extractJSONDataHelper ( const nlohmann::json &  j,
typename Bases< Atomicity, Arithmetic >::JSONStringEntriesType...  entries 
)
inlinestaticprivate

Definition at line 536 of file Accumulators.h.

537  {
538  return { Bases<Atomicity, Arithmetic>::extractJSONData( j, entries )... };
539  }

◆ mergeAndReset()

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
template<atomicity Ato>
void Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::mergeAndReset ( AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &  other)
inline

Definition at line 512 of file Accumulators.h.

512  {
513  ( Bases<Atomicity, Arithmetic>::mergeAndReset( static_cast<Bases<Ato, Arithmetic>&>( other ) ), ... );
514  }

◆ operator+()

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
template<atomicity Ato>
void Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::operator+ ( AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &&  other)
inline

Definition at line 516 of file Accumulators.h.

516  {
517  ( Bases<Atomicity, Arithmetic>::operator+( static_cast<Bases<Ato, Arithmetic>&&>( other ) ), ... );
518  }

◆ operator+=()

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
AccumulatorSet& Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::operator+= ( const InputType  by)
inline

Definition at line 505 of file Accumulators.h.

505  {
506  ( Bases<Atomicity, Arithmetic>::operator+=( by ), ... );
507  return *this;
508  }

◆ reset() [1/2]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
void Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::reset ( )
inline

Definition at line 510 of file Accumulators.h.

◆ reset() [2/2]

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
void Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::reset ( const InternalType t)
inlineprotected

Definition at line 522 of file Accumulators.h.

522  {
523  std::apply( [this]( const auto&... i ) { ( this->Bases<Atomicity, Arithmetic>::reset( i ), ... ); }, t );
524  }

◆ value()

template<typename Arithmetic , atomicity Atomicity, typename InputTypeT = Arithmetic, template< atomicity, typename > class... Bases>
OutputType Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >::value ( ) const
inline

Definition at line 509 of file Accumulators.h.

509 { return std::make_tuple( Bases<Atomicity, Arithmetic>::value()... ); }

The documentation for this class was generated from the following file:
std::make_tuple
T make_tuple(T... args)
Gaudi::Accumulators::AccumulatorSet::reset
void reset()
Definition: Accumulators.h:510
bug_34121.t
t
Definition: bug_34121.py:30
Gaudi::Monitoring::reset
void reset(T &)
default (empty) implementation of reset method for types stored into an entity
Definition: MonitoringHub.h:75
ProduceConsume.j
j
Definition: ProduceConsume.py:101
Gaudi::Accumulators::AccumulatorSet::extractJSONDataHelper
static InternalType extractJSONDataHelper(const nlohmann::json &j, const JSONStringEntriesType &entries, std::index_sequence< Is... >)
Definition: Accumulators.h:531
Gaudi::Accumulators::AccumulatorSet::AccumulatorSet
constexpr AccumulatorSet()=default
Gaudi::operator+
decltype(auto) operator+(const T &v, const Property< TP, V, H > &p)
implemantation of (value + property)
Definition: Property.h:443
Gaudi::Monitoring::mergeAndReset
void mergeAndReset(T &, T &)
default (empty) implementation of mergeAndReset method for types stored into an entity
Definition: MonitoringHub.h:79