JULEA
Data Structures | Typedefs | Functions
KV Iterator

Data Structures

struct  JKVIterator
 

Typedefs

typedef struct JKVIterator JKVIterator
 

Functions

G_END_DECLS G_BEGIN_DECLS JKVIteratorj_kv_iterator_new (gchar const *namespace, gchar const *prefix)
 
JKVIteratorj_kv_iterator_new_for_index (guint32 index, gchar const *namespace, gchar const *prefix)
 
void j_kv_iterator_free (JKVIterator *iterator)
 
gboolean j_kv_iterator_next (JKVIterator *iterator)
 
gchar const * j_kv_iterator_get (JKVIterator *iterator, gconstpointer *value, guint32 *len)
 

Detailed Description

Data structures and functions for iterating over key-value pairs.

Typedef Documentation

◆ JKVIterator

typedef struct JKVIterator JKVIterator

Function Documentation

◆ j_kv_iterator_free()

void j_kv_iterator_free ( JKVIterator iterator)

Frees the memory allocated by the JKVIterator.

Parameters
iteratorA JKVIterator.

◆ j_kv_iterator_get()

gchar const* j_kv_iterator_get ( JKVIterator iterator,
gconstpointer *  value,
guint32 *  len 
)

Returns the current collection.

Parameters
iteratorA store iterator.
valueA pointer to be set to the current value.
lenWill be set to the length of the current value.
Returns
The current key.

◆ j_kv_iterator_new()

G_END_DECLS G_BEGIN_DECLS JKVIterator* j_kv_iterator_new ( gchar const *  namespace,
gchar const *  prefix 
)

Creates a new JKVIterator.

Parameters
namespaceJKV namespace to iterate over.
prefixPrefix of keys to iterate over. Set to NULL to iterate over all KVs.
Returns
A new JKVIterator.
Todo:
still necessary?

◆ j_kv_iterator_new_for_index()

JKVIterator* j_kv_iterator_new_for_index ( guint32  index,
gchar const *  namespace,
gchar const *  prefix 
)

Creates a new JKVIterator on a specific KV server.

Parameters
indexServer to query.
namespaceJKV namespace to iterate over.
prefixPrefix of keys to iterate over. Set to NULL to iterate over all KVs.
Returns
A new JKVIterator.
Todo:
still necessary?

◆ j_kv_iterator_next()

gboolean j_kv_iterator_next ( JKVIterator iterator)

Checks whether another collection is available.

Parameters
iteratorA store iterator.
Returns
TRUE on success, FALSE if the end of the store is reached.