|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49152 - in sandbox/thread_safe_signals/trunk/libs/signals2: doc/reference test
From: fmhess_at_[hidden]
Date: 2008-10-06 16:13:58
Author: fmhess
Date: 2008-10-06 16:13:58 EDT (Mon, 06 Oct 2008)
New Revision: 49152
URL: http://svn.boost.org/trac/boost/changeset/49152
Log:
Made shared_connection_block take a const reference to a signal.
This is more consistent since connection::disconnect is a const method.
Text files modified:
sandbox/thread_safe_signals/trunk/libs/signals2/doc/reference/shared_connection_block.xml | 2 +-
sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletions(-)
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/doc/reference/shared_connection_block.xml
==============================================================================
--- sandbox/thread_safe_signals/trunk/libs/signals2/doc/reference/shared_connection_block.xml (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/doc/reference/shared_connection_block.xml 2008-10-06 16:13:58 EDT (Mon, 06 Oct 2008)
@@ -38,7 +38,7 @@
<constructor>
<parameter name="conn">
- <paramtype>boost::signals2::connection &</paramtype>
+ <paramtype>const boost::signals2::connection &</paramtype>
</parameter>
<effects>
Modified: sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp
==============================================================================
--- sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp (original)
+++ sandbox/thread_safe_signals/trunk/libs/signals2/test/deletion_test.cpp 2008-10-06 16:13:58 EDT (Mon, 06 Oct 2008)
@@ -108,6 +108,22 @@
s0(); std::cout << std::endl;
BOOST_CHECK(test_output == "123");
+ std::cout << "Blocking 1 through const connection" << std::endl;
+
+ {
+ const boost::signals2::connection conn = connections[1];
+ boost::signals2::shared_connection_block block(conn);
+ test_output = "";
+ s0(); std::cout << std::endl;
+ BOOST_CHECK(test_output == "23");
+ }
+
+ std::cout << "Unblocking 1" << std::endl;
+
+ test_output = "";
+ s0(); std::cout << std::endl;
+ BOOST_CHECK(test_output == "123");
+
s0.disconnect_all_slots();
BOOST_CHECK(s0.empty());
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk