/home/coin/SVN-release/CoinAll-1.1.0/Bcp/src/include/BCP_error.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef _BCP_ERROR_H
00004 #define _BCP_ERROR_H
00005 
00006 // This file is fully docified.
00007 
00008 #include <string>
00009 #include <cstdio>
00010 #include <cstdlib>
00011 #include <cstdarg>
00012 
00020 class BCP_fatal_error{
00021 public:
00022    static bool abort_on_error;
00023 
00024 public:
00027 #if 0
00028    BCP_fatal_error(const char * error) {
00029       printf("%s", error);
00030       fflush(0);
00031       abort();
00032    }
00033 #endif
00034    BCP_fatal_error(const std::string& str) {
00035       printf("%s", str.c_str());
00036       fflush(0);
00037       if (abort_on_error)
00038          abort();
00039    }
00040    BCP_fatal_error(const char * format, ...) {
00041       va_list valist;
00042       va_start(valist,format);
00043       vprintf(format, valist);
00044       va_end(valist);
00045       fflush(0);
00046       if (abort_on_error)
00047          abort();
00048    }
00050    ~BCP_fatal_error() {}
00051 };
00052 
00053 #endif

Generated on Sun Nov 14 14:06:29 2010 for Coin-All by  doxygen 1.4.7