00001 //-------------------------------------------------- 00013 //--------------------------------------------------- 00014 00015 #include "invalid_cast_exception.h" 00016 00017 namespace imedgine 00018 { 00019 00020 InvalidCastException::InvalidCastException(std::string method, std::string source, std::string target) 00021 : Exception(INVALID_CAST_EXCEPTION, 00022 method + ": " + "source type: " + source + "; target type: " + target) 00023 { 00024 } 00025 00026 //--------------------------------------------------- 00027 00028 InvalidCastException::InvalidCastException(InvalidCastException const& src) 00029 : Exception(src) 00030 { 00031 } 00032 00033 //--------------------------------------------------- 00034 00035 InvalidCastException::~InvalidCastException() throw() 00036 { 00037 } 00038 00039 //--------------------------------------------------- 00040 00041 char const* InvalidCastException::what() const throw() 00042 { 00043 return("invalid cast exception"); 00044 } 00045 00046 //--------------------------------------------------- 00047 00048 std::string const& InvalidCastException::getSourceTypeString() const 00049 { 00050 return(source_type_string_); 00051 } 00052 00053 //--------------------------------------------------- 00054 00055 std::string const& InvalidCastException::getTargetTypeString() const 00056 { 00057 return(target_type_string_); 00058 } 00059 }