Back to Top page.

EGException.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003 $Id: EGException.h,v 1.2 2002/11/08 03:47:38 motegi Exp $
00004 Copyright (C) 2002 Higuchi Lab. All rights reserved.
00005 
00006 *****************************************************************************/
00007 #ifndef INCLUDE__EGEXCEPTION_H__FILE
00008 #define INCLUDE__EGEXCEPTION_H__FILE
00009 
00010 #include <iostream>
00011 
00015 class EGException {
00016 public:
00017   EGException(const char* msg, const char* filename,
00018               const unsigned uLine)
00019     : m_Msg(msg), m_FileName(filename), m_uLineNumber(uLine) { }
00020   virtual void Display(std::ostream& out) const {
00021     out << m_FileName << '('
00022         << m_uLineNumber << "): "
00023         << m_Msg << "\n";
00024   }
00025 
00026 private:
00027   const char*    m_Msg; 
00028   const char*    m_FileName;    
00029   const unsigned m_uLineNumber; 
00030 };
00031 
00032 inline std::ostream& operator<<(std::ostream& o, const EGException& ex)
00033 {
00034   ex.Display(o);
00035   return o;
00036 }
00037 
00038 #endif  //INCLUDE__EGEXCEPTION_H__FILE
00039 
00040 
00041