summaryrefslogtreecommitdiff
path: root/sigc++/signal_base.h
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjell.ahlstedt@bredband.net>2015-11-16 15:31:06 +0100
committerKjell Ahlstedt <kjell.ahlstedt@bredband.net>2015-11-16 15:31:06 +0100
commit31132598511b2bfaa6671acbf6c2ed5a5eb151c6 (patch)
treea34baa29a100fc38a79bd5fadb361035a0ca18cd /sigc++/signal_base.h
parentd31a907d5ce83ed688519c96a299ebb21f44e12f (diff)
downloadsigc++-31132598511b2bfaa6671acbf6c2ed5a5eb151c6.tar.gz
Add a moving signal::connect() overload
* sigc++/macros/signal.h.m4: Add signal#::connect(slot_type&&), slot_list::insert(iterator i, slot_type&&), slot_list::push_front(slot_type&&), push_back(slot_type&&). * sigc++/signal_base.[h|cc]: Add signal_base::connect(slot_base&&), signal_base::insert(slot_base&&), signal_impl::connect(slot_base&&), signal_impl::insert(slot_base&&). Bug #756484.
Diffstat (limited to 'sigc++/signal_base.h')
-rw-r--r--sigc++/signal_base.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h
index 622135f..f50a6cb 100644
--- a/sigc++/signal_base.h
+++ b/sigc++/signal_base.h
@@ -126,6 +126,14 @@ struct SIGC_API signal_impl
*/
iterator_type connect(const slot_base& slot_);
+ /** Adds a slot at the bottom of the list of slots.
+ * @param slot_ The slot to add to the list of slots.
+ * @return An iterator pointing to the new slot in the list.
+ *
+ * @newin{2,8}
+ */
+ iterator_type connect(slot_base&& slot_);
+
/** Adds a slot at the given position into the list of slots.
* @param i An iterator indicating the position where @p slot_ should be inserted.
* @param slot_ The slot to add to the list of slots.
@@ -133,6 +141,15 @@ struct SIGC_API signal_impl
*/
iterator_type insert(iterator_type i, const slot_base& slot_);
+ /** Adds a slot at the given position into the list of slots.
+ * @param i An iterator indicating the position where @p slot_ should be inserted.
+ * @param slot_ The slot to add to the list of slots.
+ * @return An iterator pointing to the new slot in the list.
+ *
+ * @newin{2,8}
+ */
+ iterator_type insert(iterator_type i, slot_base&& slot_);
+
/** Removes the slot at the given position from the list of slots.
* @param i An iterator pointing to the slot to be removed.
* @return An iterator pointing to the slot in the list after the one removed.
@@ -349,6 +366,16 @@ protected:
*/
iterator_type connect(const slot_base& slot_);
+ /** Adds a slot at the end of the list of slots.
+ * With connect(), slots can also be added during signal emission.
+ * In this case, they won't be executed until the next emission occurs.
+ * @param slot_ The slot to add to the list of slots.
+ * @return An iterator pointing to the new slot in the list.
+ *
+ * @newin{2,8}
+ */
+ iterator_type connect(slot_base&& slot_);
+
/** Adds a slot at the given position into the list of slots.
* Note that this function does not work during signal emission!
* @param i An iterator indicating the position where @e slot_ should be inserted.
@@ -357,6 +384,16 @@ protected:
*/
iterator_type insert(iterator_type i, const slot_base& slot_);
+ /** Adds a slot at the given position into the list of slots.
+ * Note that this function does not work during signal emission!
+ * @param i An iterator indicating the position where @e slot_ should be inserted.
+ * @param slot_ The slot to add to the list of slots.
+ * @return An iterator pointing to the new slot in the list.
+ *
+ * @newin{2,8}
+ */
+ iterator_type insert(iterator_type i, slot_base&& slot_);
+
/** Removes the slot at the given position from the list of slots.
* Note that this function does not work during signal emission!
* @param i An iterator pointing to the slot to be removed.