UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConnectionHandle.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "HAL/Platform.h"
7
8namespace UE::Net
9{
10
17{
18public:
20 inline FConnectionHandle() = default;
23
24 bool operator==(const FConnectionHandle& Other) const;
25
27 bool IsValid() const;
29 bool IsParentConnection() const;
31 bool IsChildConnection() const;
32
37
38private:
40
41 uint32 ParentConnectionId = 0;
42 // For a valid handle a ChildConnectionId of zero indicates it's the parent connection itself.
43 uint32 ChildConnectionId = 0;
44};
45
47: ParentConnectionId(InParentConnectionId)
48, ChildConnectionId(0)
49{
50}
51
57
59{
60 return ParentConnectionId == Other.ParentConnectionId && ChildConnectionId == Other.ChildConnectionId;
61}
62
63inline bool FConnectionHandle::IsValid() const
64{
65 return ParentConnectionId > 0U;
66}
67
69{
70 return IsValid() && ChildConnectionId == 0U;
71}
72
74{
75 return IsValid() && ChildConnectionId != 0U;
76}
77
79{
80 return ParentConnectionId;
81}
82
84{
85 return IsValid() ? ChildConnectionId : 0U;
86}
87
89{
90 return ::GetTypeHash((uint64(Handle.ParentConnectionId) << 32U) | uint64(Handle.ChildConnectionId));
91}
92
93}
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ConnectionHandle.h:17
bool operator==(const FConnectionHandle &Other) const
Definition ConnectionHandle.h:58
uint32 GetParentConnectionId() const
Definition ConnectionHandle.h:78
bool IsParentConnection() const
Definition ConnectionHandle.h:68
friend uint32 GetTypeHash(const FConnectionHandle &Handle)
Definition ConnectionHandle.h:88
bool IsValid() const
Definition ConnectionHandle.h:63
bool IsChildConnection() const
Definition ConnectionHandle.h:73
uint32 GetChildConnectionId() const
Definition ConnectionHandle.h:83
Definition NetworkVersion.cpp:28
uint32 GetTypeHash(const FNetIDVariant &NetID)
Definition NetIDVariant.h:55