|
@@ -224,6 +224,25 @@ typedef LSUP_rc (*store_add_iter_fn_t)(
|
|
typedef void (*store_add_abort_fn_t)(void *it);
|
|
typedef void (*store_add_abort_fn_t)(void *it);
|
|
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * Iterator function types.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/** @brief Get iterator active transaction handle.
|
|
|
|
+ *
|
|
|
|
+ * This function is used to get an active transaction during an iteration loop
|
|
|
|
+ * in order to perform an action using the store state within that loop. Some
|
|
|
|
+ * stores (e.g. MDB) only support one R/W open transaction per thread, so this
|
|
|
|
+ * is also the only way to perform anything else than iterating or committing
|
|
|
|
+ * while a loop is open.
|
|
|
|
+ *
|
|
|
|
+ * @param[in] it Iterator handle to get the transaction from.
|
|
|
|
+ *
|
|
|
|
+ * @return Transaction handle. DO NOT close this transaction directly.
|
|
|
|
+ */
|
|
|
|
+typedef void * (*iter_txn_fn_t)(void *it);
|
|
|
|
+
|
|
|
|
+
|
|
/** @brief Finalize an add loop and free iterator.
|
|
/** @brief Finalize an add loop and free iterator.
|
|
*
|
|
*
|
|
* This must be called after #add_iter_fn.
|
|
* This must be called after #add_iter_fn.
|
|
@@ -355,10 +374,6 @@ typedef LSUP_rc (*store_nsm_put_fn_t)(
|
|
typedef LSUP_NSMap * (*store_nsm_get_fn_t)(void *store);
|
|
typedef LSUP_NSMap * (*store_nsm_get_fn_t)(void *store);
|
|
|
|
|
|
|
|
|
|
-/*
|
|
|
|
- * Iterator function types.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
/** @brief Prototype: yield the matching triples and advance the iterator.
|
|
/** @brief Prototype: yield the matching triples and advance the iterator.
|
|
*
|
|
*
|
|
* NOTE: Iterators keep transactions open. Don't hold on to them longer than
|
|
* NOTE: Iterators keep transactions open. Don't hold on to them longer than
|
|
@@ -441,6 +456,7 @@ typedef struct store_if_t {
|
|
store_txn_begin_fn_t txn_begin_fn; ///< Begin transaction.
|
|
store_txn_begin_fn_t txn_begin_fn; ///< Begin transaction.
|
|
store_txn_commit_fn_t txn_commit_fn; ///< Commit transaction.
|
|
store_txn_commit_fn_t txn_commit_fn; ///< Commit transaction.
|
|
store_txn_abort_fn_t txn_abort_fn; ///< Abort transaction.
|
|
store_txn_abort_fn_t txn_abort_fn; ///< Abort transaction.
|
|
|
|
+ iter_txn_fn_t iter_txn_fn; ///< Get iterator's transaction.
|
|
|
|
|
|
// Addition.
|
|
// Addition.
|
|
store_add_init_fn_t add_init_fn; ///< Initialize add iteration.
|
|
store_add_init_fn_t add_init_fn; ///< Initialize add iteration.
|