HepMC3 event record library
Setup.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2021 The HepMC collaboration (see AUTHORS for details)
5//
6/// @file Setup.h
7/// @brief Definition of \b class Setup
8
9#ifndef HEPMC3_SETUP_H
10#define HEPMC3_SETUP_H
11
12
13
14namespace HepMC3 {
15
16/// @brief Configuration for HepMC
17///
18/// Contains macro definitions for printing debug output, feature deprecation, etc.
19/// Static class - configuration is shared among all HepMC events
20/// and program threads
21///
22class Setup {
23
24 /// Private constructor
25 Setup() {}
26 /// Private destructor
27 ~Setup() {}
28
29
30public:
31
32 /// @name Accessors
33 /// @{
34
35 /// Get error messages printing flag
36 static bool print_errors();
37 /// set error messages printing flag
38 static void set_print_errors(const bool flag);
39
40 /// Get warning messages printing flag
41 static bool print_warnings();
42 /// Set warning messages printing flag
43 static void set_print_warnings(const bool flag);
44
45 /// Get debug level
46 static int debug_level();
47 /// Set debug level
48 static void set_debug_level(const int level);
49 /// @}
50
51 /// @name Static constants
52 /// @{
53 /// Default maxUlps for AlmostEqual2sComplement function (double precision)
54 static const unsigned int DEFAULT_DOUBLE_ALMOST_EQUAL_MAXULPS;
55
56 /// Default threshold for comparing double variables
57 static const double DOUBLE_EPSILON;
58
59 /// @}
60
61
62private:
63
64 static bool m_is_printing_errors; //!< Flag for printing error messages
65 static bool m_is_printing_warnings; //!< Flag for printing warning messages
66 static int m_debug_level; //!< Level of debug messages printed out
67};
68
69
70} // namespace HepMC3
71
72#endif
Configuration for HepMC.
Definition: Setup.h:22
static const double DOUBLE_EPSILON
Default threshold for comparing double variables.
Definition: Setup.h:57
static int m_debug_level
Level of debug messages printed out.
Definition: Setup.h:66
static void set_debug_level(const int level)
Set debug level.
Definition: Setup.cc:22
~Setup()
Private destructor.
Definition: Setup.h:27
static bool m_is_printing_errors
Flag for printing error messages.
Definition: Setup.h:64
static bool m_is_printing_warnings
Flag for printing warning messages.
Definition: Setup.h:65
static void set_print_errors(const bool flag)
set error messages printing flag
Definition: Setup.cc:18
static bool print_warnings()
Get warning messages printing flag.
Definition: Setup.cc:19
Setup()
Private constructor.
Definition: Setup.h:25
static void set_print_warnings(const bool flag)
Set warning messages printing flag.
Definition: Setup.cc:20
static bool print_errors()
Get error messages printing flag.
Definition: Setup.cc:17
static int debug_level()
Get debug level.
Definition: Setup.cc:21
HepMC3 main namespace.