Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:11

0001 // -*- C++ -*-
0002 //
0003 // This file is part of HepMC
0004 // Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
0005 //
0006 /**
0007  *  @file Errors.h
0008  *  @brief Implementation of  error and HEPMC3_HEPMC3_WARNING macros
0009  *
0010  */
0011 #ifndef HEPMC3_ERRORS_H
0012 #define HEPMC3_ERRORS_H
0013 
0014 #include <iostream>
0015 #include <stdexcept>
0016 #include <HepMC3/Setup.h>
0017 namespace HepMC3 {
0018 
0019 
0020 /// @name Printing macros
0021 /// @{
0022 
0023 /** @brief Macro for printing error messages */
0024 #define HEPMC3_ERROR(MESSAGE)   if ( Setup::print_errors() )   { std::cerr << "ERROR::" << MESSAGE << std::endl; }
0025 
0026 /** @brief Macro for printing error messages */
0027 #define HEPMC3_ERROR_LEVEL(LEVEL,MESSAGE)   if ( Setup::errors_level()>=(LEVEL) && Setup::print_errors() )   { std::cerr << "ERROR::" << MESSAGE << std::endl; }
0028 
0029 
0030 /** @brief Macro for printing HEPMC3_HEPMC3_WARNING messages */
0031 #define HEPMC3_WARNING(MESSAGE) if ( Setup::print_warnings() ) { std::cout << "WARNING::" << MESSAGE << std::endl; }
0032 
0033 /** @brief Macro for printing HEPMC3_HEPMC3_WARNING messages */
0034 #define HEPMC3_WARNING_LEVEL(LEVEL,MESSAGE) if ( Setup::warnings_level()>=(LEVEL) && Setup::print_warnings() ) { std::cout << "WARNING::" << MESSAGE << std::endl; }
0035 
0036 
0037 // Debug messages and code that will not go to the release version
0038 #ifndef HEPMC3_RELEASE_VERSION
0039 
0040 /** @brief Macro for printing debug messages with appropriate debug level */
0041 #define HEPMC3_DEBUG(LEVEL,MESSAGE) if ( Setup::debug_level()>=(LEVEL) ) { std::cout << "DEBUG(" << LEVEL <<")::" << MESSAGE << std::endl; }
0042 /** @brief Macro for storing code useful for debugging */
0043 #define HEPMC3_DEBUG_CODE_BLOCK( x ) x
0044 
0045 #else
0046 
0047 #define HEPMC3_DEBUG( x,y )
0048 #define HEPMC3_DEBUG_CODE_BLOCK( x )
0049 
0050 #endif
0051 
0052 /// @}
0053 
0054 } // namespace HepMC3
0055 
0056 #endif