MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
DummyDynamicDelegates.h
Go to the documentation of this file.
1/** @noop License Comment
2 * @file
3 * @copyright
4 * This Source Code is subject to the terms of the Mozilla Public License, v2.0.
5 * If a copy of the MPL was not distributed with this file You can obtain one at
6 * https://mozilla.org/MPL/2.0/
7 *
8 * @author David Mórász
9 * @date 2025
10*/
11
12#pragma once
13
14#include "CoreMinimal.h"
15#include "Mcro/Common.h"
16
17#include "DummyDynamicDelegates.generated.h"
18
19using FTestDelegateWithArray = TDelegate<int32(TArray<FString>&)>;
20
21DECLARE_DYNAMIC_DELEGATE_OneParam(FTestDynamicDelegate, int32, Argument);
22DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(int32, FTestDynamicDelegateRetVal, int32, Argument);
23DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FTestDynamicMulticastDelegate, int32, Argument);
24
25DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMultiplexed, FString const&, argument);
26MCRO_DYNAMIC_RETURN(FOnMultiplexed, int32);
27
28UCLASS()
29class UDynamicDelegateTestClass : public UObject
30{
31 GENERATED_BODY()
32
33public:
34 void Initialize();
35
36 TArray<FString> TestResult;
37
38 UPROPERTY()
39 FTestDynamicDelegate DynamicDelegate;
40 TDelegate<void(int32)> ResultDynamicDelegate;
41
42 UPROPERTY()
43 FTestDynamicDelegateRetVal DynamicDelegateRetVal;
44 TDelegate<int32(int32)> ResultDynamicDelegateRetVal;
45
46 UPROPERTY()
47 FTestDynamicMulticastDelegate Event;
48 TMulticastDelegate<void(int32)> ResultEvent;
49
50 UFUNCTION()
51 void DynamicDelegateBinding(int32 argument);
52
53 UFUNCTION()
54 int32 DynamicDelegateRetValBinding(int32 argument);
55
56 UFUNCTION()
57 void OnEventTriggered(int32 argument);
58
59 UFUNCTION()
60 int32 OnMultiplexed(FString const& argument);
61
62 UPROPERTY()
63 FOnMultiplexed OnMultiplexedEvent;
64
66};
This header is a central include for all common utilities MCRO offers including higher level features...
TDelegate< int32(TArray< FString > &)> FTestDelegateWithArray
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FTestDynamicMulticastDelegate, int32, Argument)
DECLARE_DYNAMIC_DELEGATE_OneParam(FTestDynamicDelegate, int32, Argument)
DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(int32, FTestDynamicDelegateRetVal, int32, Argument)
#define MCRO_DYNAMIC_EVENT_MULTIPLEX(functionName)
Glue together a regular function, a native event delegate and a dynamic multicast delegate,...
#define MCRO_DYNAMIC_RETURN(delegate, type)