All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
as_msgpack.h File Reference
#include <aerospike/as_serializer.h>
#include <aerospike/as_std.h>
+ Include dependency graph for as_msgpack.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_msgpack_ext
 
struct  as_packer
 
struct  as_packer_buffer
 
struct  as_unpacker
 

Macros

#define AS_PACKED_LIST_FLAG_NONE   0x00
 
#define AS_PACKED_LIST_FLAG_ORDERED   0x01
 
#define AS_PACKED_MAP_FLAG_K_ORDERED   0x01
 
#define AS_PACKED_MAP_FLAG_KV_ORDERED   (AS_PACKED_MAP_FLAG_K_ORDERED | AS_PACKED_MAP_FLAG_V_ORDERED)
 
#define AS_PACKED_MAP_FLAG_NONE   0x00
 
#define AS_PACKED_MAP_FLAG_PRESERVE_ORDER   0x08
 
#define AS_PACKED_MAP_FLAG_V_ORDERED   0x02
 
#define AS_PACKED_PERSIST_INDEX   0x10
 
#define AS_PACKER_BUFFER_SIZE   8192
 

Enumerations

enum  msgpack_compare_t {
  MSGPACK_COMPARE_ERROR = -2, MSGPACK_COMPARE_END = -1, MSGPACK_COMPARE_LESS = 0, MSGPACK_COMPARE_EQUAL = 1,
  MSGPACK_COMPARE_GREATER = 2
}
 

Functions

AS_EXTERN as_serializeras_msgpack_init (as_serializer *)
 
AS_EXTERN as_serializeras_msgpack_new (void)
 
int as_pack_append (as_packer *pk, const unsigned char *buf, uint32_t sz)
 
int as_pack_bin (as_packer *pk, const uint8_t *buf, uint32_t sz)
 
uint32_t as_pack_bin_size (uint32_t buf_sz)
 
int as_pack_bool (as_packer *pk, bool val)
 
static uint32_t as_pack_bool_size ()
 
int as_pack_buf_ext_header (uint8_t *buf, uint32_t size, uint32_t content_size, uint8_t type)
 
int as_pack_bytes (as_packer *pk, const uint8_t *buf, uint32_t sz)
 
int as_pack_cmp_inf (as_packer *pk)
 
static uint32_t as_pack_cmp_inf_size ()
 
int as_pack_cmp_wildcard (as_packer *pk)
 
static uint32_t as_pack_cmp_wildcard_size ()
 
int as_pack_double (as_packer *pk, double val)
 
static uint32_t as_pack_double_size ()
 
int as_pack_ext_header (as_packer *pk, uint32_t content_size, uint8_t type)
 
uint32_t as_pack_ext_header_get_size (uint32_t content_size)
 
int as_pack_float (as_packer *pk, float val)
 
static uint32_t as_pack_float_size ()
 
int as_pack_int64 (as_packer *pk, int64_t val)
 
uint32_t as_pack_int64_size (int64_t val)
 
int as_pack_list_header (as_packer *pk, uint32_t ele_count)
 
uint32_t as_pack_list_header_get_size (uint32_t ele_count)
 
int as_pack_map_header (as_packer *pk, uint32_t ele_count)
 
static uint32_t as_pack_map_header_get_size (uint32_t ele_count)
 
int as_pack_nil (as_packer *pk)
 
static uint32_t as_pack_nil_size ()
 
int as_pack_str (as_packer *pk, const uint8_t *buf, uint32_t sz)
 
uint32_t as_pack_str_size (uint32_t str_sz)
 
int as_pack_uint64 (as_packer *pk, uint64_t val)
 
uint32_t as_pack_uint64_size (uint64_t val)
 
int as_pack_val (as_packer *pk, const as_val *val)
 
const uint8_t * as_unpack_bin (as_unpacker *pk, uint32_t *sz_r)
 
int64_t as_unpack_blob_size (as_unpacker *pk)
 
int as_unpack_boolean (as_unpacker *pk, bool *value)
 
msgpack_compare_t as_unpack_buf_compare (const uint8_t *buf1, uint32_t size1, const uint8_t *buf2, uint32_t size2)
 
static bool as_unpack_buf_is_less (const uint8_t *buf1, uint32_t size1, const uint8_t *buf2, uint32_t size2)
 
int64_t as_unpack_buf_list_element_count (const uint8_t *buf, uint32_t size)
 
int64_t as_unpack_buf_map_element_count (const uint8_t *buf, uint32_t size)
 
as_val_t as_unpack_buf_peek_type (const uint8_t *buf, uint32_t size)
 
msgpack_compare_t as_unpack_compare (as_unpacker *pk1, as_unpacker *pk2)
 
int as_unpack_double (as_unpacker *pk, double *x)
 
int as_unpack_ext (as_unpacker *pk, as_msgpack_ext *ext)
 
int as_unpack_int64 (as_unpacker *pk, int64_t *i)
 
int64_t as_unpack_list_header_element_count (as_unpacker *pk)
 
int64_t as_unpack_map_header_element_count (as_unpacker *pk)
 
int as_unpack_nil (as_unpacker *pk)
 
bool as_unpack_peek_is_ext (const as_unpacker *pk)
 
as_val_t as_unpack_peek_type (const as_unpacker *pk)
 
int64_t as_unpack_size (as_unpacker *pk)
 
const uint8_t * as_unpack_str (as_unpacker *pk, uint32_t *sz_r)
 
int as_unpack_uint64 (as_unpacker *pk, uint64_t *i)
 
int as_unpack_val (as_unpacker *pk, as_val **val)
 
AS_EXTERN msgpack_compare_t as_val_cmp (const as_val *v1, const as_val *v2)
 

Macro Definition Documentation

#define AS_PACKED_LIST_FLAG_NONE   0x00

Definition at line 34 of file as_msgpack.h.

#define AS_PACKED_LIST_FLAG_ORDERED   0x01

Definition at line 35 of file as_msgpack.h.

#define AS_PACKED_MAP_FLAG_K_ORDERED   0x01

Definition at line 29 of file as_msgpack.h.

#define AS_PACKED_MAP_FLAG_KV_ORDERED   (AS_PACKED_MAP_FLAG_K_ORDERED | AS_PACKED_MAP_FLAG_V_ORDERED)

Definition at line 32 of file as_msgpack.h.

#define AS_PACKED_MAP_FLAG_NONE   0x00

Definition at line 28 of file as_msgpack.h.

#define AS_PACKED_MAP_FLAG_PRESERVE_ORDER   0x08

Definition at line 31 of file as_msgpack.h.

#define AS_PACKED_MAP_FLAG_V_ORDERED   0x02

Definition at line 30 of file as_msgpack.h.

#define AS_PACKED_PERSIST_INDEX   0x10

Definition at line 37 of file as_msgpack.h.

#define AS_PACKER_BUFFER_SIZE   8192

Definition at line 26 of file as_msgpack.h.

Enumeration Type Documentation

Enumerator
MSGPACK_COMPARE_ERROR 
MSGPACK_COMPARE_END 
MSGPACK_COMPARE_LESS 
MSGPACK_COMPARE_EQUAL 
MSGPACK_COMPARE_GREATER 

Definition at line 66 of file as_msgpack.h.

Function Documentation

AS_EXTERN as_serializer* as_msgpack_init ( as_serializer )
AS_EXTERN as_serializer* as_msgpack_new ( void  )
int as_pack_append ( as_packer pk,
const unsigned char *  buf,
uint32_t  sz 
)
int as_pack_bin ( as_packer pk,
const uint8_t *  buf,
uint32_t  sz 
)
uint32_t as_pack_bin_size ( uint32_t  buf_sz)
int as_pack_bool ( as_packer pk,
bool  val 
)
static uint32_t as_pack_bool_size ( )
inlinestatic

Definition at line 100 of file as_msgpack.h.

int as_pack_buf_ext_header ( uint8_t *  buf,
uint32_t  size,
uint32_t  content_size,
uint8_t  type 
)
int as_pack_bytes ( as_packer pk,
const uint8_t *  buf,
uint32_t  sz 
)
int as_pack_cmp_inf ( as_packer pk)
static uint32_t as_pack_cmp_inf_size ( )
inlinestatic

Definition at line 107 of file as_msgpack.h.

int as_pack_cmp_wildcard ( as_packer pk)
static uint32_t as_pack_cmp_wildcard_size ( )
inlinestatic

Definition at line 111 of file as_msgpack.h.

int as_pack_double ( as_packer pk,
double  val 
)
static uint32_t as_pack_double_size ( )
inlinestatic

Definition at line 127 of file as_msgpack.h.

int as_pack_ext_header ( as_packer pk,
uint32_t  content_size,
uint8_t  type 
)

Pack an ext type.

Returns
0 on success
uint32_t as_pack_ext_header_get_size ( uint32_t  content_size)

Get size of an ext header.

Parameters
content_sizesize in bytes of ext contents
Returns
size of header in bytes
int as_pack_float ( as_packer pk,
float  val 
)

Pack a float.

Returns
0 on success
static uint32_t as_pack_float_size ( )
inlinestatic

Definition at line 123 of file as_msgpack.h.

int as_pack_int64 ( as_packer pk,
int64_t  val 
)
uint32_t as_pack_int64_size ( int64_t  val)
int as_pack_list_header ( as_packer pk,
uint32_t  ele_count 
)

Pack a list header with ele_count.

Returns
0 on success
uint32_t as_pack_list_header_get_size ( uint32_t  ele_count)

Get packed header size for list with ele_count.

Returns
header size in bytes
int as_pack_map_header ( as_packer pk,
uint32_t  ele_count 
)

Pack a map header with ele_count.

Returns
0 on success
static uint32_t as_pack_map_header_get_size ( uint32_t  ele_count)
inlinestatic

Get packed header size for map with ele_count.

Returns
header size in bytes

Definition at line 167 of file as_msgpack.h.

References as_pack_list_header_get_size().

int as_pack_nil ( as_packer pk)
static uint32_t as_pack_nil_size ( )
inlinestatic

Definition at line 96 of file as_msgpack.h.

int as_pack_str ( as_packer pk,
const uint8_t *  buf,
uint32_t  sz 
)

Pack a str.

Returns
0 on success
uint32_t as_pack_str_size ( uint32_t  str_sz)
int as_pack_uint64 ( as_packer pk,
uint64_t  val 
)
uint32_t as_pack_uint64_size ( uint64_t  val)
int as_pack_val ( as_packer pk,
const as_val val 
)
Returns
0 on success
const uint8_t* as_unpack_bin ( as_unpacker pk,
uint32_t *  sz_r 
)

Unpack bin (or str).

Returns
NULL on failure
int64_t as_unpack_blob_size ( as_unpacker pk)

Get size of packed blob.

Returns
negative int on error, size on success
int as_unpack_boolean ( as_unpacker pk,
bool *  value 
)

Unpack boolean.

Returns
0 on success
msgpack_compare_t as_unpack_buf_compare ( const uint8_t *  buf1,
uint32_t  size1,
const uint8_t *  buf2,
uint32_t  size2 
)

Compare two msgpack buffers.

static bool as_unpack_buf_is_less ( const uint8_t *  buf1,
uint32_t  size1,
const uint8_t *  buf2,
uint32_t  size2 
)
inlinestatic

Compare two msgpack buffers.

Returns
true if buf1 < buf2

Definition at line 275 of file as_msgpack.h.

References as_unpack_buf_compare(), and MSGPACK_COMPARE_LESS.

int64_t as_unpack_buf_list_element_count ( const uint8_t *  buf,
uint32_t  size 
)

Unpack list element count from buffer.

int64_t as_unpack_buf_map_element_count ( const uint8_t *  buf,
uint32_t  size 
)

Unpack map element count from buffer.

as_val_t as_unpack_buf_peek_type ( const uint8_t *  buf,
uint32_t  size 
)
msgpack_compare_t as_unpack_compare ( as_unpacker pk1,
as_unpacker pk2 
)
int as_unpack_double ( as_unpacker pk,
double *  x 
)

Unpack double.

Returns
0 on success
int as_unpack_ext ( as_unpacker pk,
as_msgpack_ext ext 
)

Unpack extension type.

Returns
true on success
int as_unpack_int64 ( as_unpacker pk,
int64_t *  i 
)

Unpack integer.

Returns
0 on success
int64_t as_unpack_list_header_element_count ( as_unpacker pk)

Get element count of packed list.

Returns
negative int on failure, element count on success
int64_t as_unpack_map_header_element_count ( as_unpacker pk)

Get element count of packed map.

Returns
negative int on failure, element count on success
int as_unpack_nil ( as_unpacker pk)

Unpack nil.

Returns
0 on success
bool as_unpack_peek_is_ext ( const as_unpacker pk)

Check next element without consuming any bytes.

Returns
true if ext type
as_val_t as_unpack_peek_type ( const as_unpacker pk)

Check next element without consuming any bytes.

Returns
type of next element
int64_t as_unpack_size ( as_unpacker pk)

Get size of packed value.

Returns
negative int on error, size on success
const uint8_t* as_unpack_str ( as_unpacker pk,
uint32_t *  sz_r 
)

Unpack str (or bin).

Returns
NULL on failure
int as_unpack_uint64 ( as_unpacker pk,
uint64_t *  i 
)
int as_unpack_val ( as_unpacker pk,
as_val **  val 
)
Returns
0 on success
AS_EXTERN msgpack_compare_t as_val_cmp ( const as_val v1,
const as_val v2 
)