errormsgs.h

Go to the documentation of this file.
00001 
00002 // Contents: Inlined global functions error, warn.
00003 //
00004 // Principal Author: Copyright (2005) Alexei Miasnikov
00005 //
00006 // Status: Useable.
00007 
00008 #ifndef _ERROR_H_
00009 #define _ERROR_H_
00010 
00011 #include <iostream>
00012 
00013 using namespace std;
00014 
00016 namespace msgs {
00017 
00019 
00023   inline void error(const char* msg) {
00024     
00025     cerr << endl << "Fatal error: " << msg << endl;
00026     
00027     while ( 1 );
00028   }
00029   
00031 
00035   inline void error(const string& msg) {
00036     
00037     cerr << endl << "Fatal error: " << msg << endl;
00038     
00039     while ( 1 );
00040   }
00041 
00043 
00049   inline bool error(bool exp, const char* msg) {
00050     
00051     if (!exp){
00052       cerr << endl << "Fatal error: " << msg << endl;
00053       
00054       while ( 1 );
00055       return true;
00056     } else
00057     return false;
00058   }
00059   
00060   
00062 
00065   inline void warn(const char* msg) {
00066     cerr << endl << "Warning: " << msg << endl;
00067   }
00068   
00069 }
00070 
00071 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Mon Sep 26 18:43:45 2011 for CRyptography And Groups (CRAG) by  doxygen 1.6.1