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