PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
podio::TimedWriter< WrappedWriter > Class Template Reference

#include <TimedWriter.h>

Public Member Functions

template<typename... Args>
 TimedWriter (benchmark::BenchmarkRecorder &recorder, Args &&... args)
 
 ~TimedWriter ()
 
void registerForWrite (const std::string &name)
 
void writeEvent ()
 
void finish ()
 

Detailed Description

template<class WrappedWriter>
class podio::TimedWriter< WrappedWriter >

Definition at line 14 of file TimedWriter.h.

Constructor & Destructor Documentation

◆ TimedWriter()

template<class WrappedWriter >
template<typename... Args>
podio::TimedWriter< WrappedWriter >::TimedWriter ( benchmark::BenchmarkRecorder recorder,
Args &&...  args 
)
inline

Definition at line 19 of file TimedWriter.h.

19 :
20 m_start(ClockT::now()),
21 m_writer(WrappedWriter(std::forward<Args>(args)...)),
22 m_end(ClockT::now()),
23 m_recorder(recorder),
24 m_perEventTree(m_recorder.addTree("event_times", {"write_event"})) {
25 m_recorder.addTree("setup_times", {"constructor", "finish", "register_for_write"});
26 m_recorder.recordTime("setup_times", "constructor", m_end - m_start);
27 }
BenchmarkRecorderTree & addTree(const std::string &name, const std::vector< std::string > &steps)
void recordTime(const std::string &treeName, const std::string &stepName, const ClockT::duration time)

◆ ~TimedWriter()

template<class WrappedWriter >
podio::TimedWriter< WrappedWriter >::~TimedWriter ( )
inline

Definition at line 29 of file TimedWriter.h.

29 {
30 m_recorder.recordTime("setup_times", "register_for_write", m_registerTime);
31 m_recorder.Fill("setup_times");
32 }
void Fill(const std::string &treeName)

Member Function Documentation

◆ finish()

template<class WrappedWriter >
void podio::TimedWriter< WrappedWriter >::finish ( )
inline

Definition at line 47 of file TimedWriter.h.

47 {
48 m_recorder.recordTime("setup_times", "finish", benchmark::run_void_member_timed(m_writer, &WrappedWriter::finish));
49 }
ClockT::duration run_void_member_timed(Obj &obj, MemberFunc func, Args &&... args)
Definition: BenchmarkUtil.h:32

◆ registerForWrite()

template<class WrappedWriter >
void podio::TimedWriter< WrappedWriter >::registerForWrite ( const std::string &  name)
inline

Definition at line 34 of file TimedWriter.h.

34 {
35 // summing up the times it takes for all the collections to be registered
36 // here, since we do not know in advance how many collections there will be
37 // in the end
38 const auto duration = benchmark::run_void_member_timed(m_writer, &WrappedWriter::registerForWrite, name);
39 m_registerTime += duration;
40 }

◆ writeEvent()

template<class WrappedWriter >
void podio::TimedWriter< WrappedWriter >::writeEvent ( )
inline

Definition at line 42 of file TimedWriter.h.

42 {
43 m_perEventTree.recordTime("write_event", benchmark::run_void_member_timed(m_writer, &WrappedWriter::writeEvent));
44 m_perEventTree.Fill();
45 }
void recordTime(const std::string &stepName, const ClockT::duration time)

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