Imported Upstream version 3.2.2
[debian/gnuradio] / mblock / src / include / mblock / exception.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006,2008 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 #ifndef INCLUDED_MB_EXCEPTION_H
22 #define INCLUDED_MB_EXCEPTION_H
23
24 #include <stdexcept>
25
26 class mb_mblock;
27
28
29 class mbe_base : public std::logic_error
30 {
31 public:
32   mbe_base(mb_mblock *mb, const std::string &msg);
33 };
34
35 class mbe_not_implemented : public mbe_base
36 {
37 public:
38   mbe_not_implemented(mb_mblock *mb, const std::string &msg);
39 };
40
41 class mbe_no_such_class : public mbe_base
42 {
43 public:
44   mbe_no_such_class(mb_mblock *, const std::string &class_name);
45 };
46
47 class mbe_no_such_component : public mbe_base
48 {
49 public:
50   mbe_no_such_component(mb_mblock *, const std::string &component_name);
51 };
52
53 class mbe_duplicate_component : public mbe_base
54 {
55 public:
56   mbe_duplicate_component(mb_mblock *, const std::string &component_name);
57 };
58
59 class mbe_no_such_port : public mbe_base
60 {
61 public:
62   mbe_no_such_port(mb_mblock *, const std::string &port_name);
63 };
64
65
66 class mbe_duplicate_port : public mbe_base
67 {
68 public:
69   mbe_duplicate_port(mb_mblock *, const std::string &port_name);
70 };
71
72 class mbe_already_connected : public mbe_base
73 {
74 public:
75   mbe_already_connected(mb_mblock *, const std::string &comp_name,
76                         const std::string &port_name);
77 };
78
79 class mbe_incompatible_ports : public mbe_base
80 {
81 public:
82   mbe_incompatible_ports(mb_mblock *,
83                          const std::string &comp1_name,
84                          const std::string &port1_name,
85                          const std::string &comp2_name,
86                          const std::string &port2_name);
87 };
88
89 class mbe_invalid_port_type : public mbe_base
90 {
91 public:
92   mbe_invalid_port_type(mb_mblock *, const std::string &comp_name,
93                         const std::string &port_name);
94 };
95
96 class mbe_mblock_failed : public mbe_base
97 {
98 public:
99   mbe_mblock_failed(mb_mblock *, const std::string &msg);
100 };
101
102
103
104 // not derived from mbe_base to simplify try/catch
105 class mbe_terminate
106 {
107 public:
108   mbe_terminate();
109 };
110
111 // not derived from mbe_base to simplify try/catch
112 class mbe_exit
113 {
114 public:
115   mbe_exit();
116 };
117
118 #endif /* INCLUDED_MB_EXCEPTION_H */