Author: jinq0123@xxxxxxx Date: Sat Jun 13 02:51:12 2009 New Revision: 263 Modified: trunk/doc/html/signals2/examples.html Log: 完成Signals2例程 Modified: trunk/doc/html/signals2/examples.html ============================================================================== --- trunk/doc/html/signals2/examples.html (original) +++ trunk/doc/html/signals2/examples.html Sat Jun 13 02:51:12 2009 @@ -1,11 +1,11 @@ <html> <head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Example programs</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.74.3"><link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
-<link rel="up" href="../signals2.html" title="Chapter 17. Boost.Signals2"> +<link rel="up" href="../signals2.html" title="Chapter 17. Boost.Signals2"> <link rel="prev" href="tutorial.html" title="Tutorial"> <link rel="next" href="reference.html" title="Reference"> </head> @@ -25,14 +25,29 @@ <div class="section" lang="en"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="signals2.examples"></a>Example programs</h2></div></div></div> + +<div class="titlepage"><div><div><h2 class="title" style="clear: both"> +<a name="signals2.examples"></a>例程</h2></div></div></div> + <div class="toc"><dl><dt><span class="section"><a href="examples.html#signals2.examples.misc">Miscellaneous Tutorial Examples</a></span></dt> <dt><span class="section"><a href="examples.html#signals2.examples.document-view">Document-View</a></span></dt> <dt><span class="section"><a href="examples.html#signals2.examples.deconstruct">Postconstructors and Predestructors with deconstruct()</a></span></dt>
</dl></div> + +<div class="toc"><dl>+<dt><span class="section"><a href="examples.html#signals2.examples.misc">各 种教学示例</a></span></dt> +<dt><span class="section"><a href="examples.html#signals2.examples.document-view">文档-视图 </a></span></dt> +<dt><span class="section"><a href="examples.html#signals2.examples.deconstruct">用 deconstruct() 定义 postconstructor 和 predestructor</a></span></dt>
+</dl></div> + <div class="section" lang="en"> <div class="titlepage"><div><div><h3 class="title"><a name="signals2.examples.misc"></a>Miscellaneous Tutorial Examples</h3></div></div></div>
+ +<div class="titlepage"><div><div><h3 class="title"> +<a name="signals2.examples.misc"></a>各种教学示例</h3></div></div></div> + <div class="toc"><dl><dt><span class="section"><a href="examples.html#signals2.examples.tutorial.hello_world_slot">hello_world_slot</a></span></dt> <dt><span class="section"><a href="examples.html#signals2.examples.tutorial.hello_world_multi_slot">hello_world_multi_slot</a></span></dt>
@@ -51,6 +66,11 @@ This example is a basic example of connecting a slot to a signal and then invoking the signal. </p> + +<p> + 本例是把插槽连接到信号并调用信号的基本例子。 + </p> + <p>Download <a href="../../../libs/signals2/example/hello_world_slot.cpp" target="_top">hello_world_slot.cpp</a>.
</p> @@ -62,6 +82,12 @@This example extends the hello_world_slot example slightly by connecting more than one
slot to the signal before invoking it. </p> + +<p> + 本例稍稍扩展了 hello_world_slot 的例子, + 它所调用的信号连接了多个插槽。 + </p> + <p>Download <a href="../../../libs/signals2/example/hello_world_multi_slot.cpp" target="_top">hello_world_multi_slot.cpp</a>.
</p> @@ -74,6 +100,12 @@ using slot groups to specify the order slots should be invoked. </p> + +<p> + 本例稍稍扩展了 hello_world_multi_slot 的例子, + 它使用插槽组来指定插槽调用的顺序。 + </p> + <p>Download <a href="../../../libs/signals2/example/ordering_slots.cpp" target="_top">ordering_slots.cpp</a>.
</p> @@ -84,6 +116,11 @@ <p>The slot_arguments program shows how to pass arguments from a signal invocation to slots.
</p> + +<p> + 程序 slot_arguments 显示了如何将信号调用的参数传递给插槽。 + </p> + <p>Download <a href="../../../libs/signals2/example/slot_arguments.cpp" target="_top">slot_arguments.cpp</a>.
</p> @@ -95,6 +132,14 @@This example shows how to return a value from slots to the signal invocation. It uses the default <code class="computeroutput"><a class="link" href="../boost/signals2/optional_last_value.html" title="Class template optional_last_value">optional_last_value</a></code> combiner.
</p> + +<p> + 本例显示了如何从插槽向信号调用返回一个值。 + 它使用了默认的+ <code class="computeroutput"><a class="link" href="../boost/signals2/optional_last_value.html" title="Class template optional_last_value">optional_last_value</a></code>
+ 合并器。 + </p> + <p>Download <a href="../../../libs/signals2/example/signal_return_value.cpp" target="_top">signal_return_value.cpp</a>.
</p> @@ -106,6 +151,12 @@This example shows more returning of values from slots to the signal invocation.
This time, custom combiners are defined and used. </p> + +<p> + 本例进一步显示了从插槽向信号调用返回值。 + 这次,定义并使用了自定义合并器。 + </p> + <p>Download <a href="../../../libs/signals2/example/custom_combiners.cpp" target="_top">custom_combiners.cpp</a>.
</p> @@ -117,6 +168,14 @@This example demonstrates various means of manually disconnecting slots, as well as temporarily blocking them via <code class="computeroutput"><a class="link" href="../boost/signals2/shared_connection_block.html" title="Class shared_connection_block">shared_connection_block</a></code>.
</p> + +<p> + 本例演示了手工断开插槽的各样方法, + 以及通过+ <code class="computeroutput"><a class="link" href="../boost/signals2/shared_connection_block.html" title="Class shared_connection_block">shared_connection_block</a></code>
+ 临时阻塞插槽。 + </p> + <p>Download <a href="../../../libs/signals2/example/disconnect_and_block.cpp" target="_top">disconnect_and_block.cpp</a>.
</p> @@ -128,6 +187,11 @@This example demonstrates the passing of slot functions to a private signal
through a non-template interface. </p> + +<p> + 本例演示了通过非模板接口,向私有的信号传递插槽函数。 + </p> + <p>Download <a href="../../../libs/signals2/example/passing_slots.cpp" target="_top">passing_slots.cpp</a>.
</p> @@ -140,6 +204,13 @@accepts a reference to its invoking signal-slot connection as an additional argument, permitting the slot to temporarily block or permanently disconnect itself.
</p> + +<p> + 本例演示了在信号上连接一个扩展插槽(extended slot)。 + 扩展插槽可接受一个附加参数,该参数指向产生调用的信号-插槽连接, + 以允许插槽临时阻塞或永久断开自身。 + </p> + <p>Download <a href="../../../libs/signals2/example/extended_slot.cpp" target="_top">extended_slot.cpp</a>.
</p> @@ -148,6 +219,10 @@ <div class="section" lang="en"> <div class="titlepage"><div><div><h3 class="title"><a name="signals2.examples.document-view"></a>Document-View</h3></div></div></div>
+ +<div class="titlepage"><div><div><h3 class="title">+<a name="signals2.examples.document-view"></a>文档-视图 </h3></div></div></div>
+ <div class="toc"><dl><dt><span class="section"><a href="examples.html#signals2.examples.document-view.doc_view">doc_view</a></span></dt> <dt><span class="section"><a href="examples.html#signals2.examples.document-view.doc_view_acm">doc_view_acm</a></span></dt>
@@ -162,6 +237,14 @@ usage of a signal and slots to implement two different views of a text document. </p> + +<p> + 这就是+ <a class="link" href="tutorial.html#signals2.tutorial.document-view" title="Example: Document-View">教程</a>
+ 中所述的 document-view 例程。 + 它显示了如何用信号插槽实现文本文档的两个不同视图。 + </p> + <p>Download <a href="../../../libs/signals2/example/doc_view.cpp" target="_top">doc_view.cpp</a>.
</p> @@ -173,6 +256,12 @@ This program modifies the original doc_view.cpp example to employ automatic connection management. </p> + +<p> + 本程序更改了原来的 doc_view.cpp 例子, + 它采用了自动连接管理。 + </p> + <p>Download <a href="../../../libs/signals2/example/doc_view_acm.cpp" target="_top">doc_view_acm.cpp</a>.
</p> @@ -184,6 +273,14 @@This program modifies the doc_view_acm.cpp example to use postconstructors and the <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code> factory function.
</p> + +<p> + 本程序更改了 doc_view_acm.cpp 例子, + 以使用 postconstructor 和+ <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code>
+ 工厂函数。 + </p> + <p>Download <a href="../../../libs/signals2/example/doc_view_acm_deconstruct.cpp" target="_top">doc_view_acm_deconstruct.cpp</a>.
</p> @@ -193,6 +290,13 @@ <div class="titlepage"><div><div><h3 class="title"><a name="signals2.examples.deconstruct"></a>Postconstructors and Predestructors with <code class="computeroutput">deconstruct()</code>
</h3></div></div></div> + +<div class="titlepage"><div><div><h3 class="title"> +<a name="signals2.examples.deconstruct"></a>用 +<code class="computeroutput">deconstruct()</code> +定义 postconstructor 和 predestructor +</h3></div></div></div> + <div class="toc"><dl><dt><span class="section"><a href="examples.html#signals2.examples.deconstruct.postconstructor_ex1">postconstructor_ex1</a></span></dt> <dt><span class="section"><a href="examples.html#signals2.examples.deconstruct.postconstructor_ex2">postconstructor_ex2</a></span></dt>
@@ -205,6 +309,13 @@This program is a basic example of how to define a class with a postconstructor which uses <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code> as its factory function.
</p> + +<p>+ 如何以 <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code>
+ 为工厂函数,来定义具有 postconstructor 的类? + 本程序就是一个基本例子。 + </p> + <p>Download <a href="../../../libs/signals2/example/postconstructor_ex1.cpp" target="_top">postconstructor_ex1</a>.
</p> @@ -217,6 +328,14 @@the <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code> call through to the class' constructor
and postconstructor. </p> + +<p> + 本程序稍稍扩展了 postconstructor_ex1 的例子, + 它可以将+ <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code>
+ 的调用参数传递给类的构造函数和 postconstructor。 + </p> + <p>Download <a href="../../../libs/signals2/example/postconstructor_ex2.cpp" target="_top">postconstructor_ex2</a>.
</p> @@ -228,6 +347,13 @@This program is a basic example of how to define a class with a predestructor which uses <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code> as its factory function.
</p> + +<p>+ 如何以 <code class="computeroutput"><a class="link" href="../boost/signals2/deconstruct.html" title="Function deconstruct">deconstruct()</a></code>
+ 为工厂函数,来定义具有 predestructor 的类? + 本程序就是一个基本例子, + </p> + <p>Download <a href="../../../libs/signals2/example/predestructor_example.cpp" target="_top">predestructor_example</a>.
</p> @@ -236,7 +362,12 @@ </div><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> <td align="left"><p><small>Last revised: June 12, 2007 at 14:01:23 -0400</small></p></td> -<td align="right"><div class="copyright-footer">Copyright 2001-2004 Douglas Gregor<br>Copyright 2007-2009 Frank Mori Hess<p>Distributed under the Boost +<td align="right"><div class="copyright-footer">Copyright (c) 2001-2004 Douglas Gregor<br>Copyright (c) 2007-2009 Frank Mori Hess
+ + <p>翻译:<a href="http://blog.csdn.net/jq0123";>金庆</a></p> + <p>译文更新:2009.6.13</p> + + <p>Distributed under the Boost Software License, Version 1.0. (See accompanying file<code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></td>