2020-05-17 13:13:24 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright (C) 2019 Maschell
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2021-09-18 11:55:01 +02:00
|
|
|
#include <utility>
|
2020-05-17 13:13:24 +02:00
|
|
|
|
|
|
|
class SectionInfo {
|
|
|
|
|
|
|
|
public:
|
|
|
|
SectionInfo(std::string name, uint32_t address, uint32_t sectionSize) :
|
2021-09-18 11:55:01 +02:00
|
|
|
name(std::move(name)),
|
2020-05-17 13:13:24 +02:00
|
|
|
address(address),
|
|
|
|
sectionSize(sectionSize) {
|
|
|
|
}
|
|
|
|
|
2021-09-18 11:55:01 +02:00
|
|
|
SectionInfo() = default;
|
2020-05-17 13:13:24 +02:00
|
|
|
|
|
|
|
SectionInfo(const SectionInfo &o2) :
|
|
|
|
name(o2.name),
|
|
|
|
address(o2.address),
|
|
|
|
sectionSize(o2.sectionSize) {
|
|
|
|
}
|
|
|
|
|
2021-09-23 18:38:29 +02:00
|
|
|
SectionInfo &operator=(const SectionInfo &other) = default;
|
2020-06-25 19:11:31 +02:00
|
|
|
|
2020-05-17 13:13:24 +02:00
|
|
|
|
2021-09-18 11:55:01 +02:00
|
|
|
virtual ~SectionInfo() = default;
|
2020-05-17 13:13:24 +02:00
|
|
|
|
2021-09-18 11:55:01 +02:00
|
|
|
[[nodiscard]] const std::string &getName() const {
|
2020-05-17 13:13:24 +02:00
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2021-09-18 11:55:01 +02:00
|
|
|
[[nodiscard]] uint32_t getAddress() const {
|
2020-05-17 13:13:24 +02:00
|
|
|
return address;
|
|
|
|
}
|
|
|
|
|
2021-09-18 11:55:01 +02:00
|
|
|
[[nodiscard]] uint32_t getSize() const {
|
2020-05-17 13:13:24 +02:00
|
|
|
return sectionSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string name;
|
2021-09-18 11:55:01 +02:00
|
|
|
uint32_t address{};
|
|
|
|
uint32_t sectionSize{};
|
2020-05-17 13:13:24 +02:00
|
|
|
};
|