HepMC3 event record library: Writer Class Reference

HepMC3 event record library

Public Member Functions | Protected Attributes | Private Attributes
Writer Class Referenceabstract

## Detailed Description

Base class for all I/O writers.

Definition at line 25 of file Writer.h.

`#include <Writer.h>`

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

## Public Member Functions
| Writer ()
| Constructor.
virtual | ~Writer ()
| Virtual destructor.
virtual void | write_event (const GenEvent &evt)=0
| Write event evt to output target.
virtual bool | failed ()=0
| Get file and/or stream error state.
virtual void | close ()=0
| Close file and/or stream.
virtual void | set_run_info (std::shared_ptr< GenRunInfo > run)
| Set the global GenRunInfo object.
virtual std::shared_ptr< GenRunInfo > | run_info () const
| Get the global GenRunInfo object.
| Writer (const Writer &)=delete
| deleted copy constructor
Writer & | operator= (const Writer &)=delete
| deleted copy assignment operator
virtual void | set_options (const std::map< std::string, std::string > &options)
| Set options.
virtual std::map< std::string, std::string > | get_options () const
| Set options.

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

## Private Attributes
std::shared_ptr< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ Writer() [1/2]

Writer | ( |  | ) |
| inline

Constructor.

Definition at line 29 of file Writer.h.

## ◆ ~Writer()

virtual ~Writer | ( |  | ) |
| inlinevirtual

Virtual destructor.

Definition at line 32 of file Writer.h.

## ◆ Writer() [2/2]

Writer | ( | const Writer & |  | ) |
| delete

deleted copy constructor

References Writer().

## Member Function Documentation

## ◆ close()

virtual void close | ( |  | ) |
| pure virtual

Close file and/or stream.

Implemented in AnalysisExample, WriterAscii, WriterAsciiHepMC2, WriterDOT, WriterGZ< T, C >, WriterHEPEVT, WriterPlugin, Writerprotobuf, WriterRoot, and WriterRootTree.

## ◆ failed()

virtual bool failed | ( |  | ) |
| pure virtual

Get file and/or stream error state.

Implemented in AnalysisExample, WriterAscii, WriterAsciiHepMC2, WriterDOT, WriterGZ< T, C >, WriterHEPEVT, WriterPlugin, Writerprotobuf, WriterRoot, and WriterRootTree.

## ◆ get_options()

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

Set options.

Reimplemented in WriterPlugin.

Definition at line 54 of file Writer.h.

References m_options.

## ◆ operator=()

Writer & operator= | ( | const Writer & |  | ) |
| delete

deleted copy assignment operator

References Writer().

## ◆ run_info()

virtual std::shared_ptr< GenRunInfo > run_info | ( |  | ) | const
| inlinevirtual

Get the global GenRunInfo object.

Reimplemented in WriterGZ< T, C >, and WriterPlugin.

Definition at line 45 of file Writer.h.

References m_run_info.

## ◆ set_options()

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

Set options.

Reimplemented in WriterPlugin.

Definition at line 52 of file Writer.h.

References m_options.

## ◆ set_run_info()

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

Set the global GenRunInfo object.

Reimplemented in WriterGZ< T, C >, and WriterPlugin.

Definition at line 42 of file Writer.h.

References m_run_info.

## ◆ write_event()

virtual void write_event | ( | const GenEvent & | evt | ) |
| pure virtual

Write event evt to output target.

Implemented in AnalysisExample, WriterAscii, WriterAsciiHepMC2, WriterDOT, WriterGZ< T, C >, WriterHEPEVT, WriterPlugin, Writerprotobuf, WriterRoot, WriterRootTree, and WriterRootTreeOPAL.

## Field Documentation

## ◆ m_options

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

options

Definition at line 59 of file Writer.h.

## ◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
| private

The global GenRunInfo object.

Definition at line 64 of file Writer.h.

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

- Writer.h