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

145 {
147 }
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:164

◆ 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(
174 m_used.insert(name);
175 }
std::vector< SharedConsumer< I > > m_consumers
Definition Writer.h:157
std::set< std::string > m_used
Definition Writer.h:158

◆ getConsumers()

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

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: