tranger2_open_iterator()

tranger2_open_iterator()#

Opens an iterator for traversing records in a topic within the TimeRanger database. The iterator allows filtering records based on specified conditions and supports real-time data loading.

Prototype

json_t *tranger2_open_iterator(
    json_t *tranger,
    const char *topic_name,
    const char *key,    // required
    json_t *match_cond, // owned
    tranger2_load_record_callback_t load_record_callback, // called on LOADING and APPENDING, optional
    const char *iterator_id,     // iterator id, optional, if empty will be the key
    const char *creator,     // creator
    json_t *data,       // JSON array, if not empty, fills it with the LOADING data, not owned
    json_t *extra       // owned, user data, this json will be added to the return iterator
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the TimeRanger database instance.

topic_name

const char *

Name of the topic to iterate over.

key

const char *

Specific key to filter records. Required.

match_cond

json_t *

JSON object containing filtering conditions. Owned by the function.

load_record_callback

tranger2_load_record_callback_t

Callback function invoked during data loading and appending. Optional.

iterator_id

const char *

Unique identifier for the iterator. If empty, the key is used.

creator

const char *

Identifier of the entity creating the iterator.

data

json_t *

JSON array to store loaded data. Not owned by the function.

extra

json_t *

Additional user data attached to the iterator. Owned by the function.


Return Value

Returns a JSON object representing the iterator. The caller is responsible for managing its lifecycle.

Notes

The iterator supports real-time data loading and filtering based on various conditions. Use tranger2_close_iterator() to release resources when done.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples