HepMC3 event record library
Public Member Functions | Protected 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)
 
bool skip (const int) override
 skip or fast forward reading of some events
 
bool read_event (GenEvent &evt) override
 Fill next event from input into evt.
 
bool failed () override
 Get file and/or stream error state.
 
void close () override
 Close file and/or stream.
 
std::shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object.
 
void set_options (const std::map< std::string, std::string > &options)
 Set options.
 
std::map< std::string, std::string > get_options () const
 Set options.
 

Protected Member Functions

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)
 

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

Definition at line 40 of file ReaderMT.h.

◆ ~ReaderMT()

~ReaderMT ( )
inline

Definition at line 49 of file ReaderMT.h.

Member Function Documentation

◆ close()

void close ( )
inlineoverridevirtual

Close file and/or stream.

Implements Reader.

Definition at line 95 of file ReaderMT.h.

References ReaderMT< T, m_number_of_threads >::m_readers.

◆ failed()

bool failed ( )
inlineoverridevirtual

◆ get_options()

std::map< std::string, std::string > get_options ( ) const
inlineinherited

Set options.

Definition at line 58 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

Definition at line 33 of file ReaderMT.h.

◆ run_info()

std::shared_ptr< GenRunInfo > run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Examples
LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References Reader::m_run_info.

◆ set_options()

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

Set options.

Definition at line 53 of file Reader.h.

References Reader::m_options.

◆ set_run_info()

void set_run_info ( std::shared_ptr< GenRunInfo run)
inlineprotectedinherited

Set the global GenRunInfo object.

Definition at line 64 of file Reader.h.

References Reader::m_run_info.

◆ skip()

bool skip ( const int  )
inlineoverridevirtual

skip or fast forward reading of some events

Not implemented

Reimplemented from Reader.

Definition at line 54 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 68 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 71 of file Reader.h.

◆ m_threads

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

Definition at line 32 of file ReaderMT.h.


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