2022-03-31 21:20:41 +00:00
|
|
|
#include "addressspace.h"
|
|
|
|
|
|
|
|
namespace domain {
|
|
|
|
|
|
|
|
AddressSpace::AddressSpace(std::string name, long long start, long long end):
|
|
|
|
name(name), start(start), end(end)
|
|
|
|
{}
|
|
|
|
|
|
|
|
std::string AddressSpace::getName() {
|
|
|
|
return name;
|
|
|
|
}
|
2022-04-24 20:21:45 +00:00
|
|
|
long long AddressSpace::getStart() const {
|
2022-03-31 21:20:41 +00:00
|
|
|
return start;
|
|
|
|
}
|
2022-04-24 20:21:45 +00:00
|
|
|
long long AddressSpace::getEnd() const {
|
2022-03-31 21:20:41 +00:00
|
|
|
return end;
|
|
|
|
}
|
|
|
|
|
2022-04-10 12:23:18 +00:00
|
|
|
bool AddressSpace::contains(long long int address) {
|
|
|
|
return address >= start && address < end;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool AddressSpace::contains(long long int pstart, long long int pend) {
|
|
|
|
return pstart >= start && pend < end;
|
|
|
|
}
|
|
|
|
|
2022-03-31 21:20:41 +00:00
|
|
|
} // namespace domain
|