From ffb6aec603c38e16ae91ea975c16fc3e8fb337e5 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Wed, 19 Sep 2012 06:15:44 -0400 Subject: AddrRange: Transition from Range to AddrRange This patch takes the final plunge and transitions from the templated Range class to the more specific AddrRange. In doing so it changes the obvious Range to AddrRange, and also bumps the range_map to be AddrRangeMap. In addition to the obvious changes, including the removal of redundant includes, this patch also does some house keeping in preparing for the introduction of address interleaving support in the ranges. The Range class is also stripped of all the functionality that is never used. --HG-- rename : src/base/range.hh => src/base/addr_range.hh rename : src/base/range_map.hh => src/base/addr_range_map.hh --- src/unittest/rangemaptest.cc | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'src/unittest') diff --git a/src/unittest/rangemaptest.cc b/src/unittest/rangemaptest.cc index af00e4e58..57b954b0a 100644 --- a/src/unittest/rangemaptest.cc +++ b/src/unittest/rangemaptest.cc @@ -1,4 +1,16 @@ /* + * Copyright (c) 2012 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2006 The Regents of The University of Michigan * All rights reserved. * @@ -31,46 +43,38 @@ #include #include -#include "base/range_map.hh" -#include "base/types.hh" +#include "base/addr_range_map.hh" using namespace std; int main() { - range_map r; + AddrRangeMap r; - range_map::iterator i; + AddrRangeMap::iterator i; - i = r.insert(RangeIn(10,40),5); + i = r.insert(RangeIn(10, 40), 5); assert(i != r.end()); - i = r.insert(RangeIn(60,90),3); + i = r.insert(RangeIn(60, 90), 3); assert(i != r.end()); - i = r.find(RangeIn(20,30)); + i = r.find(RangeIn(20, 30)); assert(i != r.end()); cout << i->first << " " << i->second << endl; - i = r.find(RangeIn(55,55)); + i = r.find(RangeIn(55, 55)); assert(i == r.end()); - i = r.insert(RangeIn(0,12),1); + i = r.insert(RangeIn(0, 12), 1); assert(i == r.end()); - i = r.insert(RangeIn(0,9),1); + i = r.insert(RangeIn(0, 9), 1); assert(i != r.end()); - i = r.find(RangeIn(20,30)); + i = r.find(RangeIn(20, 30)); assert(i != r.end()); cout << i->first << " " << i->second << endl; + return 0; } - - - - - - - - -- cgit v1.2.3