UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Util.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
#pragma once
3
4
#include "
Core/Types.h
"
5
6
#include "
Math/Boundary.h
"
7
#include "
Utils/IndexOfCoordinateFinder.h
"
8
9
namespace
UE::CADKernel
10
{
11
namespace
Utils
12
{
13
template
<
typename
SRC,
typename
DST>
14
inline
void
TSharedPtrArrayConversion
(
const
TArray
<
TSharedPtr<SRC>
>& Source,
TArray
<
TSharedPtr<DST>
>& Destination)
15
{
16
Destination.Reserve(Destination.Num() + Source.Num());
17
for
(
const
TSharedPtr<SRC>
&
SourceItem
: Source)
18
{
19
Destination.Add(
StaticCastSharedPtr<DST>
(
SourceItem
));
20
}
21
}
22
23
template
<
typename
SRC,
typename
DST>
24
inline
void
TSharedPtrArrayConversionChecked
(
const
TArray
<
TSharedPtr<SRC>
>& Source,
TArray
<
TSharedPtr<DST>
>& Destination)
25
{
26
Destination.Reserve(Destination.Num() + Source.Num());
27
for
(
const
TSharedPtr<SRC>
&
SourceItem
: Source)
28
{
29
TSharedPtr<DST>
ConvertedPtr
=
StaticCastSharedPtr<DST>
(
SourceItem
);
30
if
(!
ConvertedPtr
.IsValid())
31
{
32
continue
;
33
}
34
Destination.Add(
ConvertedPtr
);
35
}
36
37
}
38
};
39
}
Boundary.h
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
Types.h
IndexOfCoordinateFinder.h
TArray
Definition
Array.h:670
TSharedPtr
Definition
SharedPointer.h:692
UE::CADKernel::Utils::TSharedPtrArrayConversion
void TSharedPtrArrayConversion(const TArray< TSharedPtr< SRC > > &Source, TArray< TSharedPtr< DST > > &Destination)
Definition
Util.h:14
UE::CADKernel::Utils::TSharedPtrArrayConversionChecked
void TSharedPtrArrayConversionChecked(const TArray< TSharedPtr< SRC > > &Source, TArray< TSharedPtr< DST > > &Destination)
Definition
Util.h:24
UE::CADKernel
Definition
CADEntity.cpp:23
Engine
Source
Runtime
Datasmith
CADKernel
Base
Private
Utils
Util.h
Generated by
1.9.8