UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IPv4Subnet.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "CoreMinimal.h"
7#include "HAL/Platform.h"
12#include "Templates/TypeHash.h"
13
20{
23
26
27public:
28
31
42
43public:
44
51 bool operator==(const FIPv4Subnet& Other) const
52 {
53 return ((Address == Other.Address) && (Mask == Other.Mask));
54 }
55
62 bool operator!=(const FIPv4Subnet& Other) const
63 {
64 return ((Address != Other.Address) || (Mask != Other.Mask));
65 }
66
75 {
76 return Ar << Subnet.Address << Subnet.Mask;
77 }
78
79public:
80
87 {
88 return (Address | ~Mask);
89 }
90
98 {
99 return ((Address & Mask) == (TestAddress & Mask));
100 }
101
108 NETWORKING_API FString ToString() const;
109
116 FText ToText() const
117 {
118 return FText::FromString(ToString());
119 }
120
121public:
122
130 {
131 return HashCombine(GetTypeHash(Subnet.Address), GetTypeHash(Subnet.Mask));
132 }
133
134public:
135
144 static NETWORKING_API bool Parse(const FString& SubnetString, FIPv4Subnet& OutSubnet);
145};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition Text.h:385
static CORE_API FText FromString(const ANSICHAR *String)
Definition Text.cpp:1081
Definition IPv4Address.h:16
Definition IPv4SubnetMask.h:38
Definition IPv4Subnet.h:20
FIPv4SubnetMask Mask
Definition IPv4Subnet.h:25
FIPv4Address BroadcastAddress() const
Definition IPv4Subnet.h:86
bool operator==(const FIPv4Subnet &Other) const
Definition IPv4Subnet.h:51
FText ToText() const
Definition IPv4Subnet.h:116
bool operator!=(const FIPv4Subnet &Other) const
Definition IPv4Subnet.h:62
bool ContainsAddress(const FIPv4Address &TestAddress)
Definition IPv4Subnet.h:97
static NETWORKING_API bool Parse(const FString &SubnetString, FIPv4Subnet &OutSubnet)
Definition IPv4Subnet.cpp:18
friend uint32 GetTypeHash(const FIPv4Subnet &Subnet)
Definition IPv4Subnet.h:129
friend FArchive & operator<<(FArchive &Ar, FIPv4Subnet &Subnet)
Definition IPv4Subnet.h:74
NETWORKING_API FString ToString() const
Definition IPv4Subnet.cpp:9
FIPv4Subnet()
Definition IPv4Subnet.h:30
FIPv4Subnet(const FIPv4Address &InAddress, const FIPv4SubnetMask &InMask)
Definition IPv4Subnet.h:38
FIPv4Address Address
Definition IPv4Subnet.h:22