HepMC3 event record library
include
HepMC3
WriterPlugin.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// This file is part of HepMC
4
// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
5
//
6
#ifndef HEPMC3_WRITERPLUGIN_H
7
#define HEPMC3_WRITERPLUGIN_H
8
/**
9
* @file WriterPlugin.h
10
* @brief Definition of \b class WriterPlugin
11
*
12
* @class HepMC3::WriterPlugin
13
* @brief GenEvent I/O parsing and serialization using external plugin
14
*
15
*
16
* @ingroup IO
17
*
18
*/
19
#include "
HepMC3/Writer.h
"
20
#include "
HepMC3/GenEvent.h
"
21
namespace
HepMC3
22
{
23
class
WriterPlugin
:
public
Writer
24
{
25
public
:
26
27
/** @brief Constructor to read from stream*/
28
WriterPlugin
(std::ostream & stream,
const
std::string &libname,
const
std::string &newwriter, std::shared_ptr<HepMC3::GenRunInfo>run=std::shared_ptr<GenRunInfo>());
29
30
31
/** @brief Constructor to read from file*/
32
WriterPlugin
(
const
std::string& filename,
const
std::string &libname,
const
std::string &newwriter, std::shared_ptr<HepMC3::GenRunInfo>run=std::shared_ptr<GenRunInfo>());
33
34
/** @brief Reading event */
35
void
write_event
(
const
GenEvent
& ev)
override
{
if
(!
m_writer
)
return
;
return
m_writer
->
write_event
(ev);};
36
/** @brief Close */
37
void
close
()
override
{
if
(!
m_writer
)
return
;
m_writer
->
close
();};
38
/** @brief State */
39
bool
failed
()
override
{
if
(!
m_writer
)
return
true
;
return
m_writer
->
failed
();};
40
/** @brief Destructor */
41
~WriterPlugin
()
override
;
42
private
:
43
Writer
*
m_writer
;
///< The actual writer
44
void
*
dll_handle
;
///< library handler
45
};
46
}
47
#endif
GenEvent.h
Definition of class GenEvent.
HepMC3::GenEvent
Stores event-related information.
Definition:
GenEvent.h:41
HepMC3::WriterPlugin::close
void close() override
Close.
Definition:
WriterPlugin.h:37
HepMC3::WriterPlugin::dll_handle
void * dll_handle
library handler
Definition:
WriterPlugin.h:44
HepMC3
HepMC3 main namespace.
Definition:
AnalysisExample.h:19
HepMC3::WriterPlugin::failed
bool failed() override
State.
Definition:
WriterPlugin.h:39
Writer.h
Definition of interface Writer.
HepMC3::WriterPlugin::m_writer
Writer * m_writer
The actual writer.
Definition:
WriterPlugin.h:43
HepMC3::Writer::close
virtual void close()=0
Close file and/or stream.
HepMC3::WriterPlugin::write_event
void write_event(const GenEvent &ev) override
Reading event.
Definition:
WriterPlugin.h:35
HepMC3::WriterPlugin
GenEvent I/O parsing and serialization using external plugin.
Definition:
WriterPlugin.h:24
HepMC3::Writer::write_event
virtual void write_event(const GenEvent &evt)=0
Write event evt to output target.
HepMC3::WriterPlugin::WriterPlugin
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:
WriterPlugin.cc:29
HepMC3::Writer
Base class for all I/O writers.
Definition:
Writer.h:25
HepMC3::WriterPlugin::~WriterPlugin
~WriterPlugin() override
Destructor.
Definition:
WriterPlugin.cc:76
HepMC3::Writer::failed
virtual bool failed()=0
Get file and/or stream error state.
Generated on Tue Apr 6 2021 00:00:00 for HepMC3 event record library by
1.8.20