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

Go to the source code of this file.

Data Structures

struct  as_integer
 

Functions

static void as_integer_destroy (as_integer *integer)
 
static as_integeras_integer_fromval (const as_val *v)
 
static int64_t as_integer_get (const as_integer *integer)
 
static int64_t as_integer_getorelse (const as_integer *integer, int64_t fallback)
 
AS_EXTERN as_integeras_integer_init (as_integer *integer, int64_t value)
 
AS_EXTERN as_integeras_integer_new (int64_t value)
 
static int64_t as_integer_toint (const as_integer *integer)
 
static as_valas_integer_toval (const as_integer *i)
 
AS_EXTERN void as_integer_val_destroy (as_val *v)
 
AS_EXTERN uint32_t as_integer_val_hashcode (const as_val *v)
 
AS_EXTERN char * as_integer_val_tostring (const as_val *v)
 

Function Documentation

◆ as_integer_destroy()

static void as_integer_destroy ( as_integer * integer)
inlinestatic

Destroy the as_integer and release resources.

static void as_integer_destroy(as_integer *integer)
Definition as_integer.h:172
Parameters
integerThe integer to destroy.

Definition at line 172 of file as_integer.h.

◆ as_integer_fromval()

static as_integer * as_integer_fromval ( const as_val * v)
inlinestatic

Convert from an as_val.

Definition at line 226 of file as_integer.h.

◆ as_integer_get()

static int64_t as_integer_get ( const as_integer * integer)
inlinestatic

Get the int64_t value.

Definition at line 194 of file as_integer.h.

◆ as_integer_getorelse()

static int64_t as_integer_getorelse ( const as_integer * integer,
int64_t fallback )
inlinestatic

Get the int64_t value. If integer is NULL, then return the fallback value.

Definition at line 185 of file as_integer.h.

◆ as_integer_init()

AS_EXTERN as_integer * as_integer_init ( as_integer * integer,
int64_t value )

Initialize a stack allocated as_integer with the given integer value.

as_integer_init(&i, 123);
AS_EXTERN as_integer * as_integer_init(as_integer *integer, int64_t value)

as_integer_destroy() is not required for a stack allocated as_integer.

Parameters
integerThe as_integer to initialize.
valueThe integer value.
Returns
On success, the initialized value. Otherwise NULL.

◆ as_integer_new()

AS_EXTERN as_integer * as_integer_new ( int64_t value)

Creates a new heap allocated as_integer.

AS_EXTERN as_integer * as_integer_new(int64_t value)

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

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

◆ as_integer_toint()

static int64_t as_integer_toint ( const as_integer * integer)
inlinestatic

Get the int64_t value.

Deprecated
Use as_integer_get() instead.

Definition at line 204 of file as_integer.h.

◆ as_integer_toval()

static as_val * as_integer_toval ( const as_integer * i)
inlinestatic

Convert to an as_val.

Definition at line 217 of file as_integer.h.

◆ as_integer_val_destroy()

AS_EXTERN void as_integer_val_destroy ( as_val * v)
private

Internal helper function for destroying an as_val.

◆ as_integer_val_hashcode()

AS_EXTERN uint32_t as_integer_val_hashcode ( const as_val * v)
private

Internal helper function for getting the hashcode of an as_val.

◆ as_integer_val_tostring()

AS_EXTERN char * as_integer_val_tostring ( const as_val * v)
private

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