00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef IDIOSKOPOSERROR_H
00021 #define IDIOSKOPOSERROR_H
00022
00023 #include <typeinfo>
00024
00025 namespace Idioskopos {
00026
00027 namespace error {
00028
00029 class bad_cast: public std::bad_cast {
00030 public:
00031 virtual const char * what () const throw () {
00032 return "idioskopos: Unable to perform property cast";
00033 }
00034 };
00035
00036 class read_only: public std::exception {
00037 public:
00038 virtual const char* what() const throw () {
00039 return "idioskopos: Assignment to read only property";
00040 }
00041 };
00042
00043 class write_only: public std::exception {
00044 public:
00045 virtual const char* what() const throw () {
00046 return "idioskopos: Accessing a write only property";
00047 }
00048 };
00049
00050 namespace cast {
00051
00052 class wrong_property_type: public bad_cast {
00053 public:
00054 virtual const char * what () const throw () {
00055 return "idioskopos: Unable to cast property, casting to wrong type";
00056 }
00057 };
00058
00059 class null_pointer: public bad_cast {
00060 public:
00061 virtual const char * what () const throw () {
00062 return "idioskopos: Cannot cast a null pointer to a property";
00063 }
00064 };
00065
00066 };
00067
00068 class bad_property_name: public std::exception {
00069 public:
00070 virtual const char * what () const throw () {
00071 return "idioskopos: Object does not have requested property";
00072 }
00073 };
00074
00075 class not_a_child: public std::exception {
00076 public:
00077 virtual const char * what () const throw () {
00078 return "idioskopos: Requested child name doesn't exist or can't be cast to idioskopos::Object";
00079 }
00080 };
00081
00082 };
00083 };
00084
00085 #endif
00086