/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/ers/ers-00-00-03/ers/Precondition.h

Go to the documentation of this file.
00001 /*
00002  *  Precondition.h
00003  *  ers
00004  *
00005  *  Created by Matthias Wiesmann on 08.12.04.
00006  *  Copyright 2004 CERN. All rights reserved.
00007  *
00008  */
00009 
00010 #ifndef ERS_PRECONDITION
00011 
00012 #include <stdio.h>
00013 #include "ers/Assertion.h"
00014 
00015 namespace ers {
00016     
00024     class Precondition : public Assertion {
00025 protected:
00026         virtual std::string build_message(const char* condition_text, const std::string &message, bool constant_expression = false) throw() ; 
00027         Precondition(const Context &context, severity_t s); 
00028 public:
00029         static const char* const PRECONDITION_CLASS ; 
00030         Precondition();
00031         Precondition(const Context &context, severity_t s, const char*condition, const std::string &message , bool constant_expression=false) ;
00032         virtual const char*get_class_name() const throw();
00033     } ;  // Precondition
00034 } // ers
00035 
00036 
00044 #ifndef N_ERS_ASSERT
00045 #ifdef __GNUC__
00046 #define ERS_PRECONDITION(expr,...) { if(!(expr)) { char precondition_buffer[256] ; snprintf(precondition_buffer,256, __VA_ARGS__) ; ers::Precondition failed_precondition(ERS_HERE,ers::error,#expr,precondition_buffer,__builtin_constant_p(expr)) ; throw failed_precondition ; } }
00047 #else 
00048 #define ERS_PRECONDITION(expr,...) { if(!(expr)) { char precondition_buffer[256] ; snprintf(precondition_buffer,256, __VA_ARGS__) ; ers::Precondition failed_precondition(ERS_HERE,ers::error,#expr,precondition_buffer,false) ; throw failed_precondition ; } }
00049 #endif
00050 #else 
00051 #define ERS_PRECONDITION(expr,...) 
00052 #endif
00053 
00054 #endif
00055 

Generated on Tue Nov 29 22:58:26 2016 for BOSS_7.0.2 by  doxygen 1.4.7