00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_ILLEGAL_ARGUMENT_EXCEPTION_HPP
00017 #define COH_ILLEGAL_ARGUMENT_EXCEPTION_HPP
00018
00019 #include "coherence/lang/compatibility.hpp"
00020
00021 #include "coherence/lang/RuntimeException.hpp"
00022 #include "coherence/lang/String.hpp"
00023
00024 COH_OPEN_NAMESPACE2(coherence,lang)
00025
00026
00027
00028
00029
00030
00031 class COH_EXPORT IllegalArgumentException
00032 : public throwable_spec<IllegalArgumentException,
00033 extends<RuntimeException, std::invalid_argument> >
00034 {
00035 friend class factory<IllegalArgumentException>;
00036
00037
00038
00039 protected:
00040
00041
00042
00043
00044
00045
00046
00047
00048 IllegalArgumentException(String::View vsMsg = String::null_string,
00049 Exception::View vCause = NULL);
00050 };
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #define COH_ENSURE_PARAM_RELATION(PARAM, OP, VALUE) \
00065 if (!(PARAM OP VALUE)) \
00066 { \
00067 COH_THROW_STREAM (coherence::lang::IllegalArgumentException, \
00068 #PARAM << " is " << PARAM << "; must be " << #OP << " " << #VALUE); \
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078 #define COH_ENSURE_PARAM(HANDLE) COH_ENSURE_PARAM_RELATION(HANDLE, !=, NULL)
00079
00080 COH_CLOSE_NAMESPACE2
00081
00082 #endif // COH_ILLEGAL_ARGUMENT_EXCEPTION_HPP