Go to the documentation of this file.
41 #ifndef __BASE_ADDR_RANGE_MAP_HH__
42 #define __BASE_ADDR_RANGE_MAP_HH__
58 template <
typename V,
int max_cache_size=0>
157 return tree.insert(std::make_pair(
r,
d)).first;
176 for (
auto it =
p; it !=
q; it++) {
255 if (max_cache_size != 0) {
257 if (
cache.size() >= max_cache_size) {
261 auto last =
cache.end();
264 if (max_cache_size > 1)
267 cache.push_front(it);
289 if (
cond(it->first)) {
298 if (next !=
end() &&
cond(next->first)) {
309 if (
cond(
i->first)) {
314 }
while (next !=
begin() &&
315 (--next)->first.mergesWith(
i->first));
337 #endif //__BASE_ADDR_RANGE_MAP_HH__
void erase(iterator p, iterator q)
iterator insert(const AddrRange &r, const V &d)
const_iterator end() const
RangeMap::const_iterator const_iterator
std::list< iterator > cache
A list of iterator that correspond to the max_cache_size most recently used entries in the address ra...
const_iterator contains(Addr r) const
Find entry that contains the given address.
const_iterator begin() const
iterator contains(Addr r)
RangeMap::iterator iterator
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
iterator intersects(const AddrRange &r)
AddrRange RangeSize(Addr start, Addr size)
The AddrRangeMap uses an STL map to implement an interval tree for address decoding.
iterator contains(const AddrRange &r)
const_iterator find(const AddrRange &r, std::function< bool(const AddrRange)> cond) const
std::map< AddrRange, V > RangeMap
void addNewEntryToCache(iterator it) const
Add an address range map entry to the cache.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const_iterator contains(const AddrRange &r) const
Find entry that contains the given address range.
const_iterator intersects(const AddrRange &r) const
Find entry that intersects with the given address range.
iterator find(const AddrRange &r, std::function< bool(const AddrRange)> cond)
Find entry that satisfies a condition on an address range.
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17