Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
PlatformFileManager.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreFwd.h"
6#include "CoreTypes.h"
7#include "Templates/Atomic.h"
8
9#ifndef USE_ATOMIC_PLATFORM_FILE
10 #define USE_ATOMIC_PLATFORM_FILE (WITH_EDITOR)
11#endif
12
13/**
14* Platform File chain manager.
15**/
17{
19 /** Currently used platform file. */
21#else
22 /** Currently used platform file. */
24#endif
25
26public:
27
28 /** Constructor. */
30
31 /**
32 * Gets the currently used platform file.
33 *
34 * @return Reference to the currently used platform file.
35 */
37
38 /**
39 * Sets the current platform file.
40 *
41 * @param NewTopmostPlatformFile Platform file to be used.
42 */
43 void SetPlatformFile( IPlatformFile& NewTopmostPlatformFile );
44
45 /**
46 * Finds a platform file in the chain of active platform files.
47 *
48 * @param Name of the platform file.
49 * @return Pointer to the active platform file or nullptr if the platform file was not found.
50 */
51 IPlatformFile* FindPlatformFile( const TCHAR* Name );
52
53 /**
54 * Creates a new platform file instance.
55 *
56 * @param Name of the platform file to create.
57 * @return Platform file instance of the platform file type was found, nullptr otherwise.
58 */
59 IPlatformFile* GetPlatformFile( const TCHAR* Name );
60
61 /**
62 * calls Tick on the platform files in the TopmostPlatformFile chain
63 */
65
66 /**
67 * Performs additional initialization when the new async IO is enabled.
68 */
70
71 /**
72 * Gets FPlatformFileManager Singleton.
73 */
75
76 /**
77 * Removes the specified file wrapper from the platform file wrapper chain.
78 *
79 * THIS IS EXTREMELY DANGEROUS AFTER THE ENGINE HAS BEEN INITIALIZED AS WE MAY BE MODIFYING
80 * THE WRAPPER CHAIN WHILE THINGS ARE BEING LOADED
81 *
82 * @param The platform file to remove.
83 */
84 void RemovePlatformFile(IPlatformFile* PlatformFileToRemove);
85
86 /**
87 * Inserts a new platform file into the platform file wrapper chain.
88 * The file is inserted before NewPlatformFile->GetLowerLevel().
89 *
90 * THIS IS EXTREMELY DANGEROUS AFTER THE ENGINE HAS BEEN INITIALIZED AS WE MAY BE MODIFYING
91 * THE WRAPPER CHAIN WHILE THINGS ARE BEING LOADED
92 *
93 * @param The platform file to insert.
94 * @return true if the platform file was inserted.
95 */
96 bool InsertPlatformFile(IPlatformFile* NewPlatformFile);
97};
#define WITH_EDITOR
Definition Build.h:7
#define USE_ATOMIC_PLATFORM_FILE
IPlatformFile * FindPlatformFile(const TCHAR *Name)
bool InsertPlatformFile(IPlatformFile *NewPlatformFile)
class IPlatformFile * TopmostPlatformFile
void SetPlatformFile(IPlatformFile &NewTopmostPlatformFile)
void RemovePlatformFile(IPlatformFile *PlatformFileToRemove)
IPlatformFile & GetPlatformFile()
IPlatformFile * GetPlatformFile(const TCHAR *Name)
static FPlatformFileManager & Get()