My Project
|
A disjoint set of Ranges, possibly across multiple address spaces. More...
#include <address.hh>
Public Member Functions | |
RangeList (const RangeList &op2) | |
Copy constructor. | |
RangeList (void) | |
Construct an empty container. | |
void | clear (void) |
Clear this container to empty. | |
bool | empty (void) const |
Return true if this is empty. | |
set< Range >::const_iterator | begin (void) const |
Get iterator to beginning Range. | |
set< Range >::const_iterator | end (void) const |
Get iterator to ending Range. | |
int4 | numRanges (void) const |
Return the number of Range objects in container. | |
const Range * | getFirstRange (void) const |
Get the first Range. More... | |
const Range * | getLastRange (void) const |
Get the last Range. More... | |
const Range * | getLastSignedRange (AddrSpace *spaceid) const |
Get the last Range viewing offsets as signed. More... | |
const Range * | getRange (AddrSpace *spaceid, uintb offset) const |
Get Range containing the given byte. More... | |
void | insertRange (AddrSpace *spc, uintb first, uintb last) |
Insert a range of addresses. More... | |
void | removeRange (AddrSpace *spc, uintb first, uintb last) |
Remove a range of addresses. More... | |
void | merge (const RangeList &op2) |
Merge another RangeList into this. | |
bool | inRange (const Address &addr, int4 size) const |
Check containment an address range. More... | |
uintb | longestFit (const Address &addr, uintb maxsize) const |
Find size of biggest Range containing given address. More... | |
void | printBounds (ostream &s) const |
Print a description of this RangeList to stream. More... | |
void | saveXml (ostream &s) const |
Write this RangeList to an XML stream. More... | |
void | restoreXml (const Element *el, const AddrSpaceManager *manage) |
Restore this RangeList from an XML stream. More... | |
A disjoint set of Ranges, possibly across multiple address spaces.
This is a container for addresses. It maintains a disjoint list of Ranges that cover all the addresses in the container. Ranges can be inserted and removed, but overlapping/adjacent ranges will get merged.
const Range * RangeList::getFirstRange | ( | void | ) | const |
Get the first Range.
const Range * RangeList::getLastRange | ( | void | ) | const |
Get the last Range.
bool RangeList::inRange | ( | const Address & | addr, |
int4 | size | ||
) | const |
void RangeList::insertRange | ( | AddrSpace * | spc, |
uintb | first, | ||
uintb | last | ||
) |
Insert a range of addresses.
Insert a new Range merging as appropriate to maintain the disjoint cover
spc | is the address space containing the new range |
first | is the offset of the first byte in the new range |
last | is the offset of the last byte in the new range |
uintb RangeList::longestFit | ( | const Address & | addr, |
uintb | maxsize | ||
) | const |
Find size of biggest Range containing given address.
Return the size of the biggest contiguous sequence of addresses in this RangeList which contain the given address
addr | is the given address |
maxsize | is the large range to consider before giving up |
void RangeList::printBounds | ( | ostream & | s | ) | const |
void RangeList::removeRange | ( | AddrSpace * | spc, |
uintb | first, | ||
uintb | last | ||
) |
Remove a range of addresses.
Remove/narrow/split existing Range objects to eliminate the indicated addresses while still maintaining a disjoint cover.
spc | is the address space of the address range to remove |
first | is the offset of the first byte of the range |
last | is the offset of the last byte of the range |
void RangeList::restoreXml | ( | const Element * | el, |
const AddrSpaceManager * | manage | ||
) |
void RangeList::saveXml | ( | ostream & | s | ) | const |
Write this RangeList to an XML stream.
Serialize this object to an XML <rangelist> tag
s | is the output stream |