All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Fields
as_map_hooks Struct Reference

Detailed Description

Map Function Hooks

Definition at line 85 of file as_map.h.

#include "as_map.h"

+ Collaboration diagram for as_map_hooks:

Data Fields

int(* clear )(as_map *map)
 
bool(* destroy )(as_map *map)
 
bool(* foreach )(const as_map *map, as_map_foreach_callback callback, void *udata)
 
as_val *(* get )(const as_map *map, const as_val *key)
 
uint32_t(* hashcode )(const as_map *map)
 
union as_map_iterator_u *(* iterator_init )(const as_map *map, union as_map_iterator_u *it)
 
union as_map_iterator_u *(* iterator_new )(const as_map *map)
 
int(* remove )(as_map *map, const as_val *key)
 
int(* set )(as_map *map, const as_val *key, const as_val *val)
 
void(* set_flags )(as_map *map, uint32_t flags)
 
uint32_t(* size )(const as_map *map)
 

Field Documentation

int(* as_map_hooks::clear)(as_map *map)

Clear all entries of the map.

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

Definition at line 154 of file as_map.h.

bool(* as_map_hooks::destroy)(as_map *map)

Releases the subtype of as_map.

Parameters
mapThe map instance to destroy.
Returns
true on success. Otherwise false.

Definition at line 98 of file as_map.h.

bool(* as_map_hooks::foreach)(const as_map *map, as_map_foreach_callback callback, void *udata)

Iterate over each entry in the map can call the callback function.

Parameters
mapThe map to iterate.
callbackThe function to call for each entry in the map.
udataUser-data to be passed to the callback.
Returns
true on success. Otherwise false.

Definition at line 189 of file as_map.h.

as_val*(* as_map_hooks::get)(const as_map *map, const as_val *key)

Set a value at the given key of the map.

Parameters
mapThe map to containing the (key,value) pair.
keyThe key of the value.
Returns
The value on success. Otherwise NULL.

Definition at line 145 of file as_map.h.

uint32_t(* as_map_hooks::hashcode)(const as_map *map)

The hash value of an as_map.

Parameters
mapThe map to get the hashcode value for.
Returns
The hashcode value.

Definition at line 111 of file as_map.h.

union as_map_iterator_u*(* as_map_hooks::iterator_init)(const as_map *map, union as_map_iterator_u *it)

Initialize a stack allocated iterator to traverse over the entries map.

Parameters
mapThe map to iterate.
Returns
true on success. Otherwise false.

Definition at line 207 of file as_map.h.

union as_map_iterator_u*(* as_map_hooks::iterator_new)(const as_map *map)

Create and initialize a new heap allocated iterator to traverse over the entries map.

Parameters
mapThe map to iterate.
Returns
true on success. Otherwise false.

Definition at line 198 of file as_map.h.

int(* as_map_hooks::remove)(as_map *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.

Definition at line 164 of file as_map.h.

int(* as_map_hooks::set)(as_map *map, const as_val *key, const as_val *val)

Set a value of the given key in a map.

Parameters
mapThe map to store the (key,value) pair.
keyThe key for the given value.
valThe value for the given key.
Returns
0 on success. Otherwise an error occurred.

Definition at line 135 of file as_map.h.

void(* as_map_hooks::set_flags)(as_map *map, uint32_t flags)

Set map attributes.

Parameters
mapThe map to remove the entry from.
flagsFlags to set.
Returns
0 on success. Otherwise an error occurred.

Definition at line 174 of file as_map.h.

uint32_t(* as_map_hooks::size)(const as_map *map)

The size of the as_map.

Parameters
mapThe map to get the size of.
Returns
The number of entries in the map.

Definition at line 120 of file as_map.h.


The documentation for this struct was generated from the following file: