tleaf.h 1.3 KB
Newer Older
1 2 3 4 5 6 7 8 9
#ifndef TLEAF_H
#define TLEAF_H

#include "excit.h"

struct tleaf_it_s{
  ssize_t                cur;          // cursor of iterator position
  ssize_t                depth;        // The tree depth
  ssize_t*               arity;        // Number of children per node on each level
Nicolas Denoyelle's avatar
wip  
Nicolas Denoyelle committed
10 11 12
  ssize_t*               nleaves;      // Number of leaves below each level
  ssize_t                offset;       // When split occures, a resulting chunk can be offset as a subtree of the original one.
  ssize_t*               strides;      // When split occures, indexing might not be contiguous anymore, the stride is applied by level. It shall be increased by 1 on level where split occures.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  enum tleaf_it_policy_e policy;       // iteration policy
};

/* See excit.h for functions meaning */
int  tleaf_it_alloc(excit_t);
void tleaf_it_free(excit_t);
int  tleaf_it_copy(excit_t, const excit_t);
int  tleaf_it_next(excit_t, ssize_t*);
int  tleaf_it_peek(const excit_t, ssize_t*);
int  tleaf_it_size(const excit_t, ssize_t*);
int  tleaf_it_rewind(excit_t);
int  tleaf_it_split(const excit_t, ssize_t, excit_t*);
int  tleaf_it_nth(const excit_t, ssize_t, ssize_t*);
int  tleaf_it_rank(const excit_t, const ssize_t*, ssize_t*);
int  tleaf_it_pos(const excit_t, ssize_t*);

extern struct excit_func_table_s excit_tleaf_func_table;

#endif //TLEAF_H