proxygen
WriteChainAsyncTransportWrapper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <folly/io/IOBuf.h>
21 
22 namespace folly {
23 
27 template <class T>
29  : public DecoratedAsyncTransportWrapper<T> {
30  public:
32 
33  void write(
35  const void* buf,
36  size_t bytes,
38  auto ioBuf = folly::IOBuf::wrapBuffer(buf, bytes);
39  writeChain(callback, std::move(ioBuf), flags);
40  }
41 
42  void writev(
44  const iovec* vec,
45  size_t count,
47  auto writeBuffer = folly::IOBuf::wrapIov(vec, count);
48  writeChain(callback, std::move(writeBuffer), flags);
49  }
50 
55  void writeChain(
57  std::unique_ptr<folly::IOBuf>&& buf,
59 };
60 
61 } // namespace folly
flags
Definition: http_parser.h:127
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
Definition: IOBuf.cpp:353
void writeChain(folly::AsyncTransportWrapper::WriteCallback *callback, std::unique_ptr< folly::IOBuf > &&buf, folly::WriteFlags flags=folly::WriteFlags::NONE) override=0
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void writev(folly::AsyncTransportWrapper::WriteCallback *callback, const iovec *vec, size_t count, folly::WriteFlags flags=folly::WriteFlags::NONE) override
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
void write(folly::AsyncTransportWrapper::WriteCallback *callback, const void *buf, size_t bytes, folly::WriteFlags flags=folly::WriteFlags::NONE) override
Definition: Traits.h:588
int * count
static std::unique_ptr< IOBuf > wrapIov(const iovec *vec, size_t count)
Definition: IOBuf.cpp:1027