liballofw
common.h
Go to the documentation of this file.
1 #ifndef ALLOFW_COMMON_H
2 #define ALLOFW_COMMON_H
3 
4 #include <memory>
5 
6 // Don't use these in the header files, otherwise doxygen cannot show the right namespace.
7 #define ALLOFW_NS allofw
8 #define ALLOFW_NS_BEGIN namespace allofw {
9 #define ALLOFW_NS_END }
10 
11 namespace allofw {
12 
14  class exception {
15  public:
16  exception(const char* what_ = nullptr);
17  exception(const exception& e);
18  exception& operator = (const exception& e);
19  virtual const char* what() const;
20  virtual ~exception();
21  private:
22  char* description;
23  };
24 
26  class not_implemented_yet : public exception {
27  public:
28  not_implemented_yet(const char* what_ = nullptr) : exception(what_) { }
29  };
30 
32  class not_supported : public exception {
33  public:
34  not_supported(const char* what_ = nullptr) : exception(what_) { }
35  };
36 
38  class invalid_argument : public exception {
39  public:
40  invalid_argument(const char* what_ = nullptr) : exception(what_) { }
41  };
42 
44  class non_copyable {
45  public:
46  non_copyable() = default;
47  private:
48  non_copyable(const non_copyable&);
50  };
51 
52 }
53 
54 #endif
not_implemented_yet(const char *what_=nullptr)
Definition: common.h:28
Not supported exception.
Definition: common.h:32
virtual ~exception()
exception & operator=(const exception &e)
not_supported(const char *what_=nullptr)
Definition: common.h:34
Definition: allofw.h:12
Inherit this to make a class non-copyable.
Definition: common.h:44
exception(const char *what_=nullptr)
virtual const char * what() const
Allofw exception class.
Definition: common.h:14
invalid_argument(const char *what_=nullptr)
Definition: common.h:40
Invalid argument exception.
Definition: common.h:38
Not implemented exception.
Definition: common.h:26