Rewrite the plugin backend, use smart pointers is possible, don't persist in structs and simplify code

This commit is contained in:
Maschell
2022-05-14 14:00:20 +02:00
parent fb6373ec63
commit cda9c3e055
41 changed files with 790 additions and 1888 deletions

View File

@@ -22,18 +22,11 @@
class SectionInfo {
public:
SectionInfo(std::string &name, uint32_t address, uint32_t sectionSize) : name(name),
address(address),
sectionSize(sectionSize) {
SectionInfo(std::string name, uint32_t address, uint32_t sectionSize) : name(std::move(name)),
address(address),
sectionSize(sectionSize) {
}
SectionInfo() = default;
SectionInfo(const SectionInfo &o2) = default;
virtual ~SectionInfo() = default;
[[nodiscard]] const std::string &getName() const {
return name;
}
@@ -46,6 +39,10 @@ public:
return sectionSize;
}
[[nodiscard]] uint32_t isInSection(uint32_t addr) const {
return addr >= address && addr < address + sectionSize;
}
private:
std::string name;
uint32_t address{};