00001 #ifndef _IT_BUS_EXCEPTION_H_
00002 #define _IT_BUS_EXCEPTION_H_
00003
00004
00005
00006
00007 #include <it_bus/api_defines.h>
00008 #include <it_bus/FWStringHelp.h>
00009 #include <it_bus/error_codes.h>
00010 #include <it_bus/object_base.h>
00011
00012
00013 namespace IT_Bus
00014 {
00015 class String;
00016
00022 class IT_AFC_API Exception :
00023 public ObjectBase
00024 {
00025 public:
00032 Exception(
00033 const String& message
00034 );
00035
00043 Exception(
00044 const char* desc1 = 0,
00045 const char* desc2 = 0,
00046 const char* desc3 = 0,
00047 const char* desc4 = 0,
00048 const char* desc5 = 0,
00049 const char* desc6 = 0
00050 );
00051
00059 Exception(
00060 IT_ULong error_code,
00061 const char* desc1 = 0,
00062 const char* desc2 = 0,
00063 const char* desc3 = 0,
00064 const char* desc4 = 0,
00065 const char* desc5 = 0,
00066 const char* desc6 = 0
00067 );
00068
00072 Exception(
00073 const Exception& rhs
00074 );
00075
00079 virtual
00080 ~Exception();
00081
00085 Exception&
00086 operator=(
00087 const Exception& rhs
00088 );
00089
00104 void
00105 create_message(
00106 const char* desc1 = 0,
00107 const char* desc2 = 0,
00108 const char* desc3 = 0,
00109 const char* desc4 = 0,
00110 const char* desc5 = 0,
00111 const char* desc6 = 0
00112 );
00113
00114 void
00115 format_message(
00116 const char* msg,
00117 ...
00118 );
00119
00120 const char*
00121 operator=(
00122 const char* desc
00123 );
00124
00130 const char*
00131 message() const;
00132
00138 IT_ULong
00139 error() const;
00140
00141 IT_ULong
00142 use_last_error(
00143 long error_code = 0
00144 );
00145
00146 void
00147 append_error_description(
00148 IT_ULong error_code = 0
00149 );
00150
00154 virtual Exception*
00155 clone() const;
00156
00160 virtual void
00161 rethrow() const;
00162
00163 private:
00164 CCountedString m_msg;
00165 IT_ULong m_error;
00166 };
00167 }
00168
00169 #endif