Added the snapshot/epoch type and getter in the public API, plus the store wrapper implementation:
This commit is contained in:
parent
9be82c64be
commit
12e2a91ca7
|
|
@ -20,6 +20,8 @@ typedef enum {
|
|||
GS_ERR_INTEGRITY = 4
|
||||
} amduat_tgk_graph_error_t;
|
||||
|
||||
typedef uint64_t amduat_tgk_snapshot_id_t;
|
||||
|
||||
typedef struct {
|
||||
amduat_tgk_edge_type_id_t *types;
|
||||
size_t types_len;
|
||||
|
|
@ -83,6 +85,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
bool (*get_config)(void *ctx, amduat_tgk_store_config_t *out_config);
|
||||
bool (*snapshot_id)(void *ctx, amduat_tgk_snapshot_id_t *out_id);
|
||||
amduat_tgk_graph_error_t (*resolve_edge)(void *ctx,
|
||||
amduat_reference_t ref,
|
||||
amduat_tgk_edge_body_t *out_body);
|
||||
|
|
@ -124,6 +127,9 @@ void amduat_tgk_store_init(amduat_tgk_store_t *store,
|
|||
bool amduat_tgk_store_get_config(amduat_tgk_store_t *store,
|
||||
amduat_tgk_store_config_t *out_config);
|
||||
|
||||
bool amduat_tgk_store_snapshot_id(amduat_tgk_store_t *store,
|
||||
amduat_tgk_snapshot_id_t *out_id);
|
||||
|
||||
amduat_tgk_graph_error_t amduat_tgk_store_resolve_edge(
|
||||
amduat_tgk_store_t *store,
|
||||
amduat_reference_t ref,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,14 @@ bool amduat_tgk_store_get_config(amduat_tgk_store_t *store,
|
|||
return store->ops.get_config(store->ctx, out_config);
|
||||
}
|
||||
|
||||
bool amduat_tgk_store_snapshot_id(amduat_tgk_store_t *store,
|
||||
amduat_tgk_snapshot_id_t *out_id) {
|
||||
if (store == NULL || store->ops.snapshot_id == NULL) {
|
||||
return false;
|
||||
}
|
||||
return store->ops.snapshot_id(store->ctx, out_id);
|
||||
}
|
||||
|
||||
amduat_tgk_graph_error_t amduat_tgk_store_resolve_edge(
|
||||
amduat_tgk_store_t *store,
|
||||
amduat_reference_t ref,
|
||||
|
|
|
|||
Loading…
Reference in a new issue