HepMC3 event record library: WriterPlugin Class Reference

HepMC3 event record library

Public Member Functions | Protected Attributes | Private Attributes
WriterPlugin Class Reference

## Detailed Description

GenEvent I/O parsing and serialization using external plugin.

Definition at line 23 of file WriterPlugin.h.

`#include <WriterPlugin.h>`

Inheritance diagram for WriterPlugin:
[legend]
Collaboration diagram for WriterPlugin:
[legend]

## Public Member Functions
| WriterPlugin (std::shared_ptr< std::ostream > stream, const std::string &libname, const std::string &newwriter, std::shared_ptr< HepMC3::GenRunInfo > run=std::shared_ptr< GenRunInfo >())
| Constructor to write to stream.
| WriterPlugin (std::ostream &stream, const std::string &libname, const std::string &newwriter, std::shared_ptr< HepMC3::GenRunInfo > run=std::shared_ptr< GenRunInfo >())
| Constructor to write to stream.
| WriterPlugin (const std::string &filename, const std::string &libname, const std::string &newwriter, std::shared_ptr< HepMC3::GenRunInfo > run=std::shared_ptr< GenRunInfo >())
| Constructor to write to file.
void | write_event (const GenEvent &ev) override
| Reading event.
void | close () override
| Close.
bool | failed () override
| State.
std::shared_ptr< GenRunInfo > | run_info () const override
| Get the global GenRunInfo object.
void | set_options (const std::map< std::string, std::string > &options) override
| Set options.
std::map< std::string, std::string > | get_options () const override
| Get options.
void | set_run_info (std::shared_ptr< GenRunInfo > run) override
| Set the global GenRunInfo object.
| ~WriterPlugin () override
| Destructor.

## Protected Attributes
std::map< std::string, std::string > | m_options
| options

## Private Attributes
Writer * | m_writer = nullptr
| The actual writer.
void * | dll_handle = nullptr
| library handler
std::shared_ptr< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ WriterPlugin() [1/3]

WriterPlugin | ( | std::shared_ptr< std::ostream > | stream,
|  | const std::string & | libname,
|  | const std::string & | newwriter,
|  | std::shared_ptr< HepMC3::GenRunInfo > | run = std::shared_ptr<GenRunInfo>() )

Constructor to write to stream.

Definition at line 31 of file WriterPlugin.cc.

References dll_handle, m_writer, and Writer::Writer().

## ◆ WriterPlugin() [2/3]

WriterPlugin | ( | std::ostream & | stream,
|  | const std::string & | libname,
|  | const std::string & | newwriter,
|  | std::shared_ptr< HepMC3::GenRunInfo > | run = std::shared_ptr<GenRunInfo>() )

Constructor to write to stream.

Definition at line 51 of file WriterPlugin.cc.

References dll_handle, m_writer, and Writer::Writer().

## ◆ WriterPlugin() [3/3]

WriterPlugin | ( | const std::string & | filename,
|  | const std::string & | libname,
|  | const std::string & | newwriter,
|  | std::shared_ptr< HepMC3::GenRunInfo > | run = std::shared_ptr<GenRunInfo>() )

Constructor to write to file.

Definition at line 71 of file WriterPlugin.cc.

References dll_handle, m_writer, and Writer::Writer().

## ◆ ~WriterPlugin()

~WriterPlugin | ( |  | ) |
| override

Destructor.

Definition at line 91 of file WriterPlugin.cc.

References dll_handle, and m_writer.

## Member Function Documentation

## ◆ close()

void close | ( |  | ) |
| inlineoverridevirtual

Close.

Implements Writer.

Definition at line 39 of file WriterPlugin.h.

References m_writer.

## ◆ failed()

bool failed | ( |  | ) |
| inlineoverridevirtual

State.

Implements Writer.

Definition at line 41 of file WriterPlugin.h.

References m_writer.

## ◆ get_options()

std::map< std::string, std::string > get_options | ( |  | ) | const
| inlineoverridevirtual

Get options.

Reimplemented from Writer.

Definition at line 47 of file WriterPlugin.h.

References m_writer.

## ◆ run_info()

std::shared_ptr< GenRunInfo > run_info | ( |  | ) | const
| inlineoverridevirtual

Get the global GenRunInfo object.

Reimplemented from Writer.

Definition at line 43 of file WriterPlugin.h.

References m_writer.

## ◆ set_options()

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

Set options.

Reimplemented from Writer.

Definition at line 45 of file WriterPlugin.h.

References m_writer.

## ◆ set_run_info()

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

Set the global GenRunInfo object.

Reimplemented from Writer.

Definition at line 49 of file WriterPlugin.h.

References m_writer.

## ◆ write_event()

void write_event | ( | const GenEvent & | ev | ) |
| inlineoverridevirtual

Reading event.

Implements Writer.

Definition at line 37 of file WriterPlugin.h.

References m_writer.

## Field Documentation

## ◆ dll_handle

void* dll_handle = nullptr
| private

library handler

Definition at line 54 of file WriterPlugin.h.

## ◆ m_options

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

options

Definition at line 59 of file Writer.h.

## ◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
| privateinherited

The global GenRunInfo object.

Definition at line 64 of file Writer.h.

## ◆ m_writer

Writer* m_writer = nullptr
| private

The actual writer.

Definition at line 53 of file WriterPlugin.h.

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

- WriterPlugin.h
- WriterPlugin.cc