Imported Upstream version 3.2.2
[debian/gnuradio] / mblock / src / lib / mb_exception.cc
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
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <mblock/exception.h>
27 #include <mblock/mblock.h>
28 #include <mb_util.h>
29
30
31 mbe_base::mbe_base(mb_mblock *mb, const std::string &msg)
32   : logic_error(msg)    // FIXME extract block class name and id and add to msg
33 {
34 }
35
36 mbe_not_implemented::mbe_not_implemented(mb_mblock *mb, const std::string &msg)
37   : mbe_base(mb, "Not implemented: " + msg)
38 {
39 }
40
41 mbe_no_such_class::mbe_no_such_class(mb_mblock *mb, const std::string &class_name)
42   : mbe_base(mb, "No such class: " + class_name)
43 {
44 }
45
46 mbe_no_such_component::mbe_no_such_component(mb_mblock *mb, const std::string &component_name)
47   : mbe_base(mb, "No such component: " + component_name)
48 {
49 }
50
51
52 mbe_duplicate_component::mbe_duplicate_component(mb_mblock *mb, const std::string &component_name)
53   : mbe_base(mb, "Duplicate component: " + component_name)
54 {
55 }
56
57 mbe_no_such_port::mbe_no_such_port(mb_mblock *mb, const std::string &port_name)
58   : mbe_base(mb, "No such port: " + port_name)
59 {
60 }
61
62 mbe_duplicate_port::mbe_duplicate_port(mb_mblock *mb, const std::string &port_name)
63   : mbe_base(mb, "Duplicate port: " + port_name)
64 {
65 }
66
67 mbe_already_connected::mbe_already_connected(mb_mblock *mb,
68                                              const std::string &comp_name,
69                                              const std::string &port_name)
70   : mbe_base(mb, "Port already connected: " + mb_util::join_names(comp_name, port_name))
71 {
72 }
73
74
75
76 mbe_incompatible_ports::mbe_incompatible_ports(mb_mblock *mb,
77                                                const std::string &comp1_name,
78                                                const std::string &port1_name,
79                                                const std::string &comp2_name,
80                                                const std::string &port2_name)
81   : mbe_base(mb, "Incompatible ports: "
82              + mb_util::join_names(comp1_name, port1_name) + " "
83              + mb_util::join_names(comp2_name, port2_name))
84 {
85 }
86
87 mbe_invalid_port_type::mbe_invalid_port_type(mb_mblock *mb,
88                                              const std::string &comp_name,
89                                              const std::string &port_name)
90   : mbe_base(mb, "Invalid port type for connection: " + mb_util::join_names(comp_name, port_name))
91 {
92 }
93
94 mbe_mblock_failed::mbe_mblock_failed(mb_mblock *mb,
95                                      const std::string &msg)
96   : mbe_base(mb, "Message block failed: " + msg)
97 {
98 }
99
100 mbe_terminate::mbe_terminate()
101 {
102 }
103
104 mbe_exit::mbe_exit()
105 {
106 }