The Gaudi Framework  master (37c0b60a)
Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args > Class Template Reference

Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-safe Accumulator for all previous updates in one go. More...

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

Inheritance diagram for Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >:
Collaboration diagram for Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >:

Public Member Functions

 Buffer ()=delete
 
 Buffer (prime_type &p)
 
 Buffer (const Buffer &)=delete
 
void operator= (const Buffer &)=delete
 
 Buffer (Buffer &&other)
 
void push ()
 
 ~Buffer ()
 

Private Types

using prime_type = ContainedAccumulator< Atomicity, Args... >
 
using base_type = ContainedAccumulator< atomicity::none, Args... >
 

Private Attributes

prime_typem_prime = nullptr
 

Detailed Description

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
class Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >

Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-safe Accumulator for all previous updates in one go.

It is templated by the basic accumulator type and has same interface

See also
Gaudi::Accumulators for detailed documentation

Definition at line 849 of file Accumulators.h.

Member Typedef Documentation

◆ base_type

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
using Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::base_type = ContainedAccumulator<atomicity::none, Args...>
private

Definition at line 851 of file Accumulators.h.

◆ prime_type

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
using Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::prime_type = ContainedAccumulator<Atomicity, Args...>
private

Definition at line 850 of file Accumulators.h.

Constructor & Destructor Documentation

◆ Buffer() [1/4]

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::Buffer ( )
delete

◆ Buffer() [2/4]

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::Buffer ( prime_type p)
inline

Definition at line 855 of file Accumulators.h.

855 : base_type( construct_empty, p ), m_prime( &p ) {}

◆ Buffer() [3/4]

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::Buffer ( const Buffer< ContainedAccumulator, Atomicity, Args > &  )
delete

◆ Buffer() [4/4]

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::Buffer ( Buffer< ContainedAccumulator, Atomicity, Args > &&  other)
inline

Definition at line 858 of file Accumulators.h.

858 : base_type( std::move( other ) ), m_prime( other.m_prime ) { other.m_prime = nullptr; }

◆ ~Buffer()

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::~Buffer ( )
inline

Definition at line 862 of file Accumulators.h.

862 { push(); }

Member Function Documentation

◆ operator=()

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
void Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::operator= ( const Buffer< ContainedAccumulator, Atomicity, Args > &  )
delete

◆ push()

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
void Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::push ( )
inline

Definition at line 859 of file Accumulators.h.

859  {
860  if ( m_prime ) { m_prime->mergeAndReset( static_cast<base_type&>( *this ) ); }
861  }

Member Data Documentation

◆ m_prime

template<template< atomicity Ato, typename... Int > class ContainedAccumulator, atomicity Atomicity, typename... Args>
prime_type* Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >::m_prime = nullptr
private

Definition at line 865 of file Accumulators.h.


The documentation for this class was generated from the following file:
Gaudi::Accumulators::Buffer::push
void push()
Definition: Accumulators.h:859
std::move
T move(T... args)
Gaudi::Accumulators::Buffer::base_type
ContainedAccumulator< atomicity::none, Args... > base_type
Definition: Accumulators.h:851
Gaudi::Accumulators::Buffer::m_prime
prime_type * m_prime
Definition: Accumulators.h:865
Gaudi::Accumulators::construct_empty
constexpr construct_empty_t construct_empty
Definition: Accumulators.h:449