FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
fheap.h File Reference
+ Include dependency graph for fheap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fheap_node_t
 
struct  fheap_t
 

Macros

#define foreach_fheap_node_sibling(f, ni, first_ni, body)
 

Functions

static void fheap_init (fheap_t *f, u32 n_nodes)
 
static void fheap_free (fheap_t *f)
 
static u32 fheap_find_min (fheap_t *f)
 
static u32 fheap_is_empty (fheap_t *f)
 
void fheap_add (fheap_t *f, u32 ni, u32 key)
 
void fheap_del (fheap_t *f, u32 ni)
 
u32 fheap_del_min (fheap_t *f, u32 *min_key)
 
void fheap_decrease_key (fheap_t *f, u32 ni, u32 new_key)
 

Macro Definition Documentation

◆ foreach_fheap_node_sibling

#define foreach_fheap_node_sibling (   f,
  ni,
  first_ni,
  body 
)
Value:
do { \
u32 __fheap_foreach_first_ni = (first_ni); \
u32 __fheap_foreach_ni = __fheap_foreach_first_ni; \
u32 __fheap_foreach_next_ni; \
fheap_node_t * __fheap_foreach_n; \
if (__fheap_foreach_ni != ~0) \
while (1) \
{ \
__fheap_foreach_n = fheap_get_node ((f), __fheap_foreach_ni); \
__fheap_foreach_next_ni = __fheap_foreach_n -> next_sibling; \
(ni) = __fheap_foreach_ni; \
\
body; \
\
/* End of circular list? */ \
if (__fheap_foreach_next_ni == __fheap_foreach_first_ni) \
break; \
\
__fheap_foreach_ni = __fheap_foreach_next_ni; \
\
} \
} while (0)
static fheap_node_t * fheap_get_node(fheap_t *f, u32 i)
Definition: fheap.c:19

Definition at line 47 of file fheap.h.

Function Documentation

◆ fheap_add()

void fheap_add ( fheap_t f,
u32  ni,
u32  key 
)

Definition at line 163 of file fheap.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fheap_decrease_key()

void fheap_decrease_key ( fheap_t f,
u32  ni,
u32  new_key 
)

Definition at line 411 of file fheap.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fheap_del()

void fheap_del ( fheap_t f,
u32  ni 
)

Definition at line 434 of file fheap.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fheap_del_min()

u32 fheap_del_min ( fheap_t f,
u32 min_key 
)

Definition at line 298 of file fheap.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fheap_find_min()

static u32 fheap_find_min ( fheap_t f)
inlinestatic

Definition at line 111 of file fheap.h.

◆ fheap_free()

static void fheap_free ( fheap_t f)
inlinestatic

Definition at line 104 of file fheap.h.

◆ fheap_init()

static void fheap_init ( fheap_t f,
u32  n_nodes 
)
inlinestatic

Definition at line 87 of file fheap.h.

+ Here is the call graph for this function:

◆ fheap_is_empty()

static u32 fheap_is_empty ( fheap_t f)
inlinestatic

Definition at line 117 of file fheap.h.

+ Here is the call graph for this function: