All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Fields | Private Attributes | Related Functions
as_rec Struct Reference

Detailed Description

as_rec is an interface for record types. A record is how data in Aerospike is represented, and is composed of bins and metadata.

Implementations:

Definition at line 71 of file as_rec.h.

#include "as_rec.h"

+ Inheritance diagram for as_rec:
+ Collaboration diagram for as_rec:

Data Fields

void * data
 
const struct as_rec_hooks_s * hooks
 
- Data Fields inherited from as_val
cf_atomic32 count
 
bool free
 
enum as_val_t type
 

Private Attributes

as_val _
 

Related Functions

(Note that these are not member functions.)

static int as_rec_bin_names (const as_rec *rec, as_rec_bin_names_callback callback, void *udata)
 
as_recas_rec_cons (as_rec *rec, bool free, void *data, const as_rec_hooks *hooks)
 
static void as_rec_destroy (as_rec *rec)
 
static as_bytesas_rec_digest (const as_rec *rec)
 
static int as_rec_drop_key (const as_rec *rec)
 
static bool as_rec_foreach (const as_rec *rec, as_rec_foreach_callback callback, void *udata)
 
static as_recas_rec_fromval (const as_val *v)
 
static uint16_t as_rec_gen (const as_rec *rec)
 
static as_valas_rec_get (const as_rec *rec, const char *name)
 
static as_bytesas_rec_get_bytes (const as_rec *rec, const char *name)
 
static int64_t as_rec_get_int64 (const as_rec *rec, const char *name)
 
static as_integeras_rec_get_integer (const as_rec *rec, const char *name)
 
static as_listas_rec_get_list (const as_rec *rec, const char *name)
 
static as_mapas_rec_get_map (const as_rec *rec, const char *name)
 
static char * as_rec_get_str (const as_rec *rec, const char *name)
 
static as_stringas_rec_get_string (const as_rec *rec, const char *name)
 
as_recas_rec_init (as_rec *rec, void *data, const as_rec_hooks *hooks)
 
as_recas_rec_new (void *data, const as_rec_hooks *hooks)
 
static uint16_t as_rec_numbins (const as_rec *rec)
 
static int as_rec_remove (const as_rec *rec, const char *name)
 
static int as_rec_set (const as_rec *rec, const char *name, const as_val *value)
 
static int as_rec_set_bytes (const as_rec *rec, const char *name, const as_bytes *value)
 
static int as_rec_set_flags (const as_rec *rec, const char *name, uint8_t flags)
 
static int as_rec_set_int64 (const as_rec *rec, const char *name, int64_t value)
 
static int as_rec_set_integer (const as_rec *rec, const char *name, const as_integer *value)
 
static int as_rec_set_list (const as_rec *rec, const char *name, const as_list *value)
 
static int as_rec_set_map (const as_rec *rec, const char *name, const as_map *value)
 
static int as_rec_set_str (const as_rec *rec, const char *name, const char *value)
 
static int as_rec_set_string (const as_rec *rec, const char *name, const as_string *value)
 
static int as_rec_set_ttl (const as_rec *rec, uint32_t ttl)
 
static int as_rec_set_type (const as_rec *rec, int8_t rec_type)
 
static void * as_rec_source (const as_rec *rec)
 
static as_valas_rec_toval (const as_rec *rec)
 
static uint32_t as_rec_ttl (const as_rec *rec)
 

Friends And Related Function Documentation

static int as_rec_bin_names ( const as_rec rec,
as_rec_bin_names_callback  callback,
void *  udata 
)
related

Get a list of the bin names in the record.

Definition at line 295 of file as_rec.h.

as_rec * as_rec_cons ( as_rec rec,
bool  free,
void *  data,
const as_rec_hooks hooks 
)
related

Utilized by subtypes of as_rec to initialize the parent.

Parameters
recThe record to initialize
freeIf TRUE, then as_rec_destory() will free the record.
dataData for the map.
hooksImplementation for the map interface.
Returns
The initialized as_map on success. Otherwise NULL.
static void as_rec_destroy ( as_rec rec)
related

Destroy the record.

Definition at line 226 of file as_rec.h.

static as_bytes * as_rec_digest ( const as_rec rec)
related

Get the digest of the record.

Definition at line 305 of file as_rec.h.

static int as_rec_drop_key ( const as_rec rec)
related

Drop the record's key.

Definition at line 345 of file as_rec.h.

static bool as_rec_foreach ( const as_rec rec,
as_rec_foreach_callback  callback,
void *  udata 
)
related

Call the callback function for each bin in the record.

Parameters
recThe as_rec containing the bins to iterate over.
callbackThe function to call for each entry.
udataUser-data to be passed to the callback.
Returns
true if iteration completes fully. false if iteration was aborted.

Definition at line 630 of file as_rec.h.

static as_rec * as_rec_fromval ( const as_val v)
related

Convert from an as_val.

Definition at line 654 of file as_rec.h.

static uint16_t as_rec_gen ( const as_rec rec)
related

Get the generation of the record

Definition at line 275 of file as_rec.h.

static as_val * as_rec_get ( const as_rec rec,
const char *  name 
)
related

Get a bin's value.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 364 of file as_rec.h.

static as_bytes * as_rec_get_bytes ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as an as_bytes.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 445 of file as_rec.h.

static int64_t as_rec_get_int64 ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as an int64_t.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise 0.

Definition at line 379 of file as_rec.h.

static as_integer * as_rec_get_integer ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as an as_integer.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 413 of file as_rec.h.

static as_list * as_rec_get_list ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as an as_list.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 461 of file as_rec.h.

static as_map * as_rec_get_map ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as an as_map.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 477 of file as_rec.h.

static char * as_rec_get_str ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as a NULL terminated string.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 396 of file as_rec.h.

static as_string * as_rec_get_string ( const as_rec rec,
const char *  name 
)
related

Get a bin's value as an as_string.

Parameters
recThe as_rec to read the bin value from.
nameThe name of the bin.
Returns
On success, the value of the bin. Otherwise NULL.

Definition at line 429 of file as_rec.h.

as_rec * as_rec_init ( as_rec rec,
void *  data,
const as_rec_hooks hooks 
)
related

Initialize a stack allocated record.

Parameters
recStack allocated record to initialize.
dataData for the record.
hooksImplementation for the record interface.
Returns
On success, the initialized record. Otherwise NULL.
as_rec * as_rec_new ( void *  data,
const as_rec_hooks hooks 
)
related

Create and initialize a new heap allocated record.

Parameters
dataData for the record.
hooksImplementation for the record interface.
Returns
On success, a new record. Otherwise NULL.
static uint16_t as_rec_numbins ( const as_rec rec)
related

Get the number of bins in the record.

Definition at line 285 of file as_rec.h.

static int as_rec_remove ( const as_rec rec,
const char *  name 
)
related

Remove a bin from a record.

Parameters
recThe record to remove the bin from.
nameThe name of the bin to remove.
Returns
0 on success, otherwise an error occurred.

Definition at line 255 of file as_rec.h.

static int as_rec_set ( const as_rec rec,
const char *  name,
const as_val value 
)
related

Set the bin's value to an as_val.

Parameters
recThe as_rec to write the bin value to - CONSUMES REFERENCE
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 498 of file as_rec.h.

static int as_rec_set_bytes ( const as_rec rec,
const char *  name,
const as_bytes value 
)
related

Set the bin's value to an as_bytes.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 578 of file as_rec.h.

static int as_rec_set_flags ( const as_rec rec,
const char *  name,
uint8_t  flags 
)
related

Set flags on a bin.

Definition at line 315 of file as_rec.h.

static int as_rec_set_int64 ( const as_rec rec,
const char *  name,
int64_t  value 
)
related

Set the bin's value to an int64_t.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 514 of file as_rec.h.

static int as_rec_set_integer ( const as_rec rec,
const char *  name,
const as_integer value 
)
related

Set the bin's value to an as_integer.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 546 of file as_rec.h.

static int as_rec_set_list ( const as_rec rec,
const char *  name,
const as_list value 
)
related

Set the bin's value to an as_list.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 594 of file as_rec.h.

static int as_rec_set_map ( const as_rec rec,
const char *  name,
const as_map value 
)
related

Set the bin's value to an as_map.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 610 of file as_rec.h.

static int as_rec_set_str ( const as_rec rec,
const char *  name,
const char *  value 
)
related

Set the bin's value to a NULL terminated string.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 530 of file as_rec.h.

static int as_rec_set_string ( const as_rec rec,
const char *  name,
const as_string value 
)
related

Set the bin's value to an as_string.

Parameters
recThe as_rec storing the bin.
nameThe name of the bin.
valueThe value of the bin.
Returns
On success, 0. Otherwise an error occurred.

Definition at line 562 of file as_rec.h.

static int as_rec_set_ttl ( const as_rec rec,
uint32_t  ttl 
)
related

Set the time to live (ttl).

Definition at line 335 of file as_rec.h.

static int as_rec_set_type ( const as_rec rec,
int8_t  rec_type 
)
related

Set the record type.

Definition at line 325 of file as_rec.h.

static void * as_rec_source ( const as_rec rec)
related

Get the data source for the record.

Definition at line 240 of file as_rec.h.

static as_val * as_rec_toval ( const as_rec rec)
related

Convert to an as_val.

Definition at line 644 of file as_rec.h.

static uint32_t as_rec_ttl ( const as_rec rec)
related

Get the ttl for the record.

Definition at line 265 of file as_rec.h.

Field Documentation

as_val as_rec::_
private

as_rec is a subtype of as_val. You can cast as_rec to as_val.

Definition at line 78 of file as_rec.h.

void* as_rec::data

Data provided by the implementation of as_rec.

Definition at line 83 of file as_rec.h.

const struct as_rec_hooks_s* as_rec::hooks

Hooks provided by the implementation of as_rec.

Definition at line 88 of file as_rec.h.


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