- Renamed build script for brief target descriptor generation
- Created new TargetService class - Moved brief target descriptor mapping to new TargetService class - Replaced CMake custom commands with custom targets, for TDF validation and brief target descriptor generation build scripts - Moved BriefTargetDescriptor into separate header file
This commit is contained in:
48
src/Services/TargetService.hpp
Normal file
48
src/Services/TargetService.hpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <functional>
|
||||
|
||||
#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 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
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user