Navigation
API > API/Plugins > API/Plugins/SlateInspectorToolset
Manages bidirectional mapping between SWidget instances and short reference strings used by the SlateInspectorToolset snapshot and action tools.Observer model (append-only)
When observers are active, refs are never reset. New widgets encountered during observer ticks receive the next available counter value for their role prefix. Existing widgets keep their refs indefinitely (the same SWidget pointer always maps to the same ref string). Destroyed widgets are cleaned up periodically via PurgeExpired().
Refs are no longer dense after widgets are destroyed (you may see b1, b3, b7 instead of b1, b2, b3), but keeping refs alive for existing widgets matters more than compactness.
Reset() is available for callers that need to clear the cache entirely and start fresh (e.g. testing).
| Name | FSlateInspectorToolsetRefCache |
| Type | class |
| Header File | /Engine/Plugins/Experimental/Toolsets/SlateInspectorToolset/Source/SlateInspectorToolset/Public/SlateInspectorToolsetRefCache.h |
| Include Path | #include "SlateInspectorToolsetRefCache.h" |
Syntax
class FSlateInspectorToolsetRefCache
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| RefToWidget | TMap< FString, TWeakPtr< SWidget > > | Ref string -> widget (reverse lookup for action tools). | SlateInspectorToolsetRefCache.h | |
| RolePrefixCounters | TMap< FString, int32 > | Per-role-prefix counters for generating sequential ref numbers. | SlateInspectorToolsetRefCache.h | |
| WidgetToRef | TMap< TWeakPtr< SWidget >, FString > | Widget -> ref string (deduplication within a single snapshot pass). | SlateInspectorToolsetRefCache.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FString FindRef
(
TSharedRef< SWidget > Widget |
Looks up the ref for a widget without assigning one. | SlateInspectorToolsetRefCache.h | |
FString GetOrAssignRef
(
TSharedRef< SWidget > Widget, |
Returns existing ref or assigns a new one using the role prefix. | SlateInspectorToolsetRefCache.h | |
void PurgeExpired () |
Removes entries whose widget has been destroyed (weak pointer expired). | SlateInspectorToolsetRefCache.h | |
void Reset () |
Clears all mappings and resets counters to zero. | SlateInspectorToolsetRefCache.h | |
TSharedPtr< SWidget > ResolveRef
(
const FString& Ref |
Resolves a ref string back to a live widget. | SlateInspectorToolsetRefCache.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FSlateInspectorToolsetRefCache & Get() |
SlateInspectorToolsetRefCache.h |