mirror of
https://github.com/logos-messaging/negentropy.git
synced 2026-01-05 23:43:11 +00:00
chore: add subrange size method
This commit is contained in:
parent
3044a30e4b
commit
19ebbdeb25
@ -84,13 +84,13 @@ int main(){
|
||||
if (subrange == NULL){
|
||||
perror("failed to init subrange");
|
||||
}
|
||||
printf("subrange init successful");
|
||||
printf("subrange init successful with size %d \n ", subrange_size(subrange) );
|
||||
|
||||
void* subrange1 = subrange_new(st1, 0 , UINT64_MAX);
|
||||
if (subrange == NULL){
|
||||
perror("failed to init subrange");
|
||||
}
|
||||
printf("subrange init successful");
|
||||
printf("subrange init successful with size %d \n ", subrange_size(subrange1) );
|
||||
|
||||
void* ngn_inst1 = negentropy_new(subrange1, 153600);
|
||||
if(ngn_inst1 == NULL){
|
||||
|
||||
@ -302,6 +302,11 @@ void subrange_delete(void* range){
|
||||
delete subRange;
|
||||
}
|
||||
|
||||
int subrange_size(void* range){
|
||||
negentropy::storage::SubRange* subrange = reinterpret_cast<negentropy::storage::SubRange*>(range);
|
||||
return subrange->size();
|
||||
}
|
||||
|
||||
void negentropy_subrange_delete(void* negentropy){
|
||||
Negentropy<negentropy::storage::SubRange>* ngn_inst = reinterpret_cast<Negentropy<negentropy::storage::SubRange>*>(negentropy);
|
||||
delete ngn_inst;
|
||||
|
||||
@ -68,6 +68,8 @@ EXTERNC int reconcile_subrange(void* negentropy, buffer* query, result* result);
|
||||
|
||||
EXTERNC int reconcile_with_ids_subrange_no_cbk(void* negentropy, buffer* query, result* result);
|
||||
|
||||
EXTERNC int subrange_size(void* storage);
|
||||
|
||||
//End of SubRange methods
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user