v1.2.26
Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
BaseEvent.cpp
Go to the documentation of this file.
1
// Copyright(c) Pixo Group. All Rights Reserved.
2
3
#include "
EventSystem/Events/BaseEvent.h
"
4
5
UBaseEvent::UBaseEvent
() : Executor(nullptr)
6
{
7
Guid
= FGuid::NewGuid();
8
}
9
10
void
UBaseEvent::Initialize
(APlayerController* NewExecutor)
11
{
12
Executor
= NewExecutor;
13
}
14
15
APlayerController*
UBaseEvent::GetExecutor
()
const
16
{
17
return
Executor
;
18
}
19
20
bool
UBaseEvent::Lock
()
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
36
void
UBaseEvent::Unlock
()
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
}
BaseEvent.h
UBaseEvent::Unlock
virtual void Unlock() final
Definition
BaseEvent.cpp:36
UBaseEvent::Lock
virtual bool Lock() final
Definition
BaseEvent.cpp:20
UBaseEvent::GetExecutor
APlayerController * GetExecutor() const
Definition
BaseEvent.cpp:15
UBaseEvent::ListenersNum
TAtomic< int32 > ListenersNum
Definition
BaseEvent.h:112
UBaseEvent::Guid
FGuid Guid
Definition
BaseEvent.h:110
UBaseEvent::UBaseEvent
UBaseEvent()
Definition
BaseEvent.cpp:5
UBaseEvent::Executor
APlayerController * Executor
UPROPERTY()
Definition
BaseEvent.h:109
UBaseEvent::Initialize
void Initialize(APlayerController *NewExecutor)
Definition
BaseEvent.cpp:10
PixoCore
Source
PixoCore
Private
EventSystem
Events
BaseEvent.cpp
Generated
Wed Oct 9 2024 19:40:16
by Doxygen version
1.10.0