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

Go to the source code of this file.

Data Structures

struct  as_boolean
 

Functions

static void as_boolean_destroy (as_boolean *boolean)
 
static as_booleanas_boolean_fromval (const as_val *v)
 
static bool as_boolean_get (const as_boolean *boolean)
 
static bool as_boolean_getorelse (const as_boolean *boolean, bool fallback)
 
AS_EXTERN as_booleanas_boolean_init (as_boolean *boolean, bool value)
 
AS_EXTERN as_booleanas_boolean_new (bool value)
 
static bool as_boolean_tobool (const as_boolean *boolean)
 
static as_valas_boolean_toval (const as_boolean *boolean)
 
AS_EXTERN void as_boolean_val_destroy (as_val *v)
 
AS_EXTERN uint32_t as_boolean_val_hashcode (const as_val *v)
 
AS_EXTERN char * as_boolean_val_tostring (const as_val *v)
 

Variables

AS_EXTERN const as_boolean as_false
 
AS_EXTERN const as_boolean as_true
 

Function Documentation

◆ as_boolean_destroy()

static void as_boolean_destroy ( as_boolean * boolean)
inlinestatic

Destroy the as_boolean and release associated resources.

Parameters
booleanThe as_boolean to destroy.

Definition at line 116 of file as_boolean.h.

◆ as_boolean_fromval()

static as_boolean * as_boolean_fromval ( const as_val * v)
inlinestatic

Convert from an as_val.

Definition at line 170 of file as_boolean.h.

◆ as_boolean_get()

static bool as_boolean_get ( const as_boolean * boolean)
inlinestatic

Get the bool value.

Definition at line 138 of file as_boolean.h.

◆ as_boolean_getorelse()

static bool as_boolean_getorelse ( const as_boolean * boolean,
bool fallback )
inlinestatic

Get the bool value. If boolean is NULL, then return the fallback value.

Definition at line 129 of file as_boolean.h.

◆ as_boolean_init()

AS_EXTERN as_boolean * as_boolean_init ( as_boolean * boolean,
bool value )

Initialize a stack allocated as_boolean with the given boolean value.

Parameters
booleanThe as_boolean to initialize.
valueThe bool value.
Returns
On success, the initialized value. Otherwise NULL.

◆ as_boolean_new()

AS_EXTERN as_boolean * as_boolean_new ( bool value)

Creates a new heap allocated as_boolean and initializes with the given boolean value.

Parameters
valueThe bool value.
Returns
On success, the newly allocated value. Otherwise NULL.

◆ as_boolean_tobool()

static bool as_boolean_tobool ( const as_boolean * boolean)
inlinestatic

Get the bool value.

Deprecated
Use as_boolean_get() instead.

Definition at line 148 of file as_boolean.h.

◆ as_boolean_toval()

static as_val * as_boolean_toval ( const as_boolean * boolean)
inlinestatic

Convert to an as_val.

Definition at line 161 of file as_boolean.h.

◆ as_boolean_val_destroy()

AS_EXTERN void as_boolean_val_destroy ( as_val * v)
private

Internal helper function for destroying an as_val.

◆ as_boolean_val_hashcode()

AS_EXTERN uint32_t as_boolean_val_hashcode ( const as_val * v)
private

Internal helper function for getting the hashcode of an as_val.

◆ as_boolean_val_tostring()

AS_EXTERN char * as_boolean_val_tostring ( const as_val * v)
private

Internal helper function for getting the string representation of an as_val.

Variable Documentation

◆ as_false

AS_EXTERN const as_boolean as_false
extern

False value.

Use this when you need to use an as_boolean containing true, rather than allocating a new as_boolean.

◆ as_true

AS_EXTERN const as_boolean as_true
extern

True value.

Use this when you need to use an as_boolean containing true, rather than allocating a new as_boolean.