All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions
as_orderedmap.h File Reference
#include <aerospike/as_std.h>
#include <aerospike/as_map.h>
#include <aerospike/as_pair.h>
+ Include dependency graph for as_orderedmap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_orderedmap
 
struct  as_orderedmap_iterator
 
struct  map_entry
 

Functions

AS_EXTERN int as_orderedmap_clear (as_orderedmap *map)
 
AS_EXTERN void as_orderedmap_destroy (as_orderedmap *map)
 
AS_EXTERN bool as_orderedmap_foreach (const as_orderedmap *map, as_map_foreach_callback callback, void *udata)
 
AS_EXTERN as_valas_orderedmap_get (const as_orderedmap *map, const as_val *key)
 
AS_EXTERN as_orderedmapas_orderedmap_init (as_orderedmap *map, uint32_t capacity)
 
AS_EXTERN void as_orderedmap_iterator_destroy (as_orderedmap_iterator *it)
 
AS_EXTERN bool as_orderedmap_iterator_has_next (const as_orderedmap_iterator *it)
 
AS_EXTERN as_orderedmap_iteratoras_orderedmap_iterator_init (as_orderedmap_iterator *it, const as_orderedmap *map)
 
AS_EXTERN as_orderedmap_iteratoras_orderedmap_iterator_new (const as_orderedmap *map)
 
AS_EXTERN const as_valas_orderedmap_iterator_next (as_orderedmap_iterator *it)
 
AS_EXTERN as_orderedmapas_orderedmap_new (uint32_t capacity)
 
AS_EXTERN int as_orderedmap_remove (as_orderedmap *map, const as_val *key)
 
AS_EXTERN int as_orderedmap_set (as_orderedmap *map, const as_val *key, const as_val *val)
 
static void as_orderedmap_set_flags (as_orderedmap *map, uint32_t flags)
 
AS_EXTERN uint32_t as_orderedmap_size (const as_orderedmap *map)
 

Function Documentation

AS_EXTERN int as_orderedmap_clear ( as_orderedmap map)

Remove all entries from the map.

Parameters
mapThe map.
Returns
0 on success. Otherwise an error occurred.
AS_EXTERN void as_orderedmap_destroy ( as_orderedmap map)

Free the map and associated resources.

Parameters
mapThe map to destroy.
AS_EXTERN bool as_orderedmap_foreach ( const as_orderedmap map,
as_map_foreach_callback  callback,
void *  udata 
)

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.
AS_EXTERN as_val * as_orderedmap_get ( const as_orderedmap map,
const as_val key 
)

Get the value for specified key.

Parameters
mapThe map.
keyThe key.
Returns
The value for the specified key. Otherwise NULL.
AS_EXTERN as_orderedmap * as_orderedmap_init ( as_orderedmap map,
uint32_t  capacity 
)

Initialize a stack allocated orderedmap.

Parameters
mapThe map to initialize.
capacityThe number of entries (keys) to allocate for.
Returns
On success, the initialized map. Otherwise NULL.
AS_EXTERN void as_orderedmap_iterator_destroy ( as_orderedmap_iterator it)

Destroy the iterator and releases resources used by the iterator.

Parameters
itThe iterator to release
AS_EXTERN bool as_orderedmap_iterator_has_next ( const as_orderedmap_iterator it)

Tests if there are more values available in the iterator.

Parameters
itThe iterator to be tested.
Returns
true if there are more values. Otherwise false.
AS_EXTERN as_orderedmap_iterator * as_orderedmap_iterator_init ( as_orderedmap_iterator it,
const as_orderedmap map 
)

Initializes a stack allocated as_iterator for the given as_orderedmap.

Parameters
itThe iterator to initialize.
mapThe map to iterate.
Returns
On success, the initialized iterator. Otherwise NULL.
AS_EXTERN as_orderedmap_iterator * as_orderedmap_iterator_new ( const as_orderedmap map)

Creates a heap allocated as_iterator for the given as_orderedmap.

Parameters
mapThe map to iterate.
Returns
On success, the new iterator. Otherwise NULL.
AS_EXTERN const as_val * as_orderedmap_iterator_next ( as_orderedmap_iterator it)

Attempts to get the next value from the iterator. This will return the next value, and iterate past the value.

Parameters
itThe iterator to get the next value from.
Returns
The next value in the list if available. Otherwise NULL.
AS_EXTERN as_orderedmap * as_orderedmap_new ( uint32_t  capacity)

Creates a new map as an orderedmap.

Parameters
capacityThe number of keys to allocate for.
Returns
On success, the new map. Otherwise NULL.
AS_EXTERN int as_orderedmap_remove ( as_orderedmap map,
const as_val key 
)

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.
AS_EXTERN int as_orderedmap_set ( as_orderedmap map,
const as_val key,
const as_val val 
)

Set the value for specified key.

Parameters
mapThe map.
keyThe key.
valThe value for the given key.
Returns
0 on success. Otherwise an error occurred.
static void as_orderedmap_set_flags ( as_orderedmap map,
uint32_t  flags 
)
inlinestatic

Set map attributes.

Definition at line 291 of file as_orderedmap.h.

References AS_MAP_FLAGS_MASK, and as_map::flags.

AS_EXTERN uint32_t as_orderedmap_size ( const as_orderedmap map)

Get the number of entries in the map.

Parameters
mapThe map.
Returns
The number of entries in the map.