ATLAS Offline Software
Loading...
Searching...
No Matches
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.
template<typename F, typename R = decltype(std::declval<F>()(std::declval<I>())), typename T = R>
void add (const std::string &name, const F func, const T &def=T(), Compression comp=Compression::STANDARD)
 overload to cast lambdas into functions
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 129 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 155 of file Writer.h.

◆ input_type

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

Definition at line 153 of file Writer.h.

Member Function Documentation

◆ add() [1/2]

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

overload to cast lambdas into functions

Definition at line 145 of file Writer.h.

146 {
148 }
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.
Definition Writer.h:165

◆ 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 165 of file Writer.h.

169 {
170 if (m_used.count(name)) {
171 throw std::logic_error("tried to insert '" + name + "' twice");
172 }
173 m_consumers.push_back(
175 m_used.insert(name);
176 }
std::vector< SharedConsumer< I > > m_consumers
Definition Writer.h:158
std::set< std::string > m_used
Definition Writer.h:159

◆ getConsumers()

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

Definition at line 179 of file Writer.h.

179 {
180 return m_consumers;
181 }

Member Data Documentation

◆ m_consumers

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

Definition at line 158 of file Writer.h.

◆ m_used

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

Definition at line 159 of file Writer.h.


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