Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

cabal_error.h

Go to the documentation of this file.
00001 /*
00002    cabal_error.h
00003    Error classes - for throw statements.
00004 
00005    $Id: cabal_error.h,v 1.1.1.1 2004/01/13 10:31:35 jonnymind Exp $
00006 ---------------------------------------------
00007    Begin      :
00008    Author     : Giancarlo Niccolai
00009 
00010    Last modified because:
00011 
00012 */
00013 
00014 /**************************************************************************
00015 *   This program is free software; you can redistribute it and/or modify  *
00016 *   it under the terms of the GNU Library General Public License as       *
00017 *   published by the Free Software Foundation; either version 2.1 of the  *
00018 *   License, or (at your option) any later version.                       *
00019 ***************************************************************************/
00020 
00021 
00022 #ifndef CABAL_ERROR_H
00023 #define CABAL_ERROR_H
00024 
00025 #include <string>
00026 #include <iostream>
00027 
00035 namespace Cabal {
00036 
00044 class Error
00045 {
00046 private:
00047    int m_osCode;
00048    //std::string sender;
00049    std::string m_desc;
00050 
00051 public:
00055    Error( const std::string &desc, int code=0 )
00056    {
00057       m_osCode = code;
00058       m_desc = desc;
00059    }
00060 
00065    int osCode() const { return m_osCode; }
00066 
00068    const std::string &description() const { return m_desc; }
00069 
00071    virtual const std::string className() const { return "Cabal::Error"; }
00072 
00076    friend std::ostream& operator<<( std::ostream &stream, Error &err );
00077 };
00078 
00079 
00080 
00082 class InitError: public Error
00083 {
00084 public:
00088    InitError( const std::string &desc, const int code=0 ): Error( desc, code ) {}
00089 
00091    virtual const std::string className() const { return "Cabal::InitError"; }
00092 
00093 };
00094 
00098 class DataIncompleteError: public Error
00099 {
00100 public:
00104    DataIncompleteError( const std::string &desc, const int code=0 ): Error( desc, code ) {}
00105 
00107    virtual const std::string className() const { return "Cabal::DataIncompleteError"; }
00108 
00109 };
00110 
00114 class NotImplementedError: public Error
00115 {
00116 public:
00120    NotImplementedError( const std::string &desc, const int code=0 ): Error( desc, code ) {}
00121 
00123    virtual const std::string className() const { return "Cabal::NotImplementedError"; }
00124 
00125 };
00126 
00127 
00132 } //cabal namespace
00133 
00134 #endif

Generated on Sat Apr 10 17:41:48 2004 for Cabal by doxygen 1.3.5