From: Marc Fehling Date: Sat, 17 Dec 2022 04:31:32 +0000 (-0700) Subject: Remove deprecated LegacySignal. X-Git-Tag: relicensing~840^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15539%2Fhead;p=dealii.git Remove deprecated LegacySignal. --- diff --git a/doc/news/changes/incompatibilities/20230627Fehling b/doc/news/changes/incompatibilities/20230627Fehling new file mode 100644 index 0000000000..77ea5ad108 --- /dev/null +++ b/doc/news/changes/incompatibilities/20230627Fehling @@ -0,0 +1,5 @@ +Removed: The deprecated signal Triangulation::Signals::cell_weight +has been removed along with the deprecated class LegacySignal. Use +Triangulation::Signals::weight instead. +
+(Marc Fehling, 2023/06/27) diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index f0777fc82f..cd10daeed1 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -2242,160 +2242,6 @@ public: CellWeightSum> weight; - /** - * Constructor. - * - * Connects a deprecated signal to its successor. - */ - Signals() - : cell_weight(weight) - {} - - /** - * Legacy signal emulation to deprecate the old signal. - */ - class LegacySignal - { - public: - using signature_type = unsigned int(const cell_iterator &, - const CellStatus); - using combiner_type = CellWeightSum; - - using slot_function_type = boost::function; - using slot_type = - boost::signals2::slot; - - /** - * Constructor. - */ - LegacySignal( - boost::signals2::signal &new_signal) - : new_signal(new_signal) - {} - - /** - * Destructor. - */ - ~LegacySignal() - { - base_weight.disconnect(); - } - - /** - * Connects a function to the signal. - * - * Connects an additional base weight function if signal was previously - * empty. - */ - DEAL_II_DEPRECATED - boost::signals2::connection - connect( - const slot_type & slot, - boost::signals2::connect_position position = boost::signals2::at_back) - { - if (base_weight.connected() == false) - { - base_weight = new_signal.connect( - [](const cell_iterator &, const CellStatus) -> unsigned int { - return 1000; - }); - Assert(base_weight.connected() && new_signal.num_slots() == 1, - ExcInternalError()); - } - - return new_signal.connect(slot, position); - } - - /** - * Returns the number of connected functions without the base - * weight. - */ - DEAL_II_DEPRECATED - std::size_t - num_slots() const - { - return new_signal.num_slots() - - static_cast(base_weight.connected()); - } - - /** - * Checks if there are any connected functions to the signal. - */ - DEAL_II_DEPRECATED - bool - empty() const - { - if (num_slots() == 0) - { - Assert(new_signal.num_slots() == 0, ExcInternalError()); - return true; - } - return false; - } - - /** - * Disconnects a function from the signal. - * - * Also disconnects the base weight function if it is the last connected - * function. - */ - template - DEAL_II_DEPRECATED void - disconnect(const S &connection) - { - new_signal.disconnect(connection); - - if (num_slots() == 0) - { - Assert(base_weight.connected() && new_signal.num_slots() == 1, - ExcInternalError()); - new_signal.disconnect(base_weight); - } - } - - /** - * Triggers the signal. - */ - DEAL_II_DEPRECATED - unsigned int - operator()(const cell_iterator &iterator, const CellStatus status) - { - return new_signal(iterator, status); - } - - private: - /** - * Monitors the connection of the base weight function. - */ - boost::signals2::connection base_weight; - - /** - * Reference to the successor signal. - */ - boost::signals2::signal &new_signal; - }; - - /** - * @copydoc weight - * - * As a reference, a value of 1000 is added for every cell to the total - * weight. This means a signal return value of 1000 (resulting in a weight - * of 2000) means that it is twice as expensive for a process to handle this - * particular cell. - * - * @deprecated Use the `weight` signal instead which omits the base weight. - * You can invoke the old behavior by connecting a function to the signal - * that returns the base weight as follows. This function should be added - * in addition to the one that actually computes the weight. - * @code{.cc} - * triangulation.signals.weight.connect( - * [](const typename Triangulation::cell_iterator &, - * const typename Triangulation::CellStatus) - * -> unsigned int { return 1000; }); - * @endcode - */ - LegacySignal cell_weight; - /** * This signal is triggered at the beginning of execution of the * parallel::distributed::Triangulation::execute_coarsening_and_refinement()