ROSE 0.11.145.147
rose_extent.h
1#ifndef ROSE_Extent_H
2#define ROSE_Extent_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/BinaryAnalysis/Address.h>
7#include <Rose/BinaryAnalysis/AddressInterval.h>
8#include <Rose/BinaryAnalysis/AddressIntervalSet.h>
9
10#include <rangemap.h> // rose
11
12#include <string>
13#include <stdio.h>
14
15// Deprecated. Use Rose::BinaryAnalysis::AddressInterval for all new code.
17
18// Deprecated. Use Rose::BinaryAnalysis::AddressIntervalSet instead for all new code.
19class ExtentMap: public RangeMap<Extent> {
20public:
22 template<class Other> ExtentMap(const Other &other): RangeMap<Extent>(other) {}
23 static char category(const Extent &a, const Extent &b);
24 ExtentMap subtract_from(const Extent &e) const {
25 return invert_within<ExtentMap>(e);
26 }
27 void allocate_at(const Extent &request);
28 Extent allocate_best_fit(const rose_addr_t size);
29 Extent allocate_first_fit(const rose_addr_t size);
30 void dump_extents(std::ostream&, const std::string &prefix="", const std::string &label="") const;
31 void dump_extents(FILE *f, const char *prefix, const char *label, bool pad=true) const;
32};
33
34// deprecated. Conversion functions, to be deleted when the old types are no longer needed.
36Rose::BinaryAnalysis::AddressInterval toAddressInterval(const Extent&);
38Rose::BinaryAnalysis::AddressIntervalSet toAddressIntervalSet(const ExtentMap&);
39
40#endif
41#endif
A container of ranges, somewhat like a set.
Definition rangemap.h:848
Range::Value size() const
Returns the number of values represented by this RangeMap.
Definition rangemap.h:1068
A contiguous range of values.
Definition rangemap.h:50