HepMC3 event record library: Version.h Source File

HepMC3 event record library

Version.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
5//
6/**
7 * @file Version.h
8 * @brief Declaration of the Verrion functions and some macros
9 *
10 */
11#ifndef HEPMC3_VERSION_H
12#define HEPMC3_VERSION_H
13
14#include <string>
15
16/// HepMC version string
17#define HEPMC3_VERSION "3.03.01"
18
19/// @brief HepMC version as an integer, HepMC X.Y.Z = 1000000*X + 1000*Y + Z
20///
21/// Use like "#if HEPMC3_VERSION_CODE < 3001004" for < 3.01.04
22#define HEPMC3_VERSION_CODE 3003001
23namespace HepMC3 {
24/// Get the HepMC library version string
25 inline std::string version() {
26 return HEPMC3_VERSION;
27}
28}
29
30#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
31#define HEPMC3_DECLARE_READER_FILE(classname) extern "C" { __declspec(dllexport) classname * __stdcall new ## classname ## file (const std::string &filename ) { return new classname (filename); } }
32#define HEPMC3_DECLARE_READER_STREAM(classname) extern "C" { __declspec(dllexport) classname * __stdcall new ## classname ## stream (std::istream & stream) { return new classname (stream); } }
33#define HEPMC3_DECLARE_READER_SPSTREAM(classname) extern "C" { __declspec(dllexport) classname * __stdcall new ## classname ## spstream (std::shared_ptr<std::istream> stream) { return new classname (stream); } }
34#define HEPMC3_DECLARE_WRITER_FILE(classname) extern "C" { __declspec(dllexport) classname * __stdcall new ## classname ## file (const std::string &filename, std::shared_ptr<GenRunInfo> run ) { return new classname (filename, run); } }
35#define HEPMC3_DECLARE_WRITER_STREAM(classname) extern "C" { __declspec(dllexport) classname * __stdcall new ## classname ## stream (std::ostream & stream, std::shared_ptr<GenRunInfo> run) { return new classname (stream,run); } }
36#define HEPMC3_DECLARE_WRITER_SPSTREAM(classname) extern "C" { __declspec(dllexport) classname * __stdcall new ## classname ## spstream (std::shared_ptr<std::ostream> stream, std::shared_ptr<GenRunInfo> run) { return new classname (stream, run); } }
37#endif
38#if defined(__linux__) || defined(__darwin__)|| defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun)
39#define HEPMC3_DECLARE_READER_FILE(classname) extern "C" { classname * new ## classname ## file (const std::string &filename ) { return new classname (filename); } }
40#define HEPMC3_DECLARE_READER_STREAM(classname) extern "C" { classname * new ## classname ## stream (std::istream & stream) { return new classname (stream); } }
41#define HEPMC3_DECLARE_READER_SPSTREAM(classname) extern "C" { classname * new ## classname ## spstream (std::shared_ptr<std::istream> stream) { return new classname (stream); } }
42#define HEPMC3_DECLARE_WRITER_FILE(classname) extern "C" { classname * new ## classname ## file (const std::string &filename, std::shared_ptr<GenRunInfo> run ) { return new classname (filename,run); } }
43#define HEPMC3_DECLARE_WRITER_STREAM(classname) extern "C" { classname * new ## classname ## stream (std::ostream & stream, std::shared_ptr<GenRunInfo> run) { return new classname (stream, run); } }
44#define HEPMC3_DECLARE_WRITER_SPSTREAM(classname) extern "C" { classname * new ## classname ## spstream (std::shared_ptr<std::ostream> stream, std::shared_ptr<GenRunInfo> run) { return new classname (stream, run); } }
45#endif
46#endif
HEPMC3_VERSION
#define HEPMC3_VERSION
HepMC version string.
Definition Version.h:17
HepMC3
HepMC3 main namespace.
Definition AnalysisExample.h:24
HepMC3::version
std::string version()
Get the HepMC library version string.
Definition Version.h:25