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:
+ Collaboration diagram for WriterPlugin:

Public Member Functions

 WriterPlugin (std::ostream &stream, const std::string &libname, const std::string &newwriter, std::shared_ptr< HepMC3::GenRunInfo > run=std::shared_ptr< GenRunInfo >())
 Constructor to read from 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 read from file.
 
void write_event (const GenEvent &ev) override
 Reading event.
 
void close () override
 Close.
 
bool failed () override
 State.
 
 ~WriterPlugin () override
 Destructor.
 
void set_run_info (std::shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object.
 
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 Attributes

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

Private Attributes

Writerm_writer
 The actual writer.
 
void * dll_handle
 library handler
 
std::shared_ptr< GenRunInfom_run_info
 The global GenRunInfo object.
 

Constructor & Destructor Documentation

◆ WriterPlugin() [1/2]

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

Constructor to read from stream.

Definition at line 29 of file WriterPlugin.cc.

References WriterPlugin::dll_handle, and WriterPlugin::m_writer.

◆ WriterPlugin() [2/2]

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 read from file.

Definition at line 51 of file WriterPlugin.cc.

References WriterPlugin::dll_handle, and WriterPlugin::m_writer.

◆ ~WriterPlugin()

~WriterPlugin ( )
override

Destructor.

Definition at line 73 of file WriterPlugin.cc.

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

Member Function Documentation

◆ close()

void close ( )
inlineoverridevirtual

Close.

Implements Writer.

Definition at line 36 of file WriterPlugin.h.

References Writer::close(), and WriterPlugin::m_writer.

◆ failed()

bool failed ( )
inlineoverridevirtual

State.

Implements Writer.

Definition at line 38 of file WriterPlugin.h.

References Writer::failed(), and WriterPlugin::m_writer.

◆ get_options()

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

Set options.

Definition at line 61 of file Writer.h.

References Writer::m_options.

◆ run_info()

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

Get the global GenRunInfo object.

Definition at line 47 of file Writer.h.

References Writer::m_run_info.

◆ set_options()

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

Set options.

Definition at line 56 of file Writer.h.

References Writer::m_options.

◆ set_run_info()

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

Set the global GenRunInfo object.

Definition at line 42 of file Writer.h.

References Writer::m_run_info.

◆ write_event()

void write_event ( const GenEvent ev)
inlineoverridevirtual

Reading event.

Implements Writer.

Definition at line 34 of file WriterPlugin.h.

References WriterPlugin::m_writer, and Writer::write_event().

Field Documentation

◆ dll_handle

void* dll_handle
private

library handler

Definition at line 43 of file WriterPlugin.h.

◆ m_options

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

options

Definition at line 68 of file Writer.h.

◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
privateinherited

The global GenRunInfo object.

Definition at line 73 of file Writer.h.

◆ m_writer

Writer* m_writer
private

The actual writer.

Definition at line 42 of file WriterPlugin.h.


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