HepMC3 event record library
Public Member Functions | Protected Attributes | Static Private Member Functions | Private Attributes
ReaderMT< T, m_number_of_threads > Class Template Reference

Detailed Description

template<class T, size_t m_number_of_threads>
class HepMC3::ReaderMT< T, m_number_of_threads >

Multithreader GenEvent I/O parsing.

Definition at line 26 of file ReaderMT.h.

#include <ReaderMT.h>

+ Inheritance diagram for ReaderMT< T, m_number_of_threads >:
+ Collaboration diagram for ReaderMT< T, m_number_of_threads >:

Public Member Functions

 ReaderMT (const std::string &filename)
 Constructor.
 
 ~ReaderMT ()
 Destructor.
 
bool skip (const int) override
 skip
 
bool read_event (GenEvent &evt) override
 event reading
 
bool failed () override
 failed
 
void close () override
 close
 
virtual std::shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object.
 
virtual void set_options (const std::map< std::string, std::string > &options)
 Set options.
 
virtual std::map< std::string, std::string > get_options () const
 Get options

 
virtual void set_run_info (std::shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object.
 

Protected Attributes

std::map< std::string, std::string > m_options
 Options.
 

Static Private Member Functions

static void read_function (std::pair< GenEvent, bool > &e, std::shared_ptr< T > r)
 The reading function.
 

Private Attributes

bool m_go_try_cache
 Flag to trigger using the cached event.
 
std::vector< std::shared_ptr< T > > m_readers
 Vector of all active readers.
 
std::vector< std::pair< GenEvent, bool > > m_events
 Vector of events.
 
std::vector< std::thread > m_threads
 
std::shared_ptr< GenRunInfom_run_info
 The global GenRunInfo object.
 

Constructor & Destructor Documentation

◆ ReaderMT()

ReaderMT ( const std::string &  filename)
inline

◆ ~ReaderMT()

~ReaderMT ( )
inline

Member Function Documentation

◆ close()

void close ( )
inlineoverridevirtual

close

Implements Reader.

Definition at line 102 of file ReaderMT.h.

References ReaderMT< T, m_number_of_threads >::m_readers.

◆ failed()

bool failed ( )
inlineoverridevirtual

◆ get_options()

virtual std::map< std::string, std::string > get_options ( ) const
inlinevirtualinherited

Get options

Reimplemented in ReaderPlugin.

Definition at line 53 of file Reader.h.

References Reader::m_options.

◆ read_event()

bool read_event ( GenEvent evt)
inlineoverridevirtual

◆ read_function()

static void read_function ( std::pair< GenEvent, bool > &  e,
std::shared_ptr< T >  r 
)
inlinestaticprivate

The reading function.

Definition at line 34 of file ReaderMT.h.

◆ run_info()

virtual std::shared_ptr< GenRunInfo > run_info ( ) const
inlinevirtualinherited

Get the global GenRunInfo object.

Reimplemented in ReaderPlugin.

Examples
LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References Reader::m_run_info.

◆ set_options()

virtual void set_options ( const std::map< std::string, std::string > &  options)
inlinevirtualinherited

Set options.

Reimplemented in ReaderPlugin.

Definition at line 51 of file Reader.h.

References Reader::m_options.

◆ set_run_info()

virtual void set_run_info ( std::shared_ptr< GenRunInfo run)
inlinevirtualinherited

Set the global GenRunInfo object.

Reimplemented in ReaderPlugin.

Definition at line 56 of file Reader.h.

References Reader::m_run_info.

◆ skip()

bool skip ( const int  )
inlineoverridevirtual

skip

Not implemented

Reimplemented from Reader.

Definition at line 58 of file ReaderMT.h.

Field Documentation

◆ m_events

std::vector< std::pair<GenEvent, bool> > m_events
private

Vector of events.

Definition at line 31 of file ReaderMT.h.

◆ m_go_try_cache

bool m_go_try_cache
private

Flag to trigger using the cached event.

Definition at line 29 of file ReaderMT.h.

◆ m_options

std::map<std::string, std::string> m_options
protectedinherited

Options.

Definition at line 60 of file Reader.h.

◆ m_readers

std::vector< std::shared_ptr<T> > m_readers
private

Vector of all active readers.

Definition at line 30 of file ReaderMT.h.

◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
privateinherited

The global GenRunInfo object.

Definition at line 63 of file Reader.h.

◆ m_threads

std::vector< std::thread > m_threads
private

Vector of threads

Definition at line 32 of file ReaderMT.h.


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