Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ScopedEvent.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#
pragma
once
4
5
#
include
"CoreTypes.h"
6
#
include
"HAL/Event.h"
7
8
/**
9
* This class is allows a simple one-shot scoped event.
10
*
11
* Usage:
12
* {
13
* FScopedEvent MyEvent;
14
* SendReferenceOrPointerToSomeOtherThread(&MyEvent); // Other thread calls MyEvent->Trigger();
15
* // MyEvent destructor is here, we wait here.
16
* }
17
*/
18
class
FScopedEvent
19
{
20
public
:
21
22
/** Default constructor. */
23
FScopedEvent
();
24
25
/** Destructor. */
26
~
FScopedEvent
();
27
28
/** Triggers the event. */
29
void
Trigger
()
30
{
31
Event
->
Trigger
(
)
;
32
}
33
34
/**
35
* Checks if the event has been triggered (used for special early out cases of scope event)
36
* if this returns true once it will return true forever
37
*
38
* @return returns true if the scoped event has been triggered once
39
*/
40
bool
IsReady
();
41
42
/**
43
* Retrieve the event, usually for passing around.
44
*
45
* @return The event.
46
*/
47
FEvent
*
Get
()
48
{
49
return
Event
;
50
}
51
52
private
:
53
54
/** Holds the event. */
55
FEvent
*
Event
;
56
};
FEvent
Definition
Event.h:21
FEvent::Trigger
virtual void Trigger()=0
FScopedEvent
Definition
ScopedEvent.h:19
FScopedEvent::IsReady
bool IsReady()
FScopedEvent::~FScopedEvent
~FScopedEvent()
FScopedEvent::Trigger
void Trigger()
Definition
ScopedEvent.h:29
FScopedEvent::Get
FEvent * Get()
Definition
ScopedEvent.h:47
FScopedEvent::FScopedEvent
FScopedEvent()
FScopedEvent::Event
FEvent * Event
Definition
ScopedEvent.h:55
Downloads
ArkServerAPI_NEW
ASA
AsaApi
AsaApi
Core
Public
API
UE
Misc
ScopedEvent.h
Generated by
1.10.0