27 bool add(uint32_t addr, uint32_t len,
int idx=-1);
29 bool rem(uint32_t idx);
34 int find(uint32_t addr)
const;
This class represents a memory map.
Definition: addressmap.hh:14
bool add(uint32_t addr, uint32_t len, int idx=-1)
Adds an item to the address map.
Definition: addressmap.cc:29
void clear()
Clears the address map.
Definition: addressmap.cc:24
AddressMap & operator=(const AddressMap &other)
Copy assignment.
Definition: addressmap.cc:17
bool contains(uint32_t addr) const
Returns true if the given address is contained in any of the memory regions.
Definition: addressmap.cc:56
int find(uint32_t addr) const
Finds the index of the memory region containing the given address.
Definition: addressmap.cc:61
bool rem(uint32_t idx)
Removes an item from the address map associated with the given index.
Definition: addressmap.cc:43
std::vector< AddrMapItem > _items
Holds the vector of memory items, the order of these items is maintained.
Definition: addressmap.hh:65
AddressMap()
Empty constructor.
Definition: addressmap.cc:4
Memory map item.
Definition: addressmap.hh:39
AddrMapItem(uint32_t addr, uint32_t len, uint32_t idx)
Constructor.
Definition: addressmap.hh:45
bool operator<(const AddrMapItem &other) const
Comparison operator.
Definition: addressmap.hh:50
uint32_t length
The size/length of the memory item.
Definition: addressmap.hh:41
bool contains(uint32_t addr) const
Returns true if the given address is contained within this memory region.
Definition: addressmap.hh:58
uint32_t address
The start address of the item.
Definition: addressmap.hh:40
bool operator<(uint32_t addr) const
Comparison operator.
Definition: addressmap.hh:54
uint32_t index
The associated (element) index.
Definition: addressmap.hh:42