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

Go to the source code of this file.

Data Structures

struct  as_double
 

Functions

static void as_double_destroy (as_double *value)
 
static as_doubleas_double_fromval (const as_val *value)
 
static double as_double_get (const as_double *value)
 
static double as_double_getorelse (const as_double *value, double fallback)
 
AS_EXTERN as_doubleas_double_init (as_double *value_ptr, double value)
 
AS_EXTERN as_doubleas_double_new (double value)
 
static as_valas_double_toval (const as_double *value)
 
AS_EXTERN void as_double_val_destroy (as_val *value)
 
AS_EXTERN uint32_t as_double_val_hashcode (const as_val *value)
 
AS_EXTERN char * as_double_val_tostring (const as_val *value)
 

Function Documentation

◆ as_double_destroy()

static void as_double_destroy ( as_double * value)
inlinestatic

Destroy the as_double and release resources.

static void as_double_destroy(as_double *value)
Definition as_double.h:173
Parameters
valueThe double to destroy.

Definition at line 173 of file as_double.h.

◆ as_double_fromval()

static as_double * as_double_fromval ( const as_val * value)
inlinestatic

Convert from an as_val.

Definition at line 225 of file as_double.h.

◆ as_double_get()

static double as_double_get ( const as_double * value)
inlinestatic

Get the double value.

Definition at line 199 of file as_double.h.

◆ as_double_getorelse()

static double as_double_getorelse ( const as_double * value,
double fallback )
inlinestatic

Get the double value. If double is NULL, then return the fallback value.

Definition at line 188 of file as_double.h.

◆ as_double_init()

AS_EXTERN as_double * as_double_init ( as_double * value_ptr,
double value )

Initialize a stack allocated as_double with the given double value.

as_double_init(&v, 123.45);
AS_EXTERN as_double * as_double_init(as_double *value_ptr, double value)

as_double_destroy() is not required for a stack allocated as_double.

Parameters
value_ptrThe as_double to initialize.
valueThe double value.
Returns
On success, the initialized value. Otherwise NULL.

◆ as_double_new()

AS_EXTERN as_double * as_double_new ( double value)

Creates a new heap allocated as_double.

as_double* v = as_double_new(123.45);
AS_EXTERN as_double * as_double_new(double value)

When the as_double is no longer needed, you should release it an it's resources:

Parameters
valueThe double value.
Returns
On success, the initialized value. Otherwise NULL.

◆ as_double_toval()

static as_val * as_double_toval ( const as_double * value)
inlinestatic

Convert to an as_val.

Definition at line 214 of file as_double.h.

◆ as_double_val_destroy()

AS_EXTERN void as_double_val_destroy ( as_val * value)
private

Internal helper function for destroying an as_val.

◆ as_double_val_hashcode()

AS_EXTERN uint32_t as_double_val_hashcode ( const as_val * value)
private

Internal helper function for getting the hashcode of an as_val.

◆ as_double_val_tostring()

AS_EXTERN char * as_double_val_tostring ( const as_val * value)
private

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