Merged latest pmt and mblock into trunk (eb/wip -r4262:4268)
[debian/gnuradio] / mblock / src / lib / mb_exception.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006 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 2, 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
36
37 class mbe_no_such_component : public mbe_base
38 {
39 public:
40   mbe_no_such_component(mb_mblock *, const std::string &component_name);
41 };
42
43 class mbe_duplicate_component : public mbe_base
44 {
45 public:
46   mbe_duplicate_component(mb_mblock *, const std::string &component_name);
47 };
48
49 class mbe_no_such_port : public mbe_base
50 {
51 public:
52   mbe_no_such_port(mb_mblock *, const std::string &port_name);
53 };
54
55 class mbe_duplicate_port : public mbe_base
56 {
57 public:
58   mbe_duplicate_port(mb_mblock *, const std::string &port_name);
59 };
60
61 class mbe_already_connected : public mbe_base
62 {
63 public:
64   mbe_already_connected(mb_mblock *, const std::string &comp_name,
65                         const std::string &port_name);
66 };
67
68 class mbe_incompatible_ports : public mbe_base
69 {
70 public:
71   mbe_incompatible_ports(mb_mblock *,
72                          const std::string &comp1_name,
73                          const std::string &port1_name,
74                          const std::string &comp2_name,
75                          const std::string &port2_name);
76 };
77
78 class mbe_invalid_port_type : public mbe_base
79 {
80 public:
81   mbe_invalid_port_type(mb_mblock *, const std::string &comp_name,
82                         const std::string &port_name);
83 };
84
85
86
87 #endif /* INCLUDED_MB_EXCEPTION_H */