upscaledb  2.1.13
Data Fields
ups_record_t Struct Reference

#include <upscaledb.h>

Data Fields

uint32_t size
 
void * data
 
uint32_t flags
 
uint32_t partial_offset
 
uint32_t partial_size
 

Detailed Description

A generic record.

A record represents data items in upscaledb. Before using a record, it is important to initialize all record fields with zeroes, i.e. with the C library routines memset(3) or bzero(2).

When upscaledb returns a record structure, the pointer to the record data is provided in data. This pointer is only temporary and will be overwritten by subsequent upscaledb API calls using the same Transaction (or, if Transactions are disabled, using the same Database). The pointer will also be invalidated after the Transaction is aborted or committed.

To avoid this, the calling application can allocate the data pointer. In this case, you have to set the flag UPS_RECORD_USER_ALLOC. The size parameter will then return the size of the record. It's the responsibility of the caller to make sure that the data parameter is large enough for the record.

The record->data pointer is not threadsafe. For threadsafe access it is recommended to use UPS_RECORD_USER_ALLOC or have each thread manage its own Transaction.

Definition at line 200 of file upscaledb.h.

Field Documentation

void* ups_record_t::data

Pointer to the record data

Definition at line 205 of file upscaledb.h.

Referenced by upscaledb::record::get_data(), main(), upscaledb::record::record(), and upscaledb::record::set_data().

uint32_t ups_record_t::flags
uint32_t ups_record_t::partial_offset

Offset for partial reading/writing; see UPS_PARTIAL

Definition at line 211 of file upscaledb.h.

uint32_t ups_record_t::partial_size

Size for partial reading/writing; see UPS_PARTIAL

Definition at line 214 of file upscaledb.h.

uint32_t ups_record_t::size

The size of the record data, in bytes

Definition at line 202 of file upscaledb.h.

Referenced by upscaledb::record::get_size(), main(), upscaledb::record::record(), and upscaledb::record::set_size().


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