[libsigcplusplus] signal_exec: Rename to signal_exec_holder.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus] signal_exec: Rename to signal_exec_holder.
- Date: Sun, 24 Apr 2016 19:01:51 +0000 (UTC)
commit a23850a062a2346fbe434fa8b4f7cb85a94344c7
Author: Murray Cumming <murrayc murrayc com>
Date: Sat Apr 16 21:08:26 2016 +0200
signal_exec: Rename to signal_exec_holder.
Because that's what it does. It doesn't execute anything.
sigc++/signal.h | 6 +++---
sigc++/signal_base.cc | 14 +++++++-------
sigc++/signal_base.h | 14 +++++++-------
3 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/sigc++/signal.h b/sigc++/signal.h
index 39678b6..8c80659 100644
--- a/sigc++/signal.h
+++ b/sigc++/signal.h
@@ -264,7 +264,7 @@ struct signal_emit
if (!impl)
return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
- signal_exec exec(impl);
+ signal_impl_holder exec(impl);
const temp_slot_list slots(impl->slots_);
self_type self(a...);
@@ -311,7 +311,7 @@ public:
if (!impl || impl->slots_.empty())
return T_return();
- signal_exec exec(impl);
+ signal_impl_holder exec(impl);
T_return r_ = T_return();
// Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
@@ -367,7 +367,7 @@ public:
{
if (!impl || impl->slots_.empty())
return;
- signal_exec exec(impl);
+ signal_impl_holder exec(impl);
const temp_slot_list slots(impl->slots_);
for (const auto& slot : slots)
diff --git a/sigc++/signal_base.cc b/sigc++/signal_base.cc
index 5fdc051..3ad33ae 100644
--- a/sigc++/signal_base.cc
+++ b/sigc++/signal_base.cc
@@ -65,7 +65,7 @@ signal_impl::clear()
// Don't let signal_impl::notify() erase the slots. It would invalidate the
// iterator in the following loop.
const bool saved_deferred = deferred_;
- signal_exec exec(shared_from_this());
+ signal_impl_holder exec(shared_from_this());
// Disconnect all connected slots before they are deleted.
// signal_impl::notify() will be called and delete the self_and_iter structs.
@@ -121,7 +121,7 @@ signal_impl::erase(iterator_type i)
// Don't let signal_impl::notify() erase the slot. It would be more
// difficult to get the correct return value from signal_impl::erase().
const bool saved_deferred = deferred_;
- signal_exec exec(shared_from_this());
+ signal_impl_holder exec(shared_from_this());
// Disconnect the slot before it is deleted.
// signal_impl::notify() will be called and delete the self_and_iter struct.
@@ -160,8 +160,8 @@ signal_impl::sweep()
{
// The deletion of a slot may cause the deletion of a signal_base,
// a decrementation of ref_count_, and the deletion of this.
- // In that case, the deletion of this is deferred to ~signal_exec().
- signal_exec exec(shared_from_this());
+ // In that case, the deletion of this is deferred to ~signal_impl_holder().
+ signal_impl_holder exec(shared_from_this());
deferred_ = false;
auto i = slots_.begin();
@@ -184,14 +184,14 @@ signal_impl::notify_self_and_iter_of_invalidated_slot(notifiable* d)
{
// The deletion of a slot may cause the deletion of a signal_base,
// a decrementation of si->self_->ref_count_, and the deletion of si->self_.
- // In that case, the deletion of si->self_ is deferred to ~signal_exec().
- signal_exec exec(si->self_);
+ // In that case, the deletion of si->self_ is deferred to ~signal_impl_holder().
+ signal_impl_holder exec(si->self_);
si->self_->slots_.erase(si->iter_);
}
else
{
// This is occuring during signal emission or slot erasure.
- // => sweep() will be called from ~signal_exec() after signal emission.
+ // => sweep() will be called from ~signal_impl_holder() after signal emission.
// This is safer because we don't have to care about our
// iterators in emit(), clear(), and erase().
si->self_->deferred_ = true;
diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h
index 75a390e..d3b19a2 100644
--- a/sigc++/signal_base.h
+++ b/sigc++/signal_base.h
@@ -182,25 +182,25 @@ private:
};
/// Exception safe sweeper for cleaning up invalid slots on the slot list.
-struct SIGC_API signal_exec
+struct SIGC_API signal_impl_holder
{
/** Increments the reference and execution counter of the parent sigc::signal_impl object.
* @param sig The parent sigc::signal_impl object.
*/
- inline signal_exec(const std::shared_ptr<signal_impl>& sig) noexcept
+ inline signal_impl_holder(const std::shared_ptr<signal_impl>& sig) noexcept
: sig_(sig)
{
sig_->reference_exec();
}
- signal_exec(const signal_exec& src) = delete;
- signal_exec operator=(const signal_exec& src) = delete;
+ signal_impl_holder(const signal_impl_holder& src) = delete;
+ signal_impl_holder operator=(const signal_impl_holder& src) = delete;
- signal_exec(signal_exec&& src) = delete;
- signal_exec operator=(signal_exec&& src) = delete;
+ signal_impl_holder(signal_impl_holder&& src) = delete;
+ signal_impl_holder operator=(signal_impl_holder&& src) = delete;
/// Decrements the reference and execution counter of the parent sigc::signal_impl object.
- inline ~signal_exec() { sig_->unreference_exec(); }
+ inline ~signal_impl_holder() { sig_->unreference_exec(); }
protected:
/// The parent sigc::signal_impl object.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]