A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
BaseEvent.cpp
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
4
5UBaseEvent::UBaseEvent() : Executor(nullptr)
6{
7 Guid = FGuid::NewGuid();
8}
9
11{
12 Executor = NewExecutor;
13}
14
19
21{
22 if (IsValidLowLevelFast())
23 {
24 if (0 == ListenersNum++)
25 {
26 AddToRoot();
27 }
28 return true;
29 }
30
31 UE_LOG(LogTemp, Warning, TEXT("[UBaseEvent::Lock] Trying to acquire invalid Event."));
32
33 return false;
34}
35
37{
38 if (IsValidLowLevelFast())
39 {
40 if (0 == --ListenersNum)
41 {
42 RemoveFromRoot();
43 }
44 return;
45 }
46 if (ListenersNum > 0)
47 {
48 UE_LOG(LogTemp, Error, TEXT("[UBaseEvent::Unlock] Event has been invalidated while beying acquired."));
49 }
50}
virtual void Unlock() final
Definition BaseEvent.cpp:36
virtual bool Lock() final
Definition BaseEvent.cpp:20
APlayerController * GetExecutor() const
Definition BaseEvent.cpp:15
TAtomic< int32 > ListenersNum
Definition BaseEvent.h:112
FGuid Guid
Definition BaseEvent.h:110
APlayerController * Executor
UPROPERTY()
Definition BaseEvent.h:109
void Initialize(APlayerController *NewExecutor)
Definition BaseEvent.cpp:10