All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Typedefs | Functions
target/Darwin-i386/include/aerospike/as_map.h File Reference
#include <aerospike/as_iterator.h>
#include <aerospike/as_util.h>
#include <aerospike/as_val.h>
#include <stdbool.h>
#include <stdint.h>
+ Include dependency graph for target/Darwin-i386/include/aerospike/as_map.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_map
 
struct  as_map_hooks
 

Typedefs

typedef bool(* as_map_foreach_callback )(const as_val *key, const as_val *value, void *udata)
 

Functions

static int as_map_clear (as_map *map)
 
as_mapas_map_cons (as_map *map, bool free, void *data, const as_map_hooks *hooks)
 
static void as_map_destroy (as_map *map)
 
static bool as_map_foreach (const as_map *map, as_map_foreach_callback callback, void *udata)
 
static as_mapas_map_fromval (const as_val *val)
 
static as_valas_map_get (const as_map *map, const as_val *key)
 
static uint32_t as_map_hashcode (const as_map *map)
 
as_mapas_map_init (as_map *map, void *data, const as_map_hooks *hooks)
 
static union as_map_iterator_u * as_map_iterator_init (union as_map_iterator_u *it, const as_map *map)
 
static union as_map_iterator_u * as_map_iterator_new (const as_map *map)
 
as_mapas_map_new (void *data, const as_map_hooks *hooks)
 
static int as_map_remove (as_map *map, const as_val *key)
 
static int as_map_set (as_map *map, const as_val *key, const as_val *val)
 
static uint32_t as_map_size (const as_map *map)
 
static as_valas_map_toval (const as_map *map)
 
void as_map_val_destroy (as_val *val)
 
uint32_t as_map_val_hashcode (const as_val *val)
 
char * as_map_val_tostring (const as_val *val)
 

Typedef Documentation

typedef bool(* as_map_foreach_callback)(const as_val *key, const as_val *value, void *udata)

Callback function for as_map_foreach(). Called for each entry in the map.

Parameters
keyThe key of the current entry.
valueThe value of the current entry.
udataThe user-data provided to the as_list_foreach().
Returns
true to continue iterating through the list. false to stop iterating.

Definition at line 51 of file target/Darwin-i386/include/aerospike/as_map.h.

Function Documentation

static int as_map_clear ( as_map map)
inlinestatic

Remove all entries from the map.

Parameters
mapThe map.
Returns
0 on success. Otherwise an error occurred.

Definition at line 323 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

as_map* as_map_cons ( as_map map,
bool  free,
void *  data,
const as_map_hooks hooks 
)
private

Utilized by subtypes of as_map to initialize the parent.

Parameters
mapThe map to initialize
freeIf TRUE, then as_map_destory() will free the map.
dataData for the map.
hooksImplementaton for the map interface.
Returns
The initialized as_map on success. Otherwise NULL.
static void as_map_destroy ( as_map map)
inlinestatic

Destroy the as_map and associated resources.

Definition at line 247 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_val_destroy.

static bool as_map_foreach ( const as_map map,
as_map_foreach_callback  callback,
void *  udata 
)
inlinestatic

Call the callback function for each entry in the map.

Parameters
mapThe map.
callbackThe function to call for each entry.
udataUser-data to be passed to the callback.
Returns
true if iteration completes fully. false if iteration was aborted.

Definition at line 358 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

static as_map * as_map_fromval ( const as_val val)
inlinestatic

Convert from an as_val.

Definition at line 407 of file target/Darwin-i386/include/aerospike/as_map.h.

References AS_MAP, and as_util_fromval.

static as_val * as_map_get ( const as_map map,
const as_val key 
)
inlinestatic

Get the value for specified key.

Parameters
mapThe map.
keyThe key.
Returns
The value for the specified key on success. Otherwise NULL.

Definition at line 295 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

static uint32_t as_map_hashcode ( const as_map map)
inlinestatic

Hash value for the map

Parameters
mapThe map
Returns
The hashcode value of the map.

Definition at line 264 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

as_map* as_map_init ( as_map map,
void *  data,
const as_map_hooks hooks 
)

Initialize a stack allocated map.

Parameters
mapStack allocated map to initialize.
dataData for the map.
hooksImplementation for the map interface.
Returns
On success, the initialized map. Otherwise NULL.
static union as_map_iterator_u * as_map_iterator_init ( union as_map_iterator_u *  it,
const as_map map 
)
static

Initialzies a stack allocated iterator over the given map.

Parameters
mapThe map to iterate.
itThe iterator to initialize.
Returns
On success, the initializes as_iterator. Otherwise NULL.

Definition at line 385 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

static union as_map_iterator_u * as_map_iterator_new ( const as_map map)
static

Creates and initializes a new heap allocated iterator over the given map.

Parameters
mapThe map to iterate.
Returns
On success, a new as_iterator. Otherwise NULL.

Definition at line 371 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

as_map* as_map_new ( void *  data,
const as_map_hooks hooks 
)

Create and initialize a new heap allocated map.

Parameters
dataData for the list.
hooksImplementation for the list interface.
Returns
On success, a new list. Otherwise NULL.
static int as_map_remove ( as_map map,
const as_val key 
)
inlinestatic

Remove the entry specified by the key.

Parameters
mapThe map to remove the entry from.
keyThe key of the entry to be removed.
Returns
0 on success. Otherwise an error occurred.

Definition at line 338 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

static int as_map_set ( as_map map,
const as_val key,
const as_val val 
)
inlinestatic

Set the value for specified key.

Parameters
mapThe map.
keyThe key.
valThe value for the key.
Returns
0 on success. Otherwise an error occurred.

Definition at line 310 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

static uint32_t as_map_size ( const as_map map)
inlinestatic

Get the number of entries in the map.

Parameters
mapThe map
Returns
The size of the map.

Definition at line 277 of file target/Darwin-i386/include/aerospike/as_map.h.

References as_util_hook.

static as_val * as_map_toval ( const as_map map)
inlinestatic

Convert to an as_val.

Definition at line 398 of file target/Darwin-i386/include/aerospike/as_map.h.

void as_map_val_destroy ( as_val val)
private

Internal helper function for destroying an as_val.

uint32_t as_map_val_hashcode ( const as_val val)
private

Internal helper function for getting the hashcode of an as_val.

char* as_map_val_tostring ( const as_val val)
private

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