shared_connection_block.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE header PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  3. "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
  4. <!--
  5. Copyright Frank Mori Hess 2007-2009
  6. Distributed under the Boost Software License, Version 1.0. (See accompanying
  7. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. -->
  9. <header name="boost/signals2/shared_connection_block.hpp" last-revision="$Date: 2007-03-06 16:51:55 -0500 (Tue, 06 Mar 2007) $">
  10. <using-namespace name="boost::signals2"/>
  11. <using-namespace name="boost"/>
  12. <using-class name="boost::signals2::connection"/>
  13. <namespace name="boost">
  14. <namespace name="signals2">
  15. <class name="shared_connection_block">
  16. <purpose>Blocks a connection between a signal and a slot.</purpose>
  17. <description>
  18. <para>A <code>shared_connection_block</code> object blocks a
  19. connection, preventing the associated slot from executing when the
  20. associated signal is invoked. The connection will remain
  21. blocked until every <code>shared_connection_block</code> that references
  22. the connection
  23. releases its block. A <code>shared_connection_block</code> releases
  24. its block when it is destroyed or its
  25. <methodname>unblock</methodname> method is called.</para>
  26. <para>A <code>shared_connection_block</code> is safe to use even
  27. after the <classname>signals2::connection</classname> object it was constructed
  28. from has been destroyed, or the connection it references has been
  29. disconnected.</para>
  30. <para>
  31. Note, blocking a connection does not guarantee the associated slot
  32. has finished execution if it is already in the process of being run
  33. when the connection block goes into effect. This is similar
  34. to the behaviour of disconnect, in that blocking a connection
  35. will not wait for the connection's associated slot to complete execution.
  36. This situation may arise in a multi-threaded environment if the
  37. connection block goes into effect concurrently with signal invocation,
  38. or in a single-threaded environment if a slot blocks its own
  39. connection.
  40. </para>
  41. </description>
  42. <constructor>
  43. <parameter name="conn">
  44. <paramtype>const <classname>boost::signals2::connection</classname> &amp;</paramtype>
  45. <default>connection()</default>
  46. </parameter>
  47. <parameter name="initially_blocking">
  48. <paramtype>bool</paramtype>
  49. <default>true</default>
  50. </parameter>
  51. <effects>
  52. <para>Creates a <code>shared_connection_block</code> which can block
  53. the connection referenced by <code>conn</code>. The <code>shared_connection_block</code>
  54. will initially block the connection if and only if the
  55. <code>initially_blocking</code>
  56. parameter is <code>true</code>. The block on the connection may be released
  57. by calling the <methodname>unblock</methodname> method,
  58. or destroying the <code>shared_connection_block</code> object.</para>
  59. <para>Default construction of a <code>shared_connection_block</code> results in a
  60. <code>shared_connection_block</code> which references the NULL connection.
  61. Such a <code>shared_connection_block</code> is safe to use, though not
  62. particularly useful until it is assigned another
  63. <code>shared_connection_block</code> which references a real connection.
  64. </para>
  65. </effects>
  66. <postconditions><para><code>this->blocking() == initially_blocking</code></para></postconditions>
  67. </constructor>
  68. <constructor>
  69. <parameter name="other">
  70. <paramtype>const boost::signals2::shared_connection_block &amp;</paramtype>
  71. </parameter>
  72. <effects>
  73. <para>
  74. Copy constructs a <code>shared_connection_block</code> which references
  75. the same connection as <code>other</code>.
  76. </para>
  77. </effects>
  78. <postconditions>
  79. <para><code>this->connection() == other.connection()</code></para>
  80. <para><code>this->blocking() == other.blocking()</code></para>
  81. </postconditions>
  82. </constructor>
  83. <destructor>
  84. <effects><para>If <methodname>blocking</methodname>() is true, releases the connection block.</para></effects>
  85. </destructor>
  86. <copy-assignment>
  87. <parameter name="rhs">
  88. <paramtype>const boost::signals2::shared_connection_block &amp;</paramtype>
  89. </parameter>
  90. <effects>
  91. <para>
  92. Makes <code>this</code> reference the same connection as <code>rhs</code>.
  93. </para>
  94. </effects>
  95. <postconditions>
  96. <para><code>this->connection() == rhs.connection()</code></para>
  97. <para><code>this->blocking() == rhs.blocking()</code></para>
  98. </postconditions>
  99. <throws><para>Will not throw.</para></throws>
  100. </copy-assignment>
  101. <method-group name="connection blocking">
  102. <method name="unblock">
  103. <type>void</type>
  104. <effects><para>If <methodname>blocking</methodname>() is true, releases the connection block.
  105. Note, the connection may remain blocked due to
  106. other <code>shared_connection_block</code> objects.</para></effects>
  107. <postconditions><para><code>this->blocking() == false</code>.</para></postconditions>
  108. </method>
  109. <method name="block">
  110. <type>void</type>
  111. <effects><para>If <methodname>blocking</methodname>() is false, reasserts a block on
  112. the connection.</para></effects>
  113. <postconditions><para><code>this->blocking() == true</code>.</para></postconditions>
  114. </method>
  115. <method name="blocking" cv="const">
  116. <type>bool</type>
  117. <returns><para><code>true</code> if <code>this</code> is asserting a block on the connection.</para></returns>
  118. <notes><para><code>this->blocking() == true</code> implies <code><methodname>connection::blocked</methodname>() == true</code>
  119. for the connection. However, <code>this->blocking() == false</code> does not necessarily imply
  120. <code>connection::blocked() == false</code>, since the connection may be
  121. blocked by another <code>shared_connection_block</code> object.</para></notes>
  122. </method>
  123. </method-group>
  124. <method-group name="miscellaneous methods">
  125. <method name="connection" cv="const">
  126. <type><classname>boost::signals2::connection</classname></type>
  127. <returns>
  128. <para>A connection object for the connection referenced by <code>this</code>.</para>
  129. </returns>
  130. </method>
  131. </method-group>
  132. </class>
  133. </namespace>
  134. </namespace>
  135. </header>