ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
H5Utils::Consumers< I > Class Template Reference

#include <Writer.h>

Collaboration diagram for H5Utils::Consumers< I >:

Public Types

using input_type = I
 
template<typename T >
using function_type = std::function< T(I)>
 

Public Member Functions

template<typename T >
void add (const std::string &name, const std::function< T(I)> &, const T &default_value=T(), Compression=Compression::STANDARD)
 This should be the only method you need in this class. More...
 
template<typename T , typename F , typename R = decltype(std::declval<F>()(std::declval<I>()))>
void add (const std::string &name, const F func, const T &def=T(), Compression comp=Compression::STANDARD)
 overload to cast lambdas into functions More...
 
const std::vector< SharedConsumer< I > > & getConsumers () const
 

Private Attributes

std::vector< SharedConsumer< I > > m_consumers
 
std::set< std::string > m_used
 

Detailed Description

template<typename I>
class H5Utils::Consumers< I >

Definition at line 128 of file Writer.h.

Member Typedef Documentation

◆ function_type

template<typename I >
template<typename T >
using H5Utils::Consumers< I >::function_type = std::function<T(I)>

Definition at line 154 of file Writer.h.

◆ input_type

template<typename I >
using H5Utils::Consumers< I >::input_type = I

Definition at line 152 of file Writer.h.

Member Function Documentation

◆ add() [1/2]

template<typename I >
template<typename T , typename F , typename R = decltype(std::declval<F>()(std::declval<I>()))>
void H5Utils::Consumers< I >::add ( const std::string &  name,
const func,
const T &  def = T(),
Compression  comp = Compression::STANDARD 
)
inline

overload to cast lambdas into functions

Definition at line 144 of file Writer.h.

145  {
146  add<R>(name, std::function<R(I)>(func), R(def), comp);
147  }

◆ add() [2/2]

template<typename I >
template<typename T >
void H5Utils::Consumers< I >::add ( const std::string &  name,
const std::function< T(I)> &  fun,
const T &  default_value = T(),
Compression  comp = Compression::STANDARD 
)

This should be the only method you need in this class.

Definition at line 164 of file Writer.h.

168  {
169  if (m_used.count(name)) {
170  throw std::logic_error("tried to insert '" + name + "' twice");
171  }
172  m_consumers.push_back(
173  std::make_shared<internal::DataConsumer<T,I>>(name, fun, def_val, comp));
174  m_used.insert(name);
175  }

◆ getConsumers()

template<typename I >
const std::vector< SharedConsumer< I > > & H5Utils::Consumers< I >::getConsumers

Definition at line 178 of file Writer.h.

178  {
179  return m_consumers;
180  }

Member Data Documentation

◆ m_consumers

template<typename I >
std::vector<SharedConsumer<I> > H5Utils::Consumers< I >::m_consumers
private

Definition at line 157 of file Writer.h.

◆ m_used

template<typename I >
std::set<std::string> H5Utils::Consumers< I >::m_used
private

Definition at line 158 of file Writer.h.


The documentation for this class was generated from the following file:
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:23
generateReferenceFile.fun
fun
Definition: generateReferenceFile.py:18
H5Utils::internal::DataConsumer
implementation for variable filler
Definition: Writer.h:61
H5Utils::Consumers::m_consumers
std::vector< SharedConsumer< I > > m_consumers
Definition: Writer.h:157
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
H5Utils::Consumers::m_used
std::set< std::string > m_used
Definition: Writer.h:158
I
#define I(x, y, z)
Definition: MD5.cxx:116