usb: getting string descriptors, minor improvements
[quarnos.git] / manes / exception.h
blob2d55e6d6f772073253c85181ec56071890880d29
1 #ifndef _EXCEPTION_H_
2 #define _EXCEPTION_H_
4 class string;
5 class exception {
6 private:
7 // const string message;
8 // const p<exception> inner;
10 public:
11 exception() {}
13 /* XXX: In C++0x reference to r-value may be useful here */
14 exception(string);
15 // exception(string, p<exception>);
16 // exception(p<exception>);
18 const string &get_message() const;
19 // const p<exception> get_inner() const;
22 class null_pointer_exception : public exception {
23 public:
24 null_pointer_exception(const char *x) {}
27 class cpu_exception : public exception { };
28 class not_implemented_exception : public exception { };
29 class not_supported_exception : public exception { };
30 class arithmetic_exception : public exception { };
32 class runtime_exception : public exception { };
34 /* Argument exceptions */
36 class argument_exception : public exception {
37 public:
38 argument_exception() { }
39 argument_exception(const char*) { }
41 class argument_null_exception : public argument_exception {
42 public:
43 argument_null_exception() { }
44 argument_null_exception(const char*) { }
46 class argument_out_of_range_exception : public argument_exception { };
49 class out_of_memory_exception : public exception { };
50 class invalid_cast_exception : public exception { };
51 class stack_overflow_exception : public exception { };
52 class index_out_of_range_exception : public exception { };
54 /* Manes exceptions */
56 class manes_exception : public exception { };
57 class component_not_found_exception : public manes_exception {
58 public:
59 component_not_found_exception(const char *x) {}
62 class type_not_found_exception : public manes_exception {
63 public:
64 type_not_found_exception() {}
65 type_not_found_exception(const char *x) {}
68 class driver_not_found_exception : public type_not_found_exception {
69 public:
70 driver_not_found_exception() {}
73 #endif