XenevaOS
Loading...
Searching...
No Matches
Public Attributes | List of all members
interval_tree_span_iter Struct Reference

#include <interval_tree.h>

Collaboration diagram for interval_tree_span_iter:
Collaboration graph
[legend]

Public Attributes

struct interval_tree_node * nodes [2]
 
unsigned long first_index
 
unsigned long last_index
 
union { 
 
   unsigned long   start_hole 
 
   unsigned long   start_used 
 
};  
 
union { 
 
   unsigned long   last_hole 
 
   unsigned long   last_used 
 
};  
 
int is_hole
 

Detailed Description

struct interval_tree_span_iter - Find used and unused spans. @start_hole: Start of an interval for a hole when is_hole == 1 @last_hole: Inclusive end of an interval for a hole when is_hole == 1 @start_used: Start of a used interval when is_hole == 0 @last_used: Inclusive end of a used interval when is_hole == 0 @is_hole: 0 == used, 1 == is_hole, -1 == done iteration

This iterator travels over spans in an interval tree. It does not return nodes but classifies each span as either a hole, where no nodes intersect, or a used, which is fully covered by nodes. Each iteration step toggles between hole and used until the entire range is covered. The returned spans always fully cover the requested range.

The iterator is greedy, it always returns the largest hole or used possible, consolidating all consecutive nodes.

Use interval_tree_span_iter_done() to detect end of iteration.

Member Data Documentation

◆ [union]

union { ... } interval_tree_span_iter

◆ [union]

union { ... } interval_tree_span_iter

◆ first_index

unsigned long interval_tree_span_iter::first_index

◆ is_hole

int interval_tree_span_iter::is_hole

◆ last_hole

unsigned long interval_tree_span_iter::last_hole

◆ last_index

unsigned long interval_tree_span_iter::last_index

◆ last_used

unsigned long interval_tree_span_iter::last_used

◆ nodes

struct interval_tree_node* interval_tree_span_iter::nodes[2]

◆ start_hole

unsigned long interval_tree_span_iter::start_hole

◆ start_used

unsigned long interval_tree_span_iter::start_used

The documentation for this struct was generated from the following file: