class documentation

class MemoryRangeSet(_Generic[_address.AddressType]):

View In Hierarchy

A set of non-overlapping MemoryRange.

On addition, ranges that would overlap with the inserted value are merged with the inserted value.

Method __init__ Creates a new set.
Method __iter__ Iterates on the memory ranges in the set.
Method __len__ Returns the number of ranges in the set.
Method add Adds the passed memory range to the set.
Method remove Removes the passed memory range from the set.
Instance Variable _map Undocumented
def __init__(self, items=()):

Creates a new set.

Information

Parameters
items:_Iterable[MemoryRange[_address.AddressType]]An iterator over the ranges initially present in the set. Overlapping ranges will be merged upon addition.
def __iter__(self):

Iterates on the memory ranges in the set.

Returns
_Iterator[MemoryRange[_address.AddressType]]Undocumented
def __len__(self):

Returns the number of ranges in the set.

Returns
intUndocumented
def add(self, memory_range):

Adds the passed memory range to the set.

The passed memory range can overlap with existing ranges in the set. In that case, the ranges will be merged.

Parameters
memory_range:_Union[_address.AddressType, MemoryRange[_address.AddressType]]Undocumented
def remove(self, memory_range):

Removes the passed memory range from the set.

This will remove the intersection between the passed memory range and any range that overlaps with it.

Parameters
memory_range:_Union[_address.AddressType, MemoryRange[_address.AddressType]]Undocumented
_map =

Undocumented