ucx
UAP Common Extensions
Loading...
Searching...
No Matches
Data Fields
cx_buffer_s Struct Reference

Structure for the UCX buffer data. More...

#include <buffer.h>

Data Fields

union {
   char *   space
 Data is interpreted as text.
 
   unsigned char *   bytes
 Data is interpreted as binary.
 
}; 
 A pointer to the buffer contents.
 
CxAllocator const * allocator
 The allocator to use for automatic memory management.
 
size_t pos
 Current position of the buffer.
 
size_t capacity
 Current capacity (i.e.
 
size_t size
 Current size of the buffer content.
 
size_t flush_threshold
 The buffer may not extend beyond this threshold before starting to flush.
 
size_t flush_blksize
 The block size for the elements to flush.
 
size_t flush_blkmax
 The maximum number of blocks to flush in one cycle.
 
cx_write_func flush_func
 The write function used for flushing.
 
void * flush_target
 The target for flush_func.
 
int flags
 Flag register for buffer features.
 

Detailed Description

Structure for the UCX buffer data.

Field Documentation

◆ capacity

size_t cx_buffer_s::capacity

Current capacity (i.e.

maximum size) of the buffer.

◆ flags

int cx_buffer_s::flags

Flag register for buffer features.

See also
CX_BUFFER_DEFAULT
CX_BUFFER_FREE_CONTENTS
CX_BUFFER_AUTO_EXTEND

◆ flush_blkmax

size_t cx_buffer_s::flush_blkmax

The maximum number of blocks to flush in one cycle.

Zero disables flushing entirely (this is the default). Set this to SIZE_MAX to flush the entire buffer.

Attention
if the maximum number of blocks multiplied with the block size is smaller than the expected contents written to this buffer within one write operation, multiple flush cycles are performed after that write. That means the total number of blocks flushed after one write to this buffer may be larger than flush_blkmax.

◆ flush_blksize

size_t cx_buffer_s::flush_blksize

The block size for the elements to flush.

Default is 4096 bytes.

◆ flush_func

cx_write_func cx_buffer_s::flush_func

The write function used for flushing.

If NULL, the flushed content gets discarded.

◆ flush_threshold

size_t cx_buffer_s::flush_threshold

The buffer may not extend beyond this threshold before starting to flush.

Default is SIZE_MAX (flushing disabled when auto extension is enabled).


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