Files
BloomPatched/src/Services/TargetService.hpp
Nav 6cdbfbe950 Massive refactor to accommodate RISC-V targets
- Refactored entire codebase (excluding the Insight component) to accommodate multiple target architectures (no longer specific to AVR)
- Deleted 'generate SVD' GDB monitor command - I will eventually move this functionality to the Bloom website
- Added unit size property to address spaces
- Many other changes which I couldn't be bothered to describe here
2024-07-23 21:14:22 +01:00

50 lines
1.7 KiB
C++

#pragma once
#include <string>
#include <map>
#include <cstdint>
#include <optional>
#include "src/Targets/BriefTargetDescriptor.hpp"
namespace Services
{
class TargetService
{
public:
/**
* Performs a lookup for the given target configuration value, to retrieve the corresponding brief target
* descriptor object.
*
* @param configValue
* The target configuration value to lookup.
*
* @return
* A BriefTargetDescriptor object, if found, otherwise, std::nullopt.
*/
static std::optional<Targets::BriefTargetDescriptor> briefDescriptor(const std::string& configValue);
/**
* Provides access to the internal mapping of the brief target descriptor objects of all targets supported by
* Bloom. See TargetService::descriptorsByConfigValue for more.
*
* @return
*/
static const std::map<std::string, Targets::BriefTargetDescriptor>& briefDescriptorsByConfigValue();
private:
/**
* This mapping contains brief target descriptor objects for every target supported by Bloom, mapped by their
* configuration value.
*
* The contents of this mapping is generated by a build script and stored in an ASCII text file, located
* at GENERATED_BRIEF_TARGET_DESCRIPTOR_MAPPING_PATH.
*
* See build/scripts/GenerateBriefTargetDescriptors.php and the root CMakeLists.txt for more.
*/
static const inline std::map<std::string, Targets::BriefTargetDescriptor> descriptorsByConfigValue = {
#include GENERATED_BRIEF_TARGET_DESCRIPTOR_MAPPING_PATH
};
};
}