Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
as_val.h File Reference
#include <aerospike/as_std.h>
+ Include dependency graph for as_val.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_val
 

Macros

#define as_val_destroy(__v)   ( as_val_val_destroy((as_val *)__v) )
 
#define as_val_hashcode(__v)   ( as_val_val_hashcode((as_val *)__v) )
 
#define as_val_reserve(__v)   ( as_val_val_reserve((as_val *)__v) )
 
#define as_val_tostring(__v)   ( as_val_val_tostring((as_val *)__v) )
 
#define as_val_type(__v)   (__v ? (as_val_type_e)((as_val *)__v)->type : AS_UNDEF)
 

Typedefs

typedef uint8_t as_val_t
 

Enumerations

enum  as_val_type_e {
  AS_UNDEF = 0 , AS_UNKNOWN = 0 , AS_NIL = 1 , AS_BOOLEAN = 2 ,
  AS_INTEGER = 3 , AS_STRING = 4 , AS_LIST = 5 , AS_MAP = 6 ,
  AS_REC = 7 , AS_PAIR = 8 , AS_BYTES = 9 , AS_DOUBLE = 10 ,
  AS_GEOJSON = 11 , AS_CMP_EXT , AS_CMP_WILDCARD , AS_CMP_INF ,
  AS_VAL_T_MAX
}
 

Functions

static as_valas_val_cons (as_val *val, as_val_t type, bool free)
 
static void as_val_init (as_val *v, as_val_t type, bool free)
 
AS_EXTERN bool as_val_tobool (const as_val *v)
 
AS_EXTERN as_valas_val_val_destroy (as_val *)
 
AS_EXTERN uint32_t as_val_val_hashcode (const as_val *)
 
AS_EXTERN as_valas_val_val_reserve (as_val *)
 
AS_EXTERN char * as_val_val_tostring (const as_val *)
 

Macro Definition Documentation

◆ as_val_destroy

#define as_val_destroy ( __v)    ( as_val_val_destroy((as_val *)__v) )

Decrement the as_val.count of a value. If as_val.count reaches 0 (zero) and as_val.free is true, then free the as_val instance.

Parameters
__vThe as_val to be decremented.
Returns
The value, if its as_val.count > 0. Otherwise NULL.

Definition at line 114 of file as_val.h.

◆ as_val_hashcode

#define as_val_hashcode ( __v)    ( as_val_val_hashcode((as_val *)__v) )

Get the hashcode value for the value.

Parameters
__vThe as_val to get the hashcode value for.
Returns
The hashcode value.

Definition at line 123 of file as_val.h.

◆ as_val_reserve

#define as_val_reserve ( __v)    ( as_val_val_reserve((as_val *)__v) )

Increment the as_val.count of a value.

Parameters
__vThe as_val to be incremented.
Returns
The value, with it's refcount incremented.

Definition at line 104 of file as_val.h.

◆ as_val_tostring

#define as_val_tostring ( __v)    ( as_val_val_tostring((as_val *)__v) )

Get the string representation of the value.

Parameters
__vThe as_val to get the string value for.
Returns
The string representation on success. Otherwise NULL.

Definition at line 132 of file as_val.h.

◆ as_val_type

#define as_val_type ( __v)    (__v ? (as_val_type_e)((as_val *)__v)->type : AS_UNDEF)

Returns the as_val.type of a value.

Parameters
__vThe as_val to get the type of
Returns
An as_val_t value. If the type is unknown, then it will be AS_UNDEF.

Definition at line 95 of file as_val.h.

Typedef Documentation

◆ as_val_t

typedef uint8_t as_val_t

as_val types

Definition at line 32 of file as_val.h.

Enumeration Type Documentation

◆ as_val_type_e

Enumerator
AS_UNDEF 
AS_UNKNOWN 
AS_NIL 
AS_BOOLEAN 
AS_INTEGER 
AS_STRING 
AS_LIST 
AS_MAP 
AS_REC 
AS_PAIR 
AS_BYTES 
AS_DOUBLE 
AS_GEOJSON 
AS_CMP_EXT 
AS_CMP_WILDCARD 
AS_CMP_INF 
AS_VAL_T_MAX 

Definition at line 34 of file as_val.h.

Function Documentation

◆ as_val_cons()

static as_val * as_val_cons ( as_val * val,
as_val_t type,
bool free )
inlinestaticprivate

Initialize an as_val. Should only be used by subtypes.

Definition at line 191 of file as_val.h.

References as_val::count, as_val::free, type, and as_val::type.

◆ as_val_init()

static void as_val_init ( as_val * v,
as_val_t type,
bool free )
inlinestaticprivate

Initialize an as_val. Should only be used by subtypes.

Deprecated
Use as_val_cons() instead.

Definition at line 178 of file as_val.h.

References as_val::count, as_val::free, type, and as_val::type.

◆ as_val_tobool()

AS_EXTERN bool as_val_tobool ( const as_val * v)

Convert as_boolean or as_integer to bool. Otherwise, return false.

◆ as_val_val_destroy()

AS_EXTERN as_val * as_val_val_destroy ( as_val * )
private

Helper function for decrementing the count of a value, and if count==0 and free==true, then free the value.

◆ as_val_val_hashcode()

AS_EXTERN uint32_t as_val_val_hashcode ( const as_val * )
private

Helper function for calculating the hash value.

◆ as_val_val_reserve()

AS_EXTERN as_val * as_val_val_reserve ( as_val * )
private

Helper function for incrementing the count of a value.

◆ as_val_val_tostring()

AS_EXTERN char * as_val_val_tostring ( const as_val * )
private

Helper function for generating the string representation.