#include "circular_buffer.h"
|
static CircularBuffer * | Create (const int capacity) |
| Instantiate buffer with malloc.
|
|
static CircularBuffer * | Init (bool parent, void *block, const int block_size, const int capacity) |
|
static int | Sizeof (const int capacity) |
|
CircularBuffer which can be instantiated using malloc or with a pre-allocated buffer.
void net_instaweb::CircularBuffer::Clear |
( |
| ) |
|
Reset offset of data segment and wrapped flag. The old content is not cleared but shouldn't be print out again.
static CircularBuffer* net_instaweb::CircularBuffer::Init |
( |
bool |
parent, |
|
|
void * |
block, |
|
|
const int |
block_size, |
|
|
const int |
capacity |
|
) |
| |
|
static |
Instantiate buffer with pre-allocated block. parent = true if this is invoked in root process (ie, this call should initialize the fields of the segment). block is a pointer to a pre-allocated segment. block_size is the size of the block, it must be equal to Sizeof(capacity). capacity is the size of the data buffer (the maximum amount of data which we can buffer at one time).
static int net_instaweb::CircularBuffer::Sizeof |
( |
const int |
capacity | ) |
|
|
inlinestatic |
Return the size in bytes of the memory block to allocate to hold a buffer with size equal to capacity. capacity is the size of data buffer.
buffer[1] is double counted, so -1 here.
The documentation for this class was generated from the following file: