GNU Radio 3.2.2 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2006,2008 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License along 00018 * with this program; if not, write to the Free Software Foundation, Inc., 00019 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00020 */ 00021 #ifndef INCLUDED_MB_EXCEPTION_H 00022 #define INCLUDED_MB_EXCEPTION_H 00023 00024 #include <stdexcept> 00025 00026 class mb_mblock; 00027 00028 00029 class mbe_base : public std::logic_error 00030 { 00031 public: 00032 mbe_base(mb_mblock *mb, const std::string &msg); 00033 }; 00034 00035 class mbe_not_implemented : public mbe_base 00036 { 00037 public: 00038 mbe_not_implemented(mb_mblock *mb, const std::string &msg); 00039 }; 00040 00041 class mbe_no_such_class : public mbe_base 00042 { 00043 public: 00044 mbe_no_such_class(mb_mblock *, const std::string &class_name); 00045 }; 00046 00047 class mbe_no_such_component : public mbe_base 00048 { 00049 public: 00050 mbe_no_such_component(mb_mblock *, const std::string &component_name); 00051 }; 00052 00053 class mbe_duplicate_component : public mbe_base 00054 { 00055 public: 00056 mbe_duplicate_component(mb_mblock *, const std::string &component_name); 00057 }; 00058 00059 class mbe_no_such_port : public mbe_base 00060 { 00061 public: 00062 mbe_no_such_port(mb_mblock *, const std::string &port_name); 00063 }; 00064 00065 00066 class mbe_duplicate_port : public mbe_base 00067 { 00068 public: 00069 mbe_duplicate_port(mb_mblock *, const std::string &port_name); 00070 }; 00071 00072 class mbe_already_connected : public mbe_base 00073 { 00074 public: 00075 mbe_already_connected(mb_mblock *, const std::string &comp_name, 00076 const std::string &port_name); 00077 }; 00078 00079 class mbe_incompatible_ports : public mbe_base 00080 { 00081 public: 00082 mbe_incompatible_ports(mb_mblock *, 00083 const std::string &comp1_name, 00084 const std::string &port1_name, 00085 const std::string &comp2_name, 00086 const std::string &port2_name); 00087 }; 00088 00089 class mbe_invalid_port_type : public mbe_base 00090 { 00091 public: 00092 mbe_invalid_port_type(mb_mblock *, const std::string &comp_name, 00093 const std::string &port_name); 00094 }; 00095 00096 class mbe_mblock_failed : public mbe_base 00097 { 00098 public: 00099 mbe_mblock_failed(mb_mblock *, const std::string &msg); 00100 }; 00101 00102 00103 00104 // not derived from mbe_base to simplify try/catch 00105 class mbe_terminate 00106 { 00107 public: 00108 mbe_terminate(); 00109 }; 00110 00111 // not derived from mbe_base to simplify try/catch 00112 class mbe_exit 00113 { 00114 public: 00115 mbe_exit(); 00116 }; 00117 00118 #endif /* INCLUDED_MB_EXCEPTION_H */