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 */
19{
20public:
21
22 /** Default constructor. */
24
25 /** Destructor. */
27
28 /** Triggers the event. */
29 void Trigger()
30 {
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 */
48 {
49 return Event;
50 }
51
52private:
53
54 /** Holds the event. */
56};
Definition Event.h:21
virtual void Trigger()=0
bool IsReady()
void Trigger()
Definition ScopedEvent.h:29
FEvent * Get()
Definition ScopedEvent.h:47
FEvent * Event
Definition ScopedEvent.h:55