<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="NoName" source-language="en" datatype="plaintext" target-language="zh_Hans">
    <body>
      <trans-unit xml:space="preserve" approved="no" id="3dbb6632849057a2">
        <source>Writing Composed Operations</source>
        <target state="translated">编写组合操作</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">10</context>
        </context-group>
        <note from="developer">type: section title</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a27b7e1406f551ba">
        <source>Asynchronous operations are started by calling a free function or member function known as an asynchronous ['__async_initfn__]. This function accepts parameters specific to the operation as well as a __CompletionToken__. The token is either a completion handler, or a type defining how the caller is informed of the asynchronous operation result. Networking provides the special tokens __use_future__ and __yield_context__ for using futures and coroutines respectively. This system of customizing the return value and method of completion notification is known as the ['Universal Asynchronous Model] described in __N3747__, and a built in to __NetTS__. Here is an example of an initiating function which reads a line from the stream and echoes it back. This function is developed further in the next section:</source>
        <target state="translated">异步操作通过调用一个自由函数或成员函数来启动，该函数被称为异步[发起函数]。发起函数接收操作相关的参数以及一个 __CompletionToken__ 完成令牌。该令牌可以是一个完成处理器，也可以是一种用于定义调用方如何获知异步操作结果的方式。网络库提供 __use_future__ 和 __yield_context__ 这两种特殊令牌，分别用于支持 future 和协程。这种自定义返回值及完成通知方式的机制被称为 __N3747__ 中描述的通用异步模型，并已内置到 __NetTS__ 中。以下是一个发起函数的示例，该函数用于从流中读取一行数据并将其回显回去。下一节将进一步开发此函数：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">12</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="5921067c14c6e4fb">
        <source>This initiating function receives the dynamic buffer by lvalue-reference,</source>
        <target state="translated">该发起函数通过左值引用接收动态缓冲区，</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">28</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b78b47d3a7704964">
        <source>Authors using Beast can reuse the library's primitives to create their own initiating functions for performing a series of other, intermediate asynchronous operations before invoking a final completion handler. The set of intermediate actions produced by an initiating function is known as a [@http://blog.think-async.com/2009/08/composed-operations-coroutines-and-code.html ['composed operation]]. To ensure full interoperability and well-defined behavior, __Asio__ imposes requirements on the implementation of composed operations. These classes and functions make it easier to develop initiating functions and their composed operations:</source>
        <target state="translated">使用 Beast 的开发者可以复用库中的基本组件，来创建自己的发起函数。这些发起函数会在执行一系列中间异步操作之后，最终调用一个完成处理器。发起函数所产生的这一系列中间动作，被称为 [组合操作]。为确保良好的互操作性和行为的一致性，__Asio__ 对组合操作的实现方式提出了一些要求。以下提供的类和函数，可以帮助开发者更轻松地编写发起函数及其对应的组合操作：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">33</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="df5ec280ea19f57b">
        <source>Asynchronous Helpers</source>
        <target state="translated">异步辅助函数</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table title</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b4c4db868dbf643a">
        <source>Name</source>
        <target state="translated">名称</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f7f5c115cf553484">
        <source>Description</source>
        <target state="translated">描述</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="35954ab1726ff0b0">
        <source>[link beast.ref.boost__beast__async_base `async_base`] [link beast.ref.boost__beast__stable_async_base `stable_async_base`]</source>
        <target state="translated">[link beast.ref.boost__beast__async_base `async_base`] [link beast.ref.boost__beast__stable_async_base `stable_async_base`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ec38195ba41ae6dc">
        <source>This class is designed to be used as a base class when authoring composed asynchronous operations expressed as an intermediate completion handler. This eliminates the need for the extensive boilerplate to propagate the associated executor and the associated allocator.</source>
        <target state="translated">该类作为基类，专门用于编写以中间完成处理器形式表达的组合异步操作。使用它，可以避免编写大量用于传递关联执行器和关联分配器的样板代码。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="93cee1b2420cbf4f">
        <source>[link beast.ref.boost__beast__allocate_stable `allocate_stable`]</source>
        <target state="translated">[link beast.ref.boost__beast__allocate_stable `allocate_stable`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="c24c247bf9de9c3e">
        <source>For composed operation algorithms which need stable storage for temporary objects, this function may be used. Memory for the stable storage is allocated using the allocator associated with the final completion handler. The implementation automatically destroys the temporary object before the final completion handler is invoked, or when the intermediate completion handler is destroyed.</source>
        <target state="translated">对于需要为临时对象提供稳定存储的组合操作算法，可以使用此函数。该函数通过最终完成处理器所关联的分配器来分配稳定存储所需的内存。它会在最终完成处理器被调用之前，或者中间完成处理器被销毁时，自动销毁这些临时对象。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f18df84cb77d2c31">
        <source>[link beast.ref.boost__beast__bind_handler `bind_handler`]</source>
        <target state="translated">[link beast.ref.boost__beast__bind_handler `bind_handler`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ace8e2f4144f250b">
        <source>This function creates a new handler which, when invoked, calls the original handler with the list of bound arguments. Any parameters passed in the invocation will be substituted for placeholders present in the list of bound arguments. Parameters which are not matched to placeholders are silently discarded.

The passed handler and arguments are forwarded into the returned handler, whose associated allocator and associated executor will be the same as those of the original handler.</source>
        <target state="translated">该函数用于创建一个新的处理器。当这个新处理器被调用时，它会使用预先绑定的参数列表去调用原始的处理器。调用时传入的参数，会替换掉绑定列表中的占位符；而那些没有对应占位符的参数，则会被悄悄丢弃。

传入的处理器和参数，都会被转发给返回的新处理器。这个新处理器的关联分配器和关联执行器，与原始处理器完全相同。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="23e1fbbd0ca46f46">
        <source>[link beast.ref.boost__beast__bind_front_handler `bind_front_handler`]</source>
        <target state="translated">[link beast.ref.boost__beast__bind_front_handler `bind_front_handler`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="90728e21a0e1e8f8">
        <source>This function creates a new handler which, when invoked, calls the original handler with the list of bound arguments, along with the list of invoked arguments at either the front or the back of the argument list. Placeholders are not supported.

The passed handler and arguments are forwarded into the returned handler, whose associated allocator and associated executor will will be the same as those of the original handler.</source>
        <target state="translated">该函数用于创建新处理器。调用该新处理器时，系统会对原始处理器进行调用，并同时传入绑定参数列表以及调用参数列表。调用参数列表可位于参数列表的前端或后端。该函数不支持占位符。

传入的处理器与参数被转发至返回的新处理器。该新处理器的关联分配器及关联执行器均与原始处理器保持一致。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b007c5992a90ffd3">
        <source>[link beast.ref.boost__beast__saved_handler `saved_handler`]</source>
        <target state="translated">[link beast.ref.boost__beast__saved_handler `saved_handler`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f505d56da45f7c61">
        <source>This wrapper safely stores a completion handler so it may be invoked later, allowing an implementation to "pause" an operation until some condition is met.</source>
        <target state="translated">该包装类用于安全存储完成处理器，以便后续调用。通过该机制，实现方可以对操作进行“暂停”，直到满足特定条件后再继续执行。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">44</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
    </body>
  </file>
</xliff>
