<?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="9b8ca9ba43952201">
        <source>Decorator</source>
        <target state="translated">修饰器</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">12</context>
        </context-group>
        <note from="developer">type: section title</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="96bd7c4d17bac1d3">
        <source>For programs which need to modify either the outgoing WebSocket HTTP Upgrade request, the outgoing WebSocket HTTP Upgrade response, or both, the stream supports an optional property called a ['decorator]. This is a function pointer or callable object which is invoked before the implementation sends an HTTP message. The decorator receives a modifiable reference to the message, allowing for modifications. The interface to this system uses:</source>
        <target state="translated">对于需要修改出站 WebSocket HTTP 升级请求或响应（或两者都需要）的程序，流支持一个可选属性，称为“修饰器”。修饰器是一个函数指针或可调用对象，在实现发送 HTTP 消息前会被调用。修饰器接收一个可修改的消息引用，允许对其进行修改。该系统的接口使用以下类型：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">14</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="99aecbcaf5cefdb4">
        <source>WebSocket Decorator Interface</source>
        <target state="translated">WebSocket 修饰器接口</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</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">22</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">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="690d1f5abc09d997">
        <source>[link beast.ref.boost__beast__websocket__request_type `request_type`]</source>
        <target state="translated">[link beast.ref.boost__beast__websocket__request_type `request_type`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="8fefce39c4c20616">
        <source>This is the type of the object passed to the decorator to represent HTTP Upgrade requests.</source>
        <target state="translated">该类型表示传递给修饰器的对象，用于表示 HTTP 升级请求。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="9474a864962031c0">
        <source>[link beast.ref.boost__beast__websocket__response_type `response_type`]</source>
        <target state="translated">[link beast.ref.boost__beast__websocket__response_type `response_type`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="670dfcf6f28f634f">
        <source>This is the type of the object passed to the decorator to represent HTTP Upgrade response.</source>
        <target state="translated">该类型表示传递给修饰器的对象，用于表示 HTTP 升级响应。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="17b3636770b96c08">
        <source>[link beast.ref.boost__beast__websocket__stream_base__decorator `stream_base::decorator`]</source>
        <target state="translated">[link beast.ref.boost__beast__websocket__stream_base__decorator `stream_base::decorator`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="5fe82596ae18a8bc">
        <source>Objects of this type are used to hold a decorator to be set on the stream using `set_option`.</source>
        <target state="translated">该类型的对象用于保存修饰器，并通过 `set_option` 将其设置在流上。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="bca4b9b9110d74b3">
        <source>[link beast.ref.boost__beast__websocket__stream.set_option `stream::set_option`]</source>
        <target state="translated">[link beast.ref.boost__beast__websocket__stream.set_option `stream::set_option`]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b3dacf83d3059e78">
        <source>This function is used to set a `stream_base::decorator` on the stream.</source>
        <target state="translated">该函数用于在流上设置 `stream_base::decorator`。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">22</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a7c90a5e74ce2c59">
        <source>This declares a normal function which decorates outgoing HTTP requests:</source>
        <target state="translated">以下声明一个普通函数，该函数用于装饰出站 HTTP 请求。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">49</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a3ae1ce65a7836e7">
        <source>When using a decorator, it must be set on the stream before any handshaking takes place. This sets the decorator on the stream, to be used for all subsequent calls to accept or handshake:</source>
        <target state="translated">使用修饰器时，必须在进行任何握手之前将其设置在流上。以下代码将修饰器设置在流上，供后续所有 `accept` 或 `handshake` 调用使用：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">53</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="8faa58a4b0ad957a">
        <source>Alternatively, a function object may be used. Small function objects will not incur a memory allocation. The follow code declares and sets a function object as a decorator:</source>
        <target state="translated">也可以使用函数对象。小型函数对象不会产生内存分配。以下代码声明并设置一个函数对象作为修饰器：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">59</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="ef6c94751338b86d">
        <source>A lambda may be used in place of a named function object:</source>
        <target state="translated">也可以使用 lambda 表达式代替具名函数对象：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">65</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="67ec1e32b3ecbdd2">
        <source>It also possible for a single decorator to handle both requests and responses, if it is overloaded for both types either as a generic lambda (C++14 and later) or as a class as shown here:</source>
        <target state="translated">单个修饰器也可以同时处理请求和响应，只需为这两种类型提供重载，可以通过泛型 lambda（C++14 及更高版本）或类来实现，如下所示：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">69</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="4efebc5c22a9eb91">
        <source>The implementation takes ownership by decay-copy of the invocable object used as the decorator. Move-only types are possible:</source>
        <target state="translated">实现会通过退化拷贝的方式获取用作修饰器的可调用对象的所有权。只可移动的类型也同样适用：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">75</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="6667327d31d24029">
        <source>Undefined behavior results if the decorator modifies the fields</source>
        <target state="translated">如果修饰器修改以下字段，将导致未定义行为：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">81</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
    </body>
  </file>
</xliff>
