From b695e09d0720c1c11282c0ab21d792a874daff23 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Wed, 19 Aug 2020 23:05:01 -0700 Subject: [PATCH] base: Tag API methods and variables in addr_range_map.hh Change-Id: I9dc630e7c0d0826a20f032879346da6327b38a2d Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32956 Reviewed-by: Bobby R. Bruce Reviewed-by: Jason Lowe-Power Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/base/addr_range_map.hh | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/base/addr_range_map.hh b/src/base/addr_range_map.hh index d9a098128..57784b440 100644 --- a/src/base/addr_range_map.hh +++ b/src/base/addr_range_map.hh @@ -62,8 +62,13 @@ class AddrRangeMap typedef std::map RangeMap; public: + /** + * @ingroup api_addr_range + * @{ + */ typedef typename RangeMap::iterator iterator; typedef typename RangeMap::const_iterator const_iterator; + /** @} */ // end of api_addr_range /** * Find entry that contains the given address range @@ -74,6 +79,9 @@ class AddrRangeMap * * @param r An input address range * @return An iterator that contains the input address range + * + * @ingroup api_addr_range + * @{ */ const_iterator contains(const AddrRange &r) const @@ -85,6 +93,7 @@ class AddrRangeMap { return find(r, [r](const AddrRange r1) { return r.isSubset(r1); }); } + /** @} */ // end of api_addr_range /** * Find entry that contains the given address @@ -95,6 +104,9 @@ class AddrRangeMap * * @param r An input address * @return An iterator that contains the input address + * + * @ingroup api_addr_range + * @{ */ const_iterator contains(Addr r) const @@ -106,6 +118,7 @@ class AddrRangeMap { return contains(RangeSize(r, 1)); } + /** @} */ // end of api_addr_range /** * Find entry that intersects with the given address range @@ -116,6 +129,9 @@ class AddrRangeMap * * @param r An input address * @return An iterator that intersects with the input address range + * + * @ingroup api_addr_range + * @{ */ const_iterator intersects(const AddrRange &r) const @@ -127,7 +143,11 @@ class AddrRangeMap { return find(r, [r](const AddrRange r1) { return r.intersects(r1); }); } + /** @} */ // end of api_addr_range + /** + * @ingroup api_addr_range + */ iterator insert(const AddrRange &r, const V& d) { @@ -137,6 +157,9 @@ class AddrRangeMap return tree.insert(std::make_pair(r, d)).first; } + /** + * @ingroup api_addr_range + */ void erase(iterator p) { @@ -144,6 +167,9 @@ class AddrRangeMap tree.erase(p); } + /** + * @ingroup api_addr_range + */ void erase(iterator p, iterator q) { @@ -153,6 +179,9 @@ class AddrRangeMap tree.erase(p,q); } + /** + * @ingroup api_addr_range + */ void clear() { @@ -160,36 +189,54 @@ class AddrRangeMap tree.erase(tree.begin(), tree.end()); } + /** + * @ingroup api_addr_range + */ const_iterator begin() const { return tree.begin(); } + /** + * @ingroup api_addr_range + */ iterator begin() { return tree.begin(); } + /** + * @ingroup api_addr_range + */ const_iterator end() const { return tree.end(); } + /** + * @ingroup api_addr_range + */ iterator end() { return tree.end(); } + /** + * @ingroup api_addr_range + */ std::size_t size() const { return tree.size(); } + /** + * @ingroup api_addr_range + */ bool empty() const { -- 2.30.2