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. More...
 
 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. More...
 
void write_event (const GenEvent &ev) override
 Reading event. More...
 
void close () override
 Close. More...
 
bool failed () override
 State. More...
 
 ~WriterPlugin () override
 Destructor. More...
 
void set_run_info (std::shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object. More...
 
std::shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 
void set_options (const std::map< std::string, std::string > &options)
 Set options. More...
 
std::map< std::string, std::string > get_options () const
 Set options. More...
 

Protected Attributes

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

Private Attributes

Writerm_writer
 The actual writer. More...
 
void * dll_handle
 library handler More...
 

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 53 of file WriterPlugin.cc.

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

◆ ~WriterPlugin()

~WriterPlugin ( )
override

Destructor.

Definition at line 76 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 39 of file WriterPlugin.h.

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

◆ failed()

bool failed ( )
inlineoverridevirtual

State.

Implements Writer.

Definition at line 41 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 37 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 46 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_writer

Writer* m_writer
private

The actual writer.

Definition at line 45 of file WriterPlugin.h.


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