Skip to content

Commit a23850a

Browse files
committed
signal_exec: Rename to signal_exec_holder.
Because that's what it does. It doesn't execute anything.
1 parent 46b9dff commit a23850a

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

sigc++/signal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ struct signal_emit
264264
if (!impl)
265265
return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
266266

267-
signal_exec exec(impl);
267+
signal_impl_holder exec(impl);
268268
const temp_slot_list slots(impl->slots_);
269269

270270
self_type self(a...);
@@ -311,7 +311,7 @@ struct signal_emit<T_return, void, T_arg...>
311311
if (!impl || impl->slots_.empty())
312312
return T_return();
313313

314-
signal_exec exec(impl);
314+
signal_impl_holder exec(impl);
315315
T_return r_ = T_return();
316316

317317
// Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
@@ -367,7 +367,7 @@ struct signal_emit<void, void, T_arg...>
367367
{
368368
if (!impl || impl->slots_.empty())
369369
return;
370-
signal_exec exec(impl);
370+
signal_impl_holder exec(impl);
371371
const temp_slot_list slots(impl->slots_);
372372

373373
for (const auto& slot : slots)

sigc++/signal_base.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ signal_impl::clear()
6565
// Don't let signal_impl::notify() erase the slots. It would invalidate the
6666
// iterator in the following loop.
6767
const bool saved_deferred = deferred_;
68-
signal_exec exec(shared_from_this());
68+
signal_impl_holder exec(shared_from_this());
6969

7070
// Disconnect all connected slots before they are deleted.
7171
// signal_impl::notify() will be called and delete the self_and_iter structs.
@@ -121,7 +121,7 @@ signal_impl::erase(iterator_type i)
121121
// Don't let signal_impl::notify() erase the slot. It would be more
122122
// difficult to get the correct return value from signal_impl::erase().
123123
const bool saved_deferred = deferred_;
124-
signal_exec exec(shared_from_this());
124+
signal_impl_holder exec(shared_from_this());
125125

126126
// Disconnect the slot before it is deleted.
127127
// signal_impl::notify() will be called and delete the self_and_iter struct.
@@ -160,8 +160,8 @@ signal_impl::sweep()
160160
{
161161
// The deletion of a slot may cause the deletion of a signal_base,
162162
// a decrementation of ref_count_, and the deletion of this.
163-
// In that case, the deletion of this is deferred to ~signal_exec().
164-
signal_exec exec(shared_from_this());
163+
// In that case, the deletion of this is deferred to ~signal_impl_holder().
164+
signal_impl_holder exec(shared_from_this());
165165

166166
deferred_ = false;
167167
auto i = slots_.begin();
@@ -184,14 +184,14 @@ signal_impl::notify_self_and_iter_of_invalidated_slot(notifiable* d)
184184
{
185185
// The deletion of a slot may cause the deletion of a signal_base,
186186
// a decrementation of si->self_->ref_count_, and the deletion of si->self_.
187-
// In that case, the deletion of si->self_ is deferred to ~signal_exec().
188-
signal_exec exec(si->self_);
187+
// In that case, the deletion of si->self_ is deferred to ~signal_impl_holder().
188+
signal_impl_holder exec(si->self_);
189189
si->self_->slots_.erase(si->iter_);
190190
}
191191
else
192192
{
193193
// This is occuring during signal emission or slot erasure.
194-
// => sweep() will be called from ~signal_exec() after signal emission.
194+
// => sweep() will be called from ~signal_impl_holder() after signal emission.
195195
// This is safer because we don't have to care about our
196196
// iterators in emit(), clear(), and erase().
197197
si->self_->deferred_ = true;

sigc++/signal_base.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,25 +182,25 @@ struct SIGC_API signal_impl
182182
};
183183

184184
/// Exception safe sweeper for cleaning up invalid slots on the slot list.
185-
struct SIGC_API signal_exec
185+
struct SIGC_API signal_impl_holder
186186
{
187187
/** Increments the reference and execution counter of the parent sigc::signal_impl object.
188188
* @param sig The parent sigc::signal_impl object.
189189
*/
190-
inline signal_exec(const std::shared_ptr<signal_impl>& sig) noexcept
190+
inline signal_impl_holder(const std::shared_ptr<signal_impl>& sig) noexcept
191191
: sig_(sig)
192192
{
193193
sig_->reference_exec();
194194
}
195195

196-
signal_exec(const signal_exec& src) = delete;
197-
signal_exec operator=(const signal_exec& src) = delete;
196+
signal_impl_holder(const signal_impl_holder& src) = delete;
197+
signal_impl_holder operator=(const signal_impl_holder& src) = delete;
198198

199-
signal_exec(signal_exec&& src) = delete;
200-
signal_exec operator=(signal_exec&& src) = delete;
199+
signal_impl_holder(signal_impl_holder&& src) = delete;
200+
signal_impl_holder operator=(signal_impl_holder&& src) = delete;
201201

202202
/// Decrements the reference and execution counter of the parent sigc::signal_impl object.
203-
inline ~signal_exec() { sig_->unreference_exec(); }
203+
inline ~signal_impl_holder() { sig_->unreference_exec(); }
204204

205205
protected:
206206
/// The parent sigc::signal_impl object.

0 commit comments

Comments
 (0)