Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

wefts_error.h

Go to the documentation of this file.
00001 /*
00002    wefts_error.h
00003    Error classes - for trhow statements.
00004 
00005    $Id: wefts_error.h,v 1.1 2003/08/15 18:03:11 jonnymind Exp $
00006 ---------------------------------------------
00007    Begin      : 2003-08-15 17:13
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 WT_ERROR_H
00023 #define WT_ERROR_H
00024 
00025 #include <string>
00026 #include <iostream>
00027 
00035 namespace Wefts {
00036 
00044 class Error
00045 {
00046 private:
00047    int m_osCode;
00048 
00049 public:
00053    Error( int code=0 ) { m_osCode = code;}
00054 
00059    int osCode() const { return m_osCode; }
00060 
00062    virtual const std::string description() { return "Generic low-level error"; }
00063 
00067    friend std::ostream& operator<<( std::ostream &stream, Error &err );
00068 };
00069 
00070 
00072 class NotJoinableError: public Error
00073 {
00074 public:
00078    NotJoinableError( int code=0 ): Error( code ) {}
00079 
00080    virtual const std::string description() const {
00081       return "Join called on a non-joinable thread";
00082    }
00083 };
00084 
00086 class InvalidError: public Error
00087 {
00088 public:
00092    InvalidError( int code=0 ): Error( code ) {}
00093 
00094    virtual const std::string description() const {
00095       return "Using an object in an invalid state";
00096    }
00097 };
00098 
00100 class InitError: public Error
00101 {
00102 public:
00106    InitError( int code=0 ): Error( code ) {}
00107 
00108    virtual const std::string description() const {
00109       return "Object cannot be initialized";
00110    }
00111 };
00112 
00114 class StartError: public Error
00115 {
00116 public:
00120    StartError( int code=0 ): Error( code ) {}
00121 
00122    virtual const std::string description() const {
00123       return "Impossible to start more threads";
00124    }
00125 };
00126 
00131 }
00132 
00133 #endif
00134 
00135 /* end of wefts_error.h */

Generated on Mon Aug 18 05:53:37 2003 for Wefts by doxygen1.2.18