00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "FactoryExceptions.hpp"
00040 #include <sstream>
00041
00042 namespace RTT {
00043
00044 name_not_found_exception::name_not_found_exception( const std::string& n )
00045 : name(n)
00046 {
00047 whatstr = name + " not found in this factory.";
00048 }
00049
00050 name_not_found_exception::~name_not_found_exception() throw() {}
00051
00052 const char* name_not_found_exception::what() const throw() {
00053 return whatstr.c_str();
00054 }
00055
00056 invalid_handle_exception::invalid_handle_exception()
00057 : whatstr("Invalid SendHandle object.")
00058 {
00059 }
00060
00061 invalid_handle_exception::~invalid_handle_exception() throw() {}
00062
00063 const char* invalid_handle_exception::what() const throw() {
00064 return whatstr.c_str();
00065 }
00066
00067 no_asynchronous_operation_exception::no_asynchronous_operation_exception(std::string const& what)
00068 : whatstr(what)
00069 {
00070 }
00071
00072 no_asynchronous_operation_exception::~no_asynchronous_operation_exception() throw() {}
00073
00074 const char* no_asynchronous_operation_exception::what() const throw() {
00075 return whatstr.c_str();
00076 }
00077
00078 wrong_number_of_args_exception::wrong_number_of_args_exception( int w, int r )
00079 : wanted( w ), received( r )
00080 {
00081 std::stringstream a;
00082 a << "Wrong number of arguments: Expected ";
00083 a << w;
00084 a << ", received ";
00085 a << r << ".";
00086 whatstr = a.str();
00087 }
00088
00089 wrong_number_of_args_exception::~wrong_number_of_args_exception() throw() {}
00090
00091 const char* wrong_number_of_args_exception::what() const throw() {
00092 return whatstr.c_str();
00093 }
00094
00095 wrong_types_of_args_exception::wrong_types_of_args_exception( int w, const std::string& expected, const std::string& received )
00096 : whicharg( w ), expected_(expected), received_(received)
00097 {
00098 std::stringstream a;
00099 a << "In argument "<<w<<": wrong type of argument: Expected type ";
00100 a << expected_;
00101 a << ", received type ";
00102 a << received_ << ".";
00103 whatstr = a.str();
00104 }
00105
00106 wrong_types_of_args_exception::~wrong_types_of_args_exception() throw() {}
00107
00108
00109 const char* wrong_types_of_args_exception::what() const throw() {
00110 return whatstr.c_str();
00111 }
00112
00113 non_lvalue_args_exception::non_lvalue_args_exception( int w, const std::string& received )
00114 : whicharg( w ), received_(received)
00115 {
00116 std::stringstream a;
00117 a << "In argument "<<w<<": can not assign value to non-lvalue ";
00118 a << received_ << ".";
00119 whatstr = a.str();
00120 }
00121
00122 non_lvalue_args_exception::~non_lvalue_args_exception() throw() {}
00123
00124 const char* non_lvalue_args_exception::what() const throw() {
00125 return whatstr.c_str();
00126 }
00127
00128
00129 }