proxygen
GSOBuf Class Reference

Public Member Functions

 GSOBuf (size_t size1, size_t size2=0)
 
const std::unique_ptr< IOBuf > & get () const
 

Private Attributes

std::unique_ptr< IOBufioBuf_
 

Detailed Description

Definition at line 412 of file AsyncUDPSocketGSOTest.cpp.

Constructor & Destructor Documentation

GSOBuf::GSOBuf ( size_t  size1,
size_t  size2 = 0 
)
inlineexplicit

Definition at line 414 of file AsyncUDPSocketGSOTest.cpp.

References folly::IOBuf::copyBuffer(), folly::gen::move, and string.

414  {
415  std::string str(size1, 'A');
416  ioBuf_ = folly::IOBuf::copyBuffer(str.data(), str.size());
417 
418  if (size2) {
419  str = std::string(size2, 'B');
420  auto tmp = folly::IOBuf::copyBuffer(str.data(), str.size());
421  ioBuf_->prependChain(std::move(tmp));
422  }
423  }
std::unique_ptr< IOBuf > ioBuf_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
const char * string
Definition: Conv.cpp:212
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587

Member Function Documentation

const std::unique_ptr<IOBuf>& GSOBuf::get ( ) const
inline

Definition at line 425 of file AsyncUDPSocketGSOTest.cpp.

Referenced by GSOSendTest::GSOSendTest().

425  {
426  return ioBuf_;
427  }
std::unique_ptr< IOBuf > ioBuf_

Member Data Documentation

std::unique_ptr<IOBuf> GSOBuf::ioBuf_
private

Definition at line 430 of file AsyncUDPSocketGSOTest.cpp.


The documentation for this class was generated from the following file: