proxygen
ReadCallback::Buffer Class Reference

#include <AsyncSocketTest.h>

Public Member Functions

 Buffer ()
 
 Buffer (char *buf, size_t len)
 
void reset ()
 
void allocate (size_t len)
 
void free ()
 

Public Attributes

char * buffer
 
size_t length
 

Detailed Description

Definition at line 151 of file AsyncSocketTest.h.

Constructor & Destructor Documentation

ReadCallback::Buffer::Buffer ( )
inline

Definition at line 153 of file AsyncSocketTest.h.

153 : buffer(nullptr), length(0) {}
ReadCallback::Buffer::Buffer ( char *  buf,
size_t  len 
)
inline

Definition at line 154 of file AsyncSocketTest.h.

154 : buffer(buf), length(len) {}

Member Function Documentation

void ReadCallback::Buffer::allocate ( size_t  len)
inline

Definition at line 160 of file AsyncSocketTest.h.

References buffer().

160  {
161  assert(buffer == nullptr);
162  this->buffer = static_cast<char*>(malloc(len));
163  this->length = len;
164  }
void ReadCallback::Buffer::free ( )
inline

Definition at line 165 of file AsyncSocketTest.h.

References buffer(), and bm::free().

165  {
166  ::free(buffer);
167  reset();
168  }
void ReadCallback::Buffer::reset ( )
inline

Definition at line 156 of file AsyncSocketTest.h.

References buffer().

156  {
157  buffer = nullptr;
158  length = 0;
159  }

Member Data Documentation

char* ReadCallback::Buffer::buffer

Definition at line 170 of file AsyncSocketTest.h.

size_t ReadCallback::Buffer::length

Definition at line 171 of file AsyncSocketTest.h.


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