Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Deprecated/Error.old/ErrorCode.cpp

Go to the documentation of this file.
00001 #ifndef __J2K__ErrorCode_CPP__
00002 
00003 #define __J2K__ErrorCode_CPP__
00004 
00005 
00006 
00007 #include <j2k/Fred/Error/ErrorCode.hpp>
00008 
00009 
00010 
00011 ErrorCode::ErrorCode()
00012 
00013   : err(Success), PboResp( new BOOL( FALSE ) ) { }
00014 
00015 
00016 
00017 ErrorCode::ErrorCode(const ErrorCode& src)
00018 
00019   : err(src.err), PboResp( new BOOL(TRUE) )
00020 
00021 {
00022 
00023   *src.PboResp = FALSE;
00024 
00025 }
00026 
00027 
00028 
00029 ErrorCode::ErrorCode(const ErrorCodeValue val)
00030 
00031   : err( val ), PboResp( new BOOL(TRUE) ) { }
00032 
00033 
00034 
00035 ErrorCode::~ErrorCode()
00036 
00037 {
00038 
00039   if ( *PboResp ) {
00040 
00041     cerr << "Destruction of untested error code: value " << err << endl;
00042 
00043   }
00044 
00045 
00046 
00047   delete PboResp;
00048 
00049 }
00050 
00051 
00052 
00053 ErrorCode& ErrorCode::operator= (const ErrorCode& right)
00054 
00055 {
00056 
00057   if (*PboResp)
00058 
00059     cerr << "Untested error code (value " << err
00060 
00061       << ") erased by new value " << right.err << endl;
00062 
00063 
00064 
00065   err = right.err;
00066 
00067   *PboResp = *right.PboResp;
00068 
00069   *right.PboResp = FALSE;
00070 
00071   
00072 
00073   return *this;
00074 
00075 }
00076 
00077 
00078 
00079 BOOL ErrorCode::operator!= (const ErrorCode& right) const
00080 
00081 {
00082 
00083   *PboResp = FALSE;
00084 
00085   *right.PboResp = FALSE;
00086 
00087 
00088 
00089   return (err != right.err);
00090 
00091 }
00092 
00093 
00094 
00095 #endif
00096 

Generated on Sun Oct 14 18:46:19 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001