Began refactoring target descriptor structs.
This is incomplete - a partial commit of a substantial peice of work
This commit is contained in:
32
src/Targets/TargetPeripheralDescriptor.hpp
Normal file
32
src/Targets/TargetPeripheralDescriptor.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
#include "TargetRegisterGroupDescriptor.hpp"
|
||||
|
||||
namespace Targets
|
||||
{
|
||||
struct TargetPeripheralDescriptor
|
||||
{
|
||||
public:
|
||||
std::string key;
|
||||
std::string name;
|
||||
std::map<std::string, TargetRegisterGroupDescriptor, std::less<void>> registerGroupDescriptorsByKey;
|
||||
|
||||
TargetPeripheralDescriptor(
|
||||
const std::string& key,
|
||||
const std::string& name,
|
||||
const std::map<std::string, TargetRegisterGroupDescriptor, std::less<void>>& registerGroupDescriptorsByKey
|
||||
);
|
||||
|
||||
std::optional<std::reference_wrapper<const TargetRegisterGroupDescriptor>> tryGetRegisterGroupDescriptor(
|
||||
std::string_view keyStr
|
||||
) const;
|
||||
|
||||
const TargetRegisterGroupDescriptor& getRegisterGroupDescriptor(std::string_view key) const;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user