HepMC3 event record library: ReaderMT< T, m_number_of_threads > Class Template Reference

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 >:
[legend]
Collaboration diagram for ReaderMT< T, m_number_of_threads >:
[legend]

## 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< GenRunInfo > | run_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< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ ReaderMT()

template<class T, size_t m_number_of_threads>

ReaderMT | ( | const std::string & | filename | ) |
| inline

Constructor.

Definition at line 42 of file ReaderMT.h.

References m_events, m_go_try_cache, m_readers, and m_threads.

## ◆ ~ReaderMT()

template<class T, size_t m_number_of_threads>

~ReaderMT | ( |  | ) |
| inline

Destructor.

Definition at line 52 of file ReaderMT.h.

References m_events, m_readers, and m_threads.

## Member Function Documentation

## ◆ close()

template<class T, size_t m_number_of_threads>

void close | ( |  | ) |
| inlineoverridevirtual

close

Implements Reader.

Definition at line 102 of file ReaderMT.h.

References m_readers.

## ◆ failed()

template<class T, size_t m_number_of_threads>

bool failed | ( |  | ) |
| inlineoverridevirtual

failed

Implements Reader.

Definition at line 95 of file ReaderMT.h.

References m_events, m_go_try_cache, and m_readers.

## ◆ 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 m_options.

## ◆ read_event()

template<class T, size_t m_number_of_threads>

bool read_event | ( | GenEvent & | evt | ) |
| inlineoverridevirtual

event reading

Implements Reader.

Definition at line 62 of file ReaderMT.h.

References m_events, m_go_try_cache, m_readers, m_threads, and read_function().

## ◆ read_function()

template<class T, size_t m_number_of_threads>

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 ReaderGZ< T >, and ReaderPlugin.

Examples
  LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References 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 m_options.

## ◆ set_run_info()

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

Set the global GenRunInfo object.

Reimplemented in ReaderGZ< T >, and ReaderPlugin.

Definition at line 56 of file Reader.h.

References m_run_info.

## ◆ skip()

template<class T, size_t m_number_of_threads>

bool skip | ( | const int |  | ) |
| inlineoverridevirtual

skip

Not implemented

Reimplemented from Reader.

Definition at line 58 of file ReaderMT.h.

## Field Documentation

## ◆ m_events

template<class T, size_t m_number_of_threads>

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

Vector of events.

Definition at line 31 of file ReaderMT.h.

## ◆ m_go_try_cache

template<class T, size_t m_number_of_threads>

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

template<class T, size_t m_number_of_threads>

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

template<class T, size_t m_number_of_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:

- ReaderMT.h