Header menu logo B2R2

NoOverlapIntervalMap Module

Provides functions for creating or manipulating non-overlapping interval maps.

Functions and values

Function or value Description

NoOverlapIntervalMap.add k v tree

Full Usage: NoOverlapIntervalMap.add k v tree

Parameters:
Returns: NoOverlapIntervalMap<'V> A new interval tree.
Type parameters: 'V

Adds a mapping from an interval to the value in the interval tree.

k : AddrRange

AddrRange as a key.

v : 'V

The value to be added.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: NoOverlapIntervalMap<'V>

A new interval tree.

RangeOverlapException Thrown when there is an existing (overlapping) interval in the tree.

NoOverlapIntervalMap.addByBounds min max v tree

Full Usage: NoOverlapIntervalMap.addByBounds min max v tree

Parameters:
    min : Addr - The min value of the interval.
    max : Addr - The max value of the interval.
    v : 'V - The value to be added.
    tree : NoOverlapIntervalMap<'V> - The interval tree.

Returns: NoOverlapIntervalMap<'V> A new interval tree.
Type parameters: 'V

Adds a mapping from an interval to the value in the interval tree, taking separate min and max parameters instead of an AddrRange.

min : Addr

The min value of the interval.

max : Addr

The max value of the interval.

v : 'V

The value to be added.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: NoOverlapIntervalMap<'V>

A new interval tree.

RangeOverlapException Thrown when there is an existing (overlapping) interval in the tree.

NoOverlapIntervalMap.containsAddr addr tree

Full Usage: NoOverlapIntervalMap.containsAddr addr tree

Parameters:
Returns: bool True if the interval tree contains an interval that includes the given address, false otherwise.
Type parameters: 'V

Checks whether a given Addr exists in any of the ranges in the map.

addr : Addr

Address.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: bool

True if the interval tree contains an interval that includes the given address, false otherwise.

NoOverlapIntervalMap.containsRange range tree

Full Usage: NoOverlapIntervalMap.containsRange range tree

Parameters:
Returns: bool True if the interval tree contains the interval, false otherwise.
Type parameters: 'V

Checks whether the exact range exists in the interval map.

range : AddrRange

The address range.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: bool

True if the interval tree contains the interval, false otherwise.

NoOverlapIntervalMap.count tree

Full Usage: NoOverlapIntervalMap.count tree

Parameters:
Returns: int The number of bindings.
Type parameters: 'V

Returns the number of bindings in the interval map.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: int

The number of bindings.

NoOverlapIntervalMap.empty

Full Usage: NoOverlapIntervalMap.empty

Returns: NoOverlapIntervalMap<'V>
Type parameters: 'V

Returns an empty map.

Returns: NoOverlapIntervalMap<'V>

NoOverlapIntervalMap.find range tree

Full Usage: NoOverlapIntervalMap.find range tree

Parameters:
Returns: 'V The value associated with the given interval.
Type parameters: 'V

Finds the mapping that exactly matches with the given range.

range : AddrRange

The address range.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: 'V

The value associated with the given interval.

NoOverlapIntervalMap.findByAddr addr tree

Full Usage: NoOverlapIntervalMap.findByAddr addr tree

Parameters:
Returns: 'V The value associated with the given address.
Type parameters: 'V

Finds the mapping that matches with the given address. Unlike find, this function can return a range that covers the given address.

addr : Addr

The address.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: 'V

The value associated with the given address.

NoOverlapIntervalMap.findOverlaps k tree

Full Usage: NoOverlapIntervalMap.findOverlaps k tree

Parameters:
Returns: (AddrRange * 'V) list A sequence of mappings.
Type parameters: 'V

Returns a sequence of overlapping mappings of the given interval.

k : AddrRange

The key interval.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: (AddrRange * 'V) list

A sequence of mappings.

NoOverlapIntervalMap.findRangeByAddr addr tree

Full Usage: NoOverlapIntervalMap.findRangeByAddr addr tree

Parameters:
Returns: AddrRange The found interval.
Type parameters: 'V

Finds an interval stored in the interval tree map, which includes the given address.

addr : Addr

The address.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: AddrRange

The found interval.

NoOverlapIntervalMap.fold fn acc tree

Full Usage: NoOverlapIntervalMap.fold fn acc tree

Parameters:
Returns: 'b Accumulated value.
Type parameters: 'b, 'V

Folds over the tree.

fn : 'b -> AddrRange -> 'V -> 'b

Folder.

acc : 'b

Accumulator.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: 'b

Accumulated value.

NoOverlapIntervalMap.isEmpty tree

Full Usage: NoOverlapIntervalMap.isEmpty tree

Parameters:
Returns: bool Returns true if the tree is empty, false otherwise.
Type parameters: 'V

Checks if the given interval map is empty.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: bool

Returns true if the tree is empty, false otherwise.

NoOverlapIntervalMap.iter fn tree

Full Usage: NoOverlapIntervalMap.iter fn tree

Parameters:
Type parameters: 'V

Iterates over the tree.

fn : AddrRange -> 'V -> unit

Iterator.

tree : NoOverlapIntervalMap<'V>

The interval tree.

NoOverlapIntervalMap.remove k tree

Full Usage: NoOverlapIntervalMap.remove k tree

Parameters:
Returns: NoOverlapIntervalMap<'V> A new interval tree.
Type parameters: 'V

Removes a mapping that matches exactly with the given range. To remove a mapping that covers the given address, use removeByAddr.

k : AddrRange

The interval to find.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: NoOverlapIntervalMap<'V>

A new interval tree.

NoOverlapIntervalMap.removeByAddr addr tree

Full Usage: NoOverlapIntervalMap.removeByAddr addr tree

Parameters:
Returns: NoOverlapIntervalMap<'V> A new interval tree.
Type parameters: 'V

Removes a mapping that matches with the given address. Unlike remove, this function will remove an interval that includes the given address.

addr : Addr

The address.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: NoOverlapIntervalMap<'V>

A new interval tree.

NoOverlapIntervalMap.replace k v tree

Full Usage: NoOverlapIntervalMap.replace k v tree

Parameters:
Returns: NoOverlapIntervalMap<'V> A new interval tree.
Type parameters: 'V

Replaces the value for an existing range if it exactly matches the given range. If ranges overlap, this function will still raise RangeOverlapException.

k : AddrRange

AddrRange as a key.

v : 'V

The value to be added.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: NoOverlapIntervalMap<'V>

A new interval tree.

NoOverlapIntervalMap.tryFind range tree

Full Usage: NoOverlapIntervalMap.tryFind range tree

Parameters:
Returns: 'V option The value associated with the given interval.
Type parameters: 'V

Finds the mapping that exactly matches with the given range and returns an option-wrapped type.

range : AddrRange

The address range.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: 'V option

The value associated with the given interval.

NoOverlapIntervalMap.tryFindByAddr addr tree

Full Usage: NoOverlapIntervalMap.tryFindByAddr addr tree

Parameters:
Returns: 'V option The value associated with the given address.
Type parameters: 'V

Finds the mapping that matches with the given address and returns an option-wrapped type.

addr : Addr

The address.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: 'V option

The value associated with the given address.

NoOverlapIntervalMap.tryFindRangeByAddr addr tree

Full Usage: NoOverlapIntervalMap.tryFindRangeByAddr addr tree

Parameters:
Returns: AddrRange option The found interval wrapped with option.
Type parameters: 'V

Finds an interval stored in the interval tree map, which includes the given address.

addr : Addr

The address.

tree : NoOverlapIntervalMap<'V>

The interval tree.

Returns: AddrRange option

The found interval wrapped with option.

Type something to start searching.