Files
BloomPatched/src/Targets/TargetDescriptor.hpp

81 lines
3.0 KiB
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#pragma once
#include <string>
#include <cstdint>
#include <vector>
#include <map>
#include <algorithm>
#include <QMetaType>
2021-04-04 21:04:12 +01:00
#include "TargetFamily.hpp"
2021-10-09 19:17:58 +01:00
#include "TargetMemory.hpp"
#include "TargetAddressSpaceDescriptor.hpp"
#include "TargetPeripheralDescriptor.hpp"
#include "TargetPinoutDescriptor.hpp"
#include "TargetVariantDescriptor.hpp"
2023-09-20 23:37:54 +01:00
#include "TargetBreakpoint.hpp"
2021-04-04 21:04:12 +01:00
namespace Targets
2021-04-04 21:04:12 +01:00
{
struct TargetDescriptor
{
std::string name;
TargetFamily family;
std::string marketId;
2022-08-30 02:51:10 +01:00
std::string vendorName;
std::map<std::string, TargetAddressSpaceDescriptor> addressSpaceDescriptorsByKey;
std::map<std::string, TargetPeripheralDescriptor> peripheralDescriptorsByKey;
std::map<std::string, TargetPinoutDescriptor> pinoutDescriptorsByKey;
std::vector<TargetVariantDescriptor> variantDescriptors;
BreakpointResources breakpointResources;
TargetDescriptor(
2023-09-20 18:56:44 +01:00
const std::string& name,
TargetFamily family,
const std::string& marketId,
2023-09-20 18:56:44 +01:00
const std::string& vendorName,
std::map<std::string, TargetAddressSpaceDescriptor>&& addressSpaceDescriptorsByKey,
std::map<std::string, TargetPeripheralDescriptor>&& peripheralDescriptorsByKey,
std::map<std::string, TargetPinoutDescriptor>&& pinoutDescriptorsByKey,
std::vector<TargetVariantDescriptor>&& variantDescriptors,
const BreakpointResources& breakpointResources
);
TargetDescriptor(const TargetDescriptor& other) = delete;
TargetDescriptor& operator = (const TargetDescriptor& other) = delete;
TargetDescriptor(TargetDescriptor&& other) noexcept = default;
TargetDescriptor& operator = (TargetDescriptor&& other) = default;
std::optional<std::reference_wrapper<const TargetAddressSpaceDescriptor>> tryGetAddressSpaceDescriptor(
const std::string& key
) const;
const TargetAddressSpaceDescriptor& getAddressSpaceDescriptor(const std::string& key) const;
/**
* Returns the descriptor for the first address space that contains the given memory segment.
*
* @param memorySegmentKey
* Key of the memory segment that should be contained within the address space.
*
* @return
*/
const TargetAddressSpaceDescriptor& getFirstAddressSpaceDescriptorContainingMemorySegment(
const std::string& memorySegmentKey
) const;
std::optional<std::reference_wrapper<const TargetPeripheralDescriptor>> tryGetPeripheralDescriptor(
const std::string& key
) const;
const TargetPeripheralDescriptor& getPeripheralDescriptor(const std::string& key) const;
std::optional<std::reference_wrapper<const TargetPinoutDescriptor>> tryGetPinoutDescriptor(
const std::string& key
) const;
const TargetPinoutDescriptor& getPinoutDescriptor(const std::string& key) const;
2021-04-04 21:04:12 +01:00
};
}