diff options
author | couriersud <couriersud@arcor.de> | 2016-12-30 20:29:07 +0100 |
---|---|---|
committer | couriersud <couriersud@arcor.de> | 2016-12-30 23:42:23 +0100 |
commit | f1a6e2b47ebfb03989743d72484e3e30dcdb7c8b (patch) | |
tree | f24b8e938bb49af8795cb23d208aa9e4ec08ce5b /src/lib/netlist/nl_base.h | |
parent | b1516cc7a3f756750261260bb3fc79f507da9762 (diff) |
Align noexcept usage. Rename register_con to add_terminal for clearity.
Fix bug introduced with last commit. (nw)
Diffstat (limited to 'src/lib/netlist/nl_base.h')
-rw-r--r-- | src/lib/netlist/nl_base.h | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index def52d3ff69..6b515a20c1c 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -302,9 +302,9 @@ namespace netlist const T &value //!< Initial value after construction ); //! Copy Constructor. - state_var(const state_var &rhs) noexcept = default; + state_var(const state_var &rhs) NL_NOEXCEPT = default; //! Move Constructor. - state_var(state_var &&rhs) noexcept = default; + state_var(state_var &&rhs) NL_NOEXCEPT = default; //! Assignment operator to assign value of a state var. state_var &operator=(state_var rhs) { std::swap(rhs.m_value, this->m_value); return *this; } //! Assignment operator to assign value of type T. @@ -332,8 +332,8 @@ namespace netlist { public: state_var(device_t &dev, const pstring name, const T & value); - state_var(const state_var &rhs) noexcept = default; - state_var(state_var &&rhs) noexcept = default; + state_var(const state_var &rhs) NL_NOEXCEPT = default; + state_var(state_var &&rhs) NL_NOEXCEPT = default; state_var &operator=(const state_var rhs) { m_value = rhs.m_value; return *this; } state_var &operator=(const T rhs) { m_value = rhs; return *this; } T & operator[](const std::size_t i) { return m_value[i]; } @@ -496,8 +496,8 @@ namespace netlist const net_t & net() const { return *m_net;} net_t & net() { return *m_net;} - bool is_logic() const noexcept; - bool is_analog() const noexcept; + bool is_logic() const NL_NOEXCEPT; + bool is_analog() const NL_NOEXCEPT; bool is_state(const state_e astate) const { return (m_state == astate); } state_e state() const { return m_state; } @@ -524,8 +524,8 @@ namespace netlist { } - const analog_net_t & net() const noexcept; - analog_net_t & net() noexcept; + const analog_net_t & net() const NL_NOEXCEPT; + analog_net_t & net() NL_NOEXCEPT; }; // ----------------------------------------------------------------------------- @@ -609,8 +609,8 @@ namespace netlist devices::nld_base_proxy *get_proxy() const { return m_proxy; } void set_proxy(devices::nld_base_proxy *proxy) { m_proxy = proxy; } - logic_net_t & net() noexcept; - const logic_net_t & net() const noexcept; + logic_net_t & net() NL_NOEXCEPT; + const logic_net_t & net() const NL_NOEXCEPT; protected: @@ -627,7 +627,7 @@ namespace netlist public: logic_input_t(core_device_t &dev, const pstring &aname); - netlist_sig_t Q() const noexcept; + netlist_sig_t Q() const NL_NOEXCEPT; netlist_sig_t operator()() const NL_NOEXCEPT { @@ -667,7 +667,7 @@ namespace netlist /*! returns voltage at terminal. * \returns voltage at terminal. */ - nl_double Q_Analog() const noexcept; + nl_double Q_Analog() const NL_NOEXCEPT; }; @@ -687,16 +687,16 @@ namespace netlist void reset(); - void register_con(core_terminal_t &terminal); + void add_terminal(core_terminal_t &terminal); - bool is_logic() const noexcept; - bool is_analog() const noexcept; + bool is_logic() const NL_NOEXCEPT; + bool is_analog() const NL_NOEXCEPT; void toggle_new_Q() { m_new_Q ^= 1; } void force_queue_execution() { m_new_Q = (m_cur_Q ^ 1); } - void push_to_queue(const netlist_time delay) noexcept; - void reschedule_in_queue(const netlist_time delay) noexcept; + void push_to_queue(const netlist_time delay) NL_NOEXCEPT; + void reschedule_in_queue(const netlist_time delay) NL_NOEXCEPT; bool is_queued() const { return m_in_queue == 1; } void update_devs() NL_NOEXCEPT; @@ -707,7 +707,7 @@ namespace netlist bool isRailNet() const { return !(m_railterminal == nullptr); } core_terminal_t & railterminal() const { return *m_railterminal; } - std::size_t num_cons() const noexcept { return m_core_terms.size(); } + std::size_t num_cons() const NL_NOEXCEPT { return m_core_terms.size(); } void inc_active(core_terminal_t &term) NL_NOEXCEPT; void dec_active(core_terminal_t &term) NL_NOEXCEPT; @@ -747,7 +747,7 @@ namespace netlist netlist_sig_t new_Q() const { return m_new_Q; } void initial(const netlist_sig_t val) { m_cur_Q = m_new_Q = val; } - void set_Q(const netlist_sig_t newQ, const netlist_time delay) noexcept + void set_Q(const netlist_sig_t newQ, const netlist_time delay) NL_NOEXCEPT { if (newQ != m_new_Q) { @@ -756,7 +756,7 @@ namespace netlist } } - void set_Q_time(const netlist_sig_t newQ, const netlist_time at) noexcept + void set_Q_time(const netlist_sig_t newQ, const netlist_time at) NL_NOEXCEPT { if (newQ != m_new_Q) { @@ -811,7 +811,7 @@ namespace netlist void initial(const netlist_sig_t val); - void push(const netlist_sig_t newQ, const netlist_time delay) noexcept + void push(const netlist_sig_t newQ, const netlist_time delay) NL_NOEXCEPT { m_my_net.set_Q(newQ, delay); // take the shortcut } @@ -826,11 +826,11 @@ namespace netlist public: analog_output_t(core_device_t &dev, const pstring &aname); - void push(const nl_double val) noexcept { set_Q(val); } + void push(const nl_double val) NL_NOEXCEPT { set_Q(val); } void initial(const nl_double val); private: - void set_Q(const nl_double newQ) noexcept; + void set_Q(const nl_double newQ) NL_NOEXCEPT; analog_net_t m_my_net; }; @@ -1019,7 +1019,7 @@ namespace netlist void set_delegate_pointer(); void stop_dev(); - void do_inc_active() noexcept + void do_inc_active() NL_NOEXCEPT { if (m_hint_deactivate) { @@ -1028,7 +1028,7 @@ namespace netlist } } - void do_dec_active() noexcept + void do_dec_active() NL_NOEXCEPT { if (m_hint_deactivate) dec_active(); @@ -1044,8 +1044,8 @@ namespace netlist protected: virtual void update() NL_NOEXCEPT { } - virtual void inc_active() noexcept { } - virtual void dec_active() noexcept { } + virtual void inc_active() NL_NOEXCEPT { } + virtual void dec_active() NL_NOEXCEPT { } virtual void stop() { } virtual void reset() { } @@ -1182,7 +1182,7 @@ namespace netlist devices::NETLIB_NAME(gnd) *gnd() const { return m_gnd; } nl_double gmin() const; - void push_to_queue(detail::net_t &out, const netlist_time attime) noexcept; + void push_to_queue(detail::net_t &out, const netlist_time attime) NL_NOEXCEPT; void remove_from_queue(detail::net_t &out) NL_NOEXCEPT; void process_queue(const netlist_time &delta); @@ -1302,22 +1302,22 @@ namespace netlist // inline implementations // ----------------------------------------------------------------------------- - inline bool detail::core_terminal_t::is_logic() const noexcept + inline bool detail::core_terminal_t::is_logic() const NL_NOEXCEPT { return dynamic_cast<const logic_t *>(this) != nullptr; } - inline bool detail::core_terminal_t::is_analog() const noexcept + inline bool detail::core_terminal_t::is_analog() const NL_NOEXCEPT { return dynamic_cast<const analog_t *>(this) != nullptr; } - inline bool detail::net_t::is_logic() const noexcept + inline bool detail::net_t::is_logic() const NL_NOEXCEPT { return dynamic_cast<const logic_net_t *>(this) != nullptr; } - inline bool detail::net_t::is_analog() const noexcept + inline bool detail::net_t::is_analog() const NL_NOEXCEPT { return dynamic_cast<const analog_net_t *>(this) != nullptr; } @@ -1358,7 +1358,7 @@ namespace netlist } } - inline void detail::net_t::push_to_queue(const netlist_time delay) noexcept + inline void detail::net_t::push_to_queue(const netlist_time delay) NL_NOEXCEPT { if (!is_queued() && (num_cons() != 0)) { @@ -1371,7 +1371,7 @@ namespace netlist } } - inline void detail::net_t::reschedule_in_queue(const netlist_time delay) noexcept + inline void detail::net_t::reschedule_in_queue(const netlist_time delay) NL_NOEXCEPT { if (is_queued()) netlist().remove_from_queue(*this); @@ -1384,39 +1384,39 @@ namespace netlist } } - inline const analog_net_t & analog_t::net() const noexcept + inline const analog_net_t & analog_t::net() const NL_NOEXCEPT { return static_cast<const analog_net_t &>(core_terminal_t::net()); } - inline analog_net_t & analog_t::net() noexcept + inline analog_net_t & analog_t::net() NL_NOEXCEPT { return static_cast<analog_net_t &>(core_terminal_t::net()); } inline nl_double terminal_t::operator ()() const { return net().Q_Analog(); } - inline logic_net_t & logic_t::net() noexcept + inline logic_net_t & logic_t::net() NL_NOEXCEPT { return *static_cast<logic_net_t *>(&core_terminal_t::net()); } - inline const logic_net_t & logic_t::net() const noexcept + inline const logic_net_t & logic_t::net() const NL_NOEXCEPT { return static_cast<const logic_net_t &>(core_terminal_t::net()); } - inline netlist_sig_t logic_input_t::Q() const noexcept + inline netlist_sig_t logic_input_t::Q() const NL_NOEXCEPT { return net().Q(); } - inline nl_double analog_input_t::Q_Analog() const noexcept + inline nl_double analog_input_t::Q_Analog() const NL_NOEXCEPT { return net().Q_Analog(); } - inline void analog_output_t::set_Q(const nl_double newQ) noexcept + inline void analog_output_t::set_Q(const nl_double newQ) NL_NOEXCEPT { if (newQ != net().Q_Analog()) { @@ -1426,7 +1426,7 @@ namespace netlist } } - inline void netlist_t::push_to_queue(detail::net_t &out, const netlist_time attime) noexcept + inline void netlist_t::push_to_queue(detail::net_t &out, const netlist_time attime) NL_NOEXCEPT { m_queue.push(attime, &out); } |