diff options
Diffstat (limited to 'src/lib/netlist/nl_base.cpp')
-rw-r--r-- | src/lib/netlist/nl_base.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 0ccfc788d9f..485f1b47f80 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -161,7 +161,7 @@ namespace netlist { } - detail::terminal_type detail::core_terminal_t::type() const + detail::terminal_type detail::core_terminal_t::type() const noexcept(false) { if (dynamic_cast<const terminal_t *>(this) != nullptr) return terminal_type::TERMINAL; @@ -174,7 +174,8 @@ namespace netlist else { state().log().fatal(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); - return terminal_type::TERMINAL; // please compiler + plib::pthrow<nl_exception>(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); + //return terminal_type::TERMINAL; // please compiler } } @@ -494,7 +495,10 @@ namespace netlist if (cc(d.second.get())) { if (ret != nullptr) + { m_log.fatal(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); + plib::pthrow<nl_exception>(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); + } else ret = d.second.get(); } @@ -604,7 +608,10 @@ namespace netlist void device_t::connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2) { if (!state().setup().connect(t1, t2)) + { log().fatal(MF_ERROR_CONNECTING_1_TO_2(t1.name(), t2.name())); + plib::pthrow<nl_exception>(MF_ERROR_CONNECTING_1_TO_2(t1.name(), t2.name())); + } } @@ -681,18 +688,21 @@ namespace netlist } } - void detail::net_t::add_terminal(detail::core_terminal_t &terminal) NL_NOEXCEPT + void detail::net_t::add_terminal(detail::core_terminal_t &terminal) noexcept(false) { for (auto &t : m_core_terms) if (t == &terminal) + { state().log().fatal(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name())); + plib::pthrow<nl_exception>(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name())); + } terminal.set_net(this); m_core_terms.push_back(&terminal); } - void detail::net_t::remove_terminal(detail::core_terminal_t &terminal) NL_NOEXCEPT + void detail::net_t::remove_terminal(detail::core_terminal_t &terminal) noexcept(false) { if (plib::container::contains(m_core_terms, &terminal)) { @@ -700,7 +710,10 @@ namespace netlist plib::container::remove(m_core_terms, &terminal); } else + { state().log().fatal(MF_REMOVE_TERMINAL_1_FROM_NET_2(terminal.name(), this->name())); + plib::pthrow<nl_exception>(MF_REMOVE_TERMINAL_1_FROM_NET_2(terminal.name(), this->name())); + } } void detail::net_t::move_connections(detail::net_t &dest_net) @@ -872,7 +885,7 @@ namespace netlist device.state().setup().register_param_t(this->name(), *this); } - param_t::param_type_t param_t::param_type() const + param_t::param_type_t param_t::param_type() const noexcept(false) { if (dynamic_cast<const param_str_t *>(this) != nullptr) return STRING; @@ -887,7 +900,7 @@ namespace netlist else { state().log().fatal(MF_UNKNOWN_PARAM_TYPE(name())); - return POINTER; /* Please compiler */ + plib::pthrow<nl_exception>(MF_UNKNOWN_PARAM_TYPE(name())); } } @@ -928,7 +941,8 @@ namespace netlist void param_model_t::changed() { - state().log().fatal(MF_MODEL_1_CAN_NOT_BE_CHANGED_AT_RUNTIME(name())); + // FIXME: should we really throw here ? + plib::pthrow<nl_exception>(MF_MODEL_1_CAN_NOT_BE_CHANGED_AT_RUNTIME(name())); } const pstring param_model_t::value_str(const pstring &entity) |