NetworkEx.h

Go to the documentation of this file.
00001 
00014 // NetworkException header
00015 
00016 #ifndef NETWORKEX_H_
00017 #define NETWORKEX_H_
00018 
00019 #ifdef _MSC_VER
00020 #pragma once
00021 #endif // MSVC
00022 
00023 #include <exception>
00024 #include <sstream>
00025 
00027 // NetworkException
00028 
00029 class NetworkException : public std::exception
00030 {
00031 public:
00032         enum ExceptionCode
00033         {
00034                 invalid_address = 0,
00035                 invalid_host,
00036                 invalid_network,
00037                 invalid_service,
00038                 read_failed,
00039                 write_failed,
00040                 socket_path_exceeded,
00041                 eof_encountered,
00042                 system_call_failure,
00043                 system_call_timout
00044         };
00045 
00046     NetworkException( ExceptionCode code, const char* note, long native = 0 );
00047 
00048         // ExceptionCode enumeration value
00049     ExceptionCode getErrorCode() const throw();
00050 
00051         // Native OS network error code
00052     long getNativeErrorCode() const throw();
00053 
00054         // Override of std::exception::what()
00055     virtual const char *what() const throw();
00056 
00057         // Utility Functions for throwing network exceptions
00058         static void throwNetworkException(ExceptionCode code, const char* message = ""); //throw(NetworkException);
00059         static void throwNetworkException(ExceptionCode code, long nativeError); //throw(NetworkException);
00060 
00061 /*
00085         // Lookup errors from map
00086     static const char* getErrorSymbol( long code );
00087     static const char* getErrorDescription( long code );
00088 
00089     
00090 private:
00091 
00092         ExceptionCode exceptionCode;
00093         long nativeCode;
00094 };
00095 
00096 
00097 #endif // NETWORKEX_H_

Generated on Tue Mar 28 09:10:14 2006 for Simple SOAP by  doxygen 1.4.6