Refactored Insight GUI to accommodate the many changes made to Bloom's internals
Also lots of tidying.
This commit is contained in:
@@ -47,6 +47,18 @@ namespace Targets
|
||||
return std::cref(segmentIt->second);
|
||||
}
|
||||
|
||||
std::optional<
|
||||
std::reference_wrapper<TargetMemorySegmentDescriptor>
|
||||
> TargetAddressSpaceDescriptor::tryGetMemorySegmentDescriptor(const std::string& key) {
|
||||
const auto segmentIt = this->segmentDescriptorsByKey.find(key);
|
||||
|
||||
if (segmentIt == this->segmentDescriptorsByKey.end()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return std::ref(segmentIt->second);
|
||||
}
|
||||
|
||||
const TargetMemorySegmentDescriptor& TargetAddressSpaceDescriptor::getMemorySegmentDescriptor(
|
||||
const std::string& key
|
||||
) const {
|
||||
@@ -61,6 +73,12 @@ namespace Targets
|
||||
return segment->get();
|
||||
}
|
||||
|
||||
TargetMemorySegmentDescriptor& TargetAddressSpaceDescriptor::getMemorySegmentDescriptor(const std::string& key) {
|
||||
return const_cast<TargetMemorySegmentDescriptor&>(
|
||||
const_cast<const TargetAddressSpaceDescriptor*>(this)->getMemorySegmentDescriptor(key)
|
||||
);
|
||||
}
|
||||
|
||||
std::vector<
|
||||
const TargetMemorySegmentDescriptor*
|
||||
> TargetAddressSpaceDescriptor::getIntersectingMemorySegmentDescriptors(
|
||||
|
||||
@@ -63,9 +63,12 @@ namespace Targets
|
||||
* @return
|
||||
* A reference wrapper of the memory segment descriptor, if found. Otherwise, std::nullopt.
|
||||
*/
|
||||
std::optional<std::reference_wrapper<const TargetMemorySegmentDescriptor>> tryGetMemorySegmentDescriptor(
|
||||
const std::string& key
|
||||
) const;
|
||||
[[nodiscard]] std::optional<
|
||||
std::reference_wrapper<const TargetMemorySegmentDescriptor>
|
||||
> tryGetMemorySegmentDescriptor(const std::string& key) const;
|
||||
[[nodiscard]] std::optional<
|
||||
std::reference_wrapper<TargetMemorySegmentDescriptor>
|
||||
> tryGetMemorySegmentDescriptor(const std::string& key);
|
||||
|
||||
/**
|
||||
* Fetches a memory segment descriptor with the given key. If the descriptor doesn't exist, an
|
||||
@@ -77,7 +80,8 @@ namespace Targets
|
||||
* @return
|
||||
* A reference to the memory segment descriptor.
|
||||
*/
|
||||
const TargetMemorySegmentDescriptor& getMemorySegmentDescriptor(const std::string& key) const;
|
||||
[[nodiscard]] const TargetMemorySegmentDescriptor& getMemorySegmentDescriptor(const std::string& key) const;
|
||||
TargetMemorySegmentDescriptor& getMemorySegmentDescriptor(const std::string& key);
|
||||
|
||||
/**
|
||||
* Fetches all memory segments in the address space that intersect with the given address range.
|
||||
@@ -88,7 +92,7 @@ namespace Targets
|
||||
* @return
|
||||
* Pointers to descriptors of all intersecting memory segments.
|
||||
*/
|
||||
std::vector<const TargetMemorySegmentDescriptor*> getIntersectingMemorySegmentDescriptors(
|
||||
[[nodiscard]] std::vector<const TargetMemorySegmentDescriptor*> getIntersectingMemorySegmentDescriptors(
|
||||
const TargetMemoryAddressRange& addressRange
|
||||
) const;
|
||||
|
||||
|
||||
@@ -41,5 +41,5 @@ namespace Targets
|
||||
static TargetPadId generateId(const std::string& padKey);
|
||||
};
|
||||
|
||||
using TargetPadDescriptors = std::vector<TargetPadDescriptor*>;
|
||||
using TargetPadDescriptors = std::vector<const TargetPadDescriptor*>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user