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-2020 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 
14 namespace 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 ///
22 class Setup {
23 
24  /// Private constructor
25  Setup() {}
26  /// Private destructor
27  ~Setup() {}
28 
29 
30 public:
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 
62 private:
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
Setup()
Private constructor.
Definition: Setup.h:25
Configuration for HepMC.
Definition: Setup.h:22
static bool print_warnings()
Get warning messages printing flag.
Definition: Setup.cc:19
static void set_debug_level(const int level)
Set debug level.
Definition: Setup.cc:22
~Setup()
Private destructor.
Definition: Setup.h:27
static bool print_errors()
Get error messages printing flag.
Definition: Setup.cc:17
static int m_debug_level
Level of debug messages printed out.
Definition: Setup.h:66
static bool m_is_printing_warnings
Flag for printing warning messages.
Definition: Setup.h:65
static int debug_level()
Get debug level.
Definition: Setup.cc:21
static void set_print_errors(const bool flag)
set error messages printing flag
Definition: Setup.cc:18
static void set_print_warnings(const bool flag)
Set warning messages printing flag.
Definition: Setup.cc:20
static const unsigned int DEFAULT_DOUBLE_ALMOST_EQUAL_MAXULPS
Default maxUlps for AlmostEqual2sComplement function (double precision)
Definition: Setup.h:54
static bool m_is_printing_errors
Flag for printing error messages.
Definition: Setup.h:64
static const double DOUBLE_EPSILON
Default threshold for comparing double variables.
Definition: Setup.h:57