HepMC3 event record library
Public Member Functions | Protected Attributes | Private Attributes
WriterPlugin Class Reference

GenEvent I/O parsing and serialization using external plugin. More...

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

Detailed Description

GenEvent I/O parsing and serialization using external plugin.

Definition at line 23 of file WriterPlugin.h.

Constructor & Destructor Documentation

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.

~WriterPlugin ( )
override

Destructor.

Definition at line 76 of file WriterPlugin.cc.

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

Member Function Documentation

void close ( )
inlineoverridevirtual

Close.

Implements Writer.

Definition at line 37 of file WriterPlugin.h.

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

bool failed ( )
inlineoverridevirtual

State.

Implements Writer.

Definition at line 39 of file WriterPlugin.h.

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

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

Set options.

Definition at line 61 of file Writer.h.

References Writer::m_options.

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.

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.

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.

void write_event ( const GenEvent ev)
inlineoverridevirtual

Reading event.

Implements Writer.

Definition at line 35 of file WriterPlugin.h.

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

Field Documentation

void* dll_handle
private

library handler

Definition at line 44 of file WriterPlugin.h.

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

options

Definition at line 68 of file Writer.h.

Writer* m_writer
private

The actual writer.

Definition at line 43 of file WriterPlugin.h.


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