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 |
---|---|---|
|
|
Pointer to the TimeRanger database instance. |
|
|
Name of the topic to iterate over. |
|
|
Specific key to filter records. Required. |
|
|
JSON object containing filtering conditions. Owned by the function. |
|
|
Callback function invoked during data loading and appending. Optional. |
|
|
Unique identifier for the iterator. If empty, the key is used. |
|
|
Identifier of the entity creating the iterator. |
|
|
JSON array to store loaded data. Not owned by the function. |
|
|
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