-
Notifications
You must be signed in to change notification settings - Fork 0
FGMPKey
Identity of one listener registration, and the carrier of its ordering.
Declared in Plugins/GMP/Source/GMP/GMP/GMPKey.h:52
USTRUCT()
struct FGMPKey
{
GENERATED_BODY()
public:
FGMPKey(int64 In = 0) : Key(In) {}
UPROPERTY()
int64 Key;
FORCEINLINE auto GetKey() const { return Key; }
FORCEINLINE bool IsValid() const { return !!Key; }
operator int64() const { return Key; }
explicit operator bool() const { return IsValid(); }
GMP_API static FGMPKey NextGMPKey();
GMP_API static FGMPKey NextGMPKey(GMP::FGMPListenOptions Options);
};Every ListenMessage returns one. Two uses:
-
Unregister a single listener —
UnListenMessage(FMSGKEYFind(...), Key). Without the key you can only unregister all of an owner's listeners. -
Ordering — the
OrderfromFGMPListenOptionsis encoded into the high bits byNextGMPKey(Options).

Sorting listeners by FGMPKey sorts them by Order first and by creation sequence second, because the low
bits are a monotonically increasing counter. That gives two properties for free:
- lower
Orderruns first -
equal
Orderkeeps registration order, since the counter breaks the tie
No separate ordering structure is maintained, and the pre-fire sort is a plain integer sort.
0 is the invalid key; IsValid() and explicit operator bool() both test that. A failed registration
returns an invalid key rather than throwing, so a caller that cares must check.
The implicit operator int64() makes the value easy to log and compare, but also means an unchecked key
converts silently to 0 in arithmetic contexts — prefer IsValid() to !Key in code others will read.
GMP · Reference wiki — one page per named thing. Guided introduction: project site · 中文站点 · measured dispatch stack Source: repository · README · README 中文
Pages here are generated from wiki/ in the main repository — edit there, not on the wiki.
Concepts
- Why a string key
- Dispatch layers
- Parameter compatibility
- Signature inference
- Key baking
- Transparent rewrite
- Jump tracing
Sending and listening
- NotifyMessage family
- ListenMessage family
- StoreObjectMessage
- MSGKEY
- FSigSource
- FSigHandle
- FGMPKey
- FGMPResponder
Dispatch internals
Reflection and data
Editor
Build