From 321264f5e9c93cc59b204f8db73282168c111318 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 7 Sep 2021 14:53:11 +0200 Subject: [PATCH] Add more declarations in ccaosdb.h --- include/ccaosdb.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/include/ccaosdb.h b/include/ccaosdb.h index 4b92327..788cf0b 100644 --- a/include/ccaosdb.h +++ b/include/ccaosdb.h @@ -297,12 +297,17 @@ typedef struct caosdb_transaction_result_set { bool _deletable = false; } caosdb_transaction_result_set; +typedef struct caosdb_entity_entity { + void *wrapped_entity; + bool _deletable = false; +} caosdb_entity_entity; + int caosdb_transaction_transaction_get_result_set(caosdb_transaction_transaction *transaction, caosdb_transaction_result_set *out); /** * Release the result set from the transaction. * - * The transactions is spoiled after this action and should be used anymore. + * The transactions is spoiled after this action and should not be used anymore. * * Note: The result_set has to be deleted via caosdb_transaction_delete_result_set. * @@ -310,6 +315,18 @@ int caosdb_transaction_transaction_get_result_set(caosdb_transaction_transaction */ int caosdb_transaction_transaction_release_result_set(caosdb_transaction_transaction *transaction, caosdb_transaction_result_set *out); +/** + * Release the entity from the result set. + * + * Each entity (each index) can be released once. The result set is spoiled + * after this action and should not be used for anything else anymore. + * + * Note: The result_set has to be deleted via caosdb_entity_delete_entity. + * + * EXPERT USE ONLY. Only use it when you know what you are doing. + */ +int caosdb_transaction_result_set_release_at(caosdb_transaction_result_set *result_set, + caosdb_entity_entity *entity, int index); /** * Destructor for caosdb_transaction_result_set. * @@ -320,11 +337,6 @@ int caosdb_transaction_delete_result_set(caosdb_transaction_result_set *result_s int caosdb_transaction_transaction_get_count_result(caosdb_transaction_transaction *transaction, long *out); -typedef struct caosdb_entity_entity { - void *wrapped_entity; - bool _deletable = false; -} caosdb_entity_entity; - int caosdb_transaction_result_set_at(caosdb_transaction_result_set *result_set, caosdb_entity_entity *entity, int index); int caosdb_transaction_result_set_size(caosdb_transaction_result_set *result_set, int *out); -- GitLab