Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
CoreMiscDefines.h File Reference
+ Include dependency graph for CoreMiscDefines.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TStaticDeprecateExpression< bIsDeprecated >
 
struct  FPlatformUserId
 
struct  FInputDeviceId
 
struct  FPlatformInputDeviceState
 

Macros

#define WARNING_LOCATION(Line)   __FILE__ "(" PREPROCESSOR_TO_STRING(Line) ")"
 
#define PLAYWORLD_PACKAGE_PREFIX   TEXT("UEDPIE")
 
#define WITH_EDITORONLY_DATA   0
 
#define WITH_METADATA   (WITH_EDITORONLY_DATA && WITH_EDITOR)
 
#define UE_CHECK_DISABLE_OPTIMIZATION   0
 
#define UE_DISABLE_OPTIMIZATION_SHIP   PRAGMA_DISABLE_OPTIMIZATION_ACTUAL
 
#define UE_ENABLE_OPTIMIZATION_SHIP   PRAGMA_ENABLE_OPTIMIZATION_ACTUAL
 
#define UE_DISABLE_OPTIMIZATION   UE_DISABLE_OPTIMIZATION_SHIP
 
#define UE_ENABLE_OPTIMIZATION   UE_ENABLE_OPTIMIZATION_SHIP
 
#define PRAGMA_DISABLE_OPTIMIZATION
 
#define PRAGMA_ENABLE_OPTIMIZATION
 
#define FORCEINLINE_DEBUGGABLE   FORCEINLINE
 
#define CLOCK_CYCLES(Timer)
 
#define UNCLOCK_CYCLES(Timer)
 
#define SHUTDOWN_IF_EXIT_REQUESTED
 
#define RETURN_IF_EXIT_REQUESTED
 
#define RETURN_VAL_IF_EXIT_REQUESTED(x)
 
#define PURE_VIRTUAL(func, ...)   { LowLevelFatalError(TEXT("Pure virtual not implemented (%s)"), TEXT(#func)); __VA_ARGS__ }
 
#define USING_CODE_ANALYSIS   0
 
#define CA_IN
 
#define CA_OUT
 
#define CA_READ_ONLY
 
#define CA_WRITE_ONLY
 
#define CA_VALID_POINTER
 
#define CA_CHECK_RETVAL
 
#define CA_NO_RETURN
 
#define CA_SUPPRESS(WarningNumber)
 
#define CA_ASSUME(Expr)
 
#define CA_CONSTANT_IF(Condition)   if (Condition)
 
#define USING_THREAD_SANITISER   0
 
#define TSAN_SAFE
 
#define TSAN_BEFORE(Addr)
 
#define TSAN_AFTER(Addr)
 
#define TSAN_ATOMIC(Type)   Type
 
#define UE_PUSH_MACRO(name)   __pragma(push_macro(name))
 
#define UE_POP_MACRO(name)   __pragma(pop_macro(name))
 
#define PUSH_MACRO(name)   UE_DEPRECATED_MACRO(5.0, "PUSH_MACRO is deprecated. Use UE_PUSH_MACRO and pass the macro name as a string.") UE_PUSH_MACRO(PREPROCESSOR_TO_STRING(name))
 
#define POP_MACRO(name)   UE_DEPRECATED_MACRO(5.0, "POP_MACRO is deprecated. Use UE_POP_MACRO and pass the macro name as a string.") UE_POP_MACRO(PREPROCESSOR_TO_STRING(name))
 
#define ANONYMOUS_VARIABLE(Name)   PREPROCESSOR_JOIN(Name, __LINE__)
 
#define UE_CALL_ONCE(Func, ...)   static int32 ANONYMOUS_VARIABLE(ThreadSafeOnce) = ((Func)(__VA_ARGS__), 1)
 
#define UE_DEPRECATED(Version, Message)   [[deprecated(Message " Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.")]]
 
#define UE_DEPRECATED_FORGAME(...)
 
#define UE_STRIP_DEPRECATED_PROPERTIES   0
 
#define UE_STATIC_DEPRECATE(Version, bExpression, Message)
 
#define UE_PTRDIFF_TO_INT32(argument)   static_cast<int32>(argument)
 
#define UE_PTRDIFF_TO_UINT32(argument)   static_cast<uint32>(argument)
 
#define UE_NONCOPYABLE(TypeName)
 

Enumerations

enum  { INDEX_NONE = -1 }
 
enum  { UNICODE_BOM = 0xfeff }
 
enum  EForceInit { ForceInit , ForceInitToZero }
 
enum  ENoInit { NoInit }
 
enum  EInPlace { InPlace }
 
enum class  EInputDeviceConnectionState : uint8 { Invalid , Unknown , Disconnected , Connected }
 

Variables

const FPlatformUserId PLATFORMUSERID_NONE
 
const FInputDeviceId INPUTDEVICEID_NONE
 

Macro Definition Documentation

◆ ANONYMOUS_VARIABLE

#define ANONYMOUS_VARIABLE ( Name)    PREPROCESSOR_JOIN(Name, __LINE__)

Definition at line 163 of file CoreMiscDefines.h.

◆ CA_ASSUME

#define CA_ASSUME ( Expr)

Definition at line 113 of file CoreMiscDefines.h.

◆ CA_CHECK_RETVAL

#define CA_CHECK_RETVAL

Definition at line 110 of file CoreMiscDefines.h.

◆ CA_CONSTANT_IF

#define CA_CONSTANT_IF ( Condition)    if (Condition)

Definition at line 114 of file CoreMiscDefines.h.

◆ CA_IN

#define CA_IN

Definition at line 105 of file CoreMiscDefines.h.

◆ CA_NO_RETURN

#define CA_NO_RETURN

Definition at line 111 of file CoreMiscDefines.h.

◆ CA_OUT

#define CA_OUT

Definition at line 106 of file CoreMiscDefines.h.

◆ CA_READ_ONLY

#define CA_READ_ONLY

Definition at line 107 of file CoreMiscDefines.h.

◆ CA_SUPPRESS

#define CA_SUPPRESS ( WarningNumber)

Definition at line 112 of file CoreMiscDefines.h.

◆ CA_VALID_POINTER

#define CA_VALID_POINTER

Definition at line 109 of file CoreMiscDefines.h.

◆ CA_WRITE_ONLY

#define CA_WRITE_ONLY

Definition at line 108 of file CoreMiscDefines.h.

◆ CLOCK_CYCLES

#define CLOCK_CYCLES ( Timer)

Definition at line 79 of file CoreMiscDefines.h.

◆ FORCEINLINE_DEBUGGABLE

#define FORCEINLINE_DEBUGGABLE   FORCEINLINE

Definition at line 71 of file CoreMiscDefines.h.

◆ PLAYWORLD_PACKAGE_PREFIX

#define PLAYWORLD_PACKAGE_PREFIX   TEXT("UEDPIE")

Definition at line 21 of file CoreMiscDefines.h.

◆ POP_MACRO

#define POP_MACRO ( name)    UE_DEPRECATED_MACRO(5.0, "POP_MACRO is deprecated. Use UE_POP_MACRO and pass the macro name as a string.") UE_POP_MACRO(PREPROCESSOR_TO_STRING(name))

Definition at line 155 of file CoreMiscDefines.h.

◆ PRAGMA_DISABLE_OPTIMIZATION

#define PRAGMA_DISABLE_OPTIMIZATION
Value:
UE_DEPRECATED_MACRO(5.2, "PRAGMA_DISABLE_OPTIMIZATION has been deprecated. Use UE_DISABLE_OPTIMIZATION for temporary development or UE_DISABLE_OPTIMIZATION_SHIP to submit") \
#define UE_DISABLE_OPTIMIZATION_SHIP
#define UE_DEPRECATED_MACRO(Version, Message)

Definition at line 60 of file CoreMiscDefines.h.

◆ PRAGMA_ENABLE_OPTIMIZATION

#define PRAGMA_ENABLE_OPTIMIZATION
Value:
UE_DEPRECATED_MACRO(5.2, "PRAGMA_ENABLE_OPTIMIZATION has been deprecated. Use UE_ENABLE_OPTIMIZATION for temporary development or UE_ENABLE_OPTIMIZATION_SHIP to submit") \
#define UE_ENABLE_OPTIMIZATION_SHIP

Definition at line 64 of file CoreMiscDefines.h.

◆ PURE_VIRTUAL

#define PURE_VIRTUAL ( func,
... )   { LowLevelFatalError(TEXT("Pure virtual not implemented (%s)"), TEXT(#func)); __VA_ARGS__ }

Definition at line 90 of file CoreMiscDefines.h.

◆ PUSH_MACRO

#define PUSH_MACRO ( name)    UE_DEPRECATED_MACRO(5.0, "PUSH_MACRO is deprecated. Use UE_PUSH_MACRO and pass the macro name as a string.") UE_PUSH_MACRO(PREPROCESSOR_TO_STRING(name))

Definition at line 154 of file CoreMiscDefines.h.

◆ RETURN_IF_EXIT_REQUESTED

#define RETURN_IF_EXIT_REQUESTED

Definition at line 84 of file CoreMiscDefines.h.

◆ RETURN_VAL_IF_EXIT_REQUESTED

#define RETURN_VAL_IF_EXIT_REQUESTED ( x)

Definition at line 85 of file CoreMiscDefines.h.

◆ SHUTDOWN_IF_EXIT_REQUESTED

#define SHUTDOWN_IF_EXIT_REQUESTED

Definition at line 83 of file CoreMiscDefines.h.

◆ TSAN_AFTER

#define TSAN_AFTER ( Addr)

Definition at line 129 of file CoreMiscDefines.h.

◆ TSAN_ATOMIC

#define TSAN_ATOMIC ( Type)    Type

Definition at line 130 of file CoreMiscDefines.h.

◆ TSAN_BEFORE

#define TSAN_BEFORE ( Addr)

Definition at line 128 of file CoreMiscDefines.h.

◆ TSAN_SAFE

#define TSAN_SAFE

Definition at line 127 of file CoreMiscDefines.h.

◆ UE_CALL_ONCE

#define UE_CALL_ONCE ( Func,
... )   static int32 ANONYMOUS_VARIABLE(ThreadSafeOnce) = ((Func)(__VA_ARGS__), 1)

Thread-safe call once helper for void functions, similar to std::call_once without the std::once_flag

Definition at line 167 of file CoreMiscDefines.h.

◆ UE_CHECK_DISABLE_OPTIMIZATION

#define UE_CHECK_DISABLE_OPTIMIZATION   0

Definition at line 36 of file CoreMiscDefines.h.

◆ UE_DEPRECATED

#define UE_DEPRECATED ( Version,
Message )   [[deprecated(Message " Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.")]]

Macro for marking up deprecated code, functions and types.

This should be used as syntactic replacement for the [[deprecated]] attribute which provides a UE version number like the old DEPRECATED macro.

Features that are marked as deprecated are scheduled to be removed from the code base in a future release. If you are using a deprecated feature in your code, you should replace it before upgrading to the next release. See the Upgrade Notes in the release notes for the release in which the feature was marked deprecated.

Sample usage (note the slightly different syntax for classes and structures):

UE_DEPRECATED(4.xx, "Message")
void MyFunction();

UE_DEPRECATED(4.xx, "Message")
typedef FThing MyType;

using MyAlias UE_DEPRECATED(4.xx, "Message") = FThing;

UE_DEPRECATED(4.xx, "Message")
int32 MyVariable;

namespace UE_DEPRECATED(4.xx, "Message") MyNamespace
{
}

Unfortunately, clang will complain that [the] "declaration of [an] anonymous class must
be a definition" for API types.  To work around this, first forward declare the type as
deprecated, then declare the type with the visibility macro.  Note that macros like
USTRUCT must immediately precede the the type declaration, not the forward declaration.

struct UE_DEPRECATED(4.xx, "Message") FMyStruct;
USTRUCT()
struct MODULE_API FMyStruct
{
};

class UE_DEPRECATED(4.xx, "Message") FMyClass;
class MODULE_API FMyClass
{
};

enum class UE_DEPRECATED(4.xx, "Message") EMyEnumeration
{
    Zero = 0,
    One UE_DEPRECATED(4.xx, "Message") = 1,
    Two = 2
};

Unfortunately, VC++ will complain about using member functions and fields from deprecated
class/structs even for class/struct implementation e.g.:
class UE_DEPRECATED(4.xx, "") DeprecatedClass
{
public:
    DeprecatedClass() {}

    float GetMyFloat()
    {
        return MyFloat; // This line will cause warning that deprecated field is used.
    }
private:
    float MyFloat;
};

To get rid of this warning, place all code not called in class implementation in non-deprecated
base class and deprecate only derived one. This may force you to change some access specifiers
from private to protected, e.g.:

class DeprecatedClass_Base_DEPRECATED
{
protected: // MyFloat is protected now, so DeprecatedClass has access to it.
    float MyFloat;
};

class UE_DEPRECATED(4.xx, "") DeprecatedClass : DeprecatedClass_Base_DEPRECATED
{
public:
    DeprecatedClass() {}

    float GetMyFloat()
    {
        return MyFloat;
    }
};
Parameters
VERSIONThe release number in which the feature was marked deprecated.
MESSAGEA message containing upgrade notes.

Definition at line 259 of file CoreMiscDefines.h.

◆ UE_DEPRECATED_FORGAME

#define UE_DEPRECATED_FORGAME ( ...)

Definition at line 262 of file CoreMiscDefines.h.

◆ UE_DISABLE_OPTIMIZATION

#define UE_DISABLE_OPTIMIZATION   UE_DISABLE_OPTIMIZATION_SHIP

Definition at line 56 of file CoreMiscDefines.h.

◆ UE_DISABLE_OPTIMIZATION_SHIP

#define UE_DISABLE_OPTIMIZATION_SHIP   PRAGMA_DISABLE_OPTIMIZATION_ACTUAL

Definition at line 42 of file CoreMiscDefines.h.

◆ UE_ENABLE_OPTIMIZATION

#define UE_ENABLE_OPTIMIZATION   UE_ENABLE_OPTIMIZATION_SHIP

Definition at line 57 of file CoreMiscDefines.h.

◆ UE_ENABLE_OPTIMIZATION_SHIP

#define UE_ENABLE_OPTIMIZATION_SHIP   PRAGMA_ENABLE_OPTIMIZATION_ACTUAL

Definition at line 48 of file CoreMiscDefines.h.

◆ UE_NONCOPYABLE

#define UE_NONCOPYABLE ( TypeName)
Value:
TypeName(TypeName&&) = delete; \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete; \
TypeName& operator=(TypeName&&) = delete;

Makes a type non-copyable and non-movable by deleting copy/move constructors and assignment/move operators. The macro should be placed in the public section of the type for better compiler diagnostic messages. Example usage:

class FMyClassName { public: UE_NONCOPYABLE(FMyClassName) FMyClassName() = default; };

Definition at line 309 of file CoreMiscDefines.h.

◆ UE_POP_MACRO

#define UE_POP_MACRO ( name)    __pragma(pop_macro(name))

Definition at line 152 of file CoreMiscDefines.h.

◆ UE_PTRDIFF_TO_INT32

#define UE_PTRDIFF_TO_INT32 ( argument)    static_cast<int32>(argument)

Definition at line 294 of file CoreMiscDefines.h.

◆ UE_PTRDIFF_TO_UINT32

#define UE_PTRDIFF_TO_UINT32 ( argument)    static_cast<uint32>(argument)

Definition at line 295 of file CoreMiscDefines.h.

◆ UE_PUSH_MACRO

#define UE_PUSH_MACRO ( name)    __pragma(push_macro(name))

Definition at line 151 of file CoreMiscDefines.h.

◆ UE_STATIC_DEPRECATE

#define UE_STATIC_DEPRECATE ( Version,
bExpression,
Message )
Value:
[[deprecated(Message " Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.")]] \
static constexpr int condition(TStaticDeprecateExpression<true>) { return 1; } \
static constexpr int condition(TStaticDeprecateExpression<false>) { return 1; } \
}; \
#define PREPROCESSOR_JOIN(x, y)

Can be used in the same contexts as static_assert but gives a warning rather than an error, and 'fails' if the expression is true rather than false.

Definition at line 283 of file CoreMiscDefines.h.

◆ UE_STRIP_DEPRECATED_PROPERTIES

#define UE_STRIP_DEPRECATED_PROPERTIES   0

Definition at line 272 of file CoreMiscDefines.h.

◆ UNCLOCK_CYCLES

#define UNCLOCK_CYCLES ( Timer)

Definition at line 80 of file CoreMiscDefines.h.

◆ USING_CODE_ANALYSIS

#define USING_CODE_ANALYSIS   0

Definition at line 96 of file CoreMiscDefines.h.

◆ USING_THREAD_SANITISER

#define USING_THREAD_SANITISER   0

Definition at line 118 of file CoreMiscDefines.h.

◆ WARNING_LOCATION

#define WARNING_LOCATION ( Line)    __FILE__ "(" PREPROCESSOR_TO_STRING(Line) ")"

Definition at line 10 of file CoreMiscDefines.h.

◆ WITH_EDITORONLY_DATA

#define WITH_EDITORONLY_DATA   0

Definition at line 25 of file CoreMiscDefines.h.

◆ WITH_METADATA

#define WITH_METADATA   (WITH_EDITORONLY_DATA && WITH_EDITOR)

This controls if metadata for compiled in classes is unpacked and setup at boot time. Meta data is not normally used except by the editor.

Definition at line 32 of file CoreMiscDefines.h.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
INDEX_NONE 

Definition at line 133 of file CoreMiscDefines.h.

◆ anonymous enum

Enumerator
UNICODE_BOM 

Definition at line 134 of file CoreMiscDefines.h.

◆ EForceInit

Enumerator
ForceInit 
ForceInitToZero 

Definition at line 136 of file CoreMiscDefines.h.

◆ EInPlace

Enumerator
InPlace 

Definition at line 142 of file CoreMiscDefines.h.

◆ EInputDeviceConnectionState

Represents the connection status of a given FInputDeviceId

Enumerator
Invalid 

This is not a valid input device

Unknown 

It is not known if this device is connected or not

Disconnected 

Device is definitely connected

Connected 

Definitely connected and powered on

Definition at line 461 of file CoreMiscDefines.h.

◆ ENoInit

Enumerator
NoInit 

Definition at line 141 of file CoreMiscDefines.h.

Variable Documentation

◆ INPUTDEVICEID_NONE

const FInputDeviceId INPUTDEVICEID_NONE

Static invalid input device.

Definition at line 458 of file CoreMiscDefines.h.

◆ PLATFORMUSERID_NONE

const FPlatformUserId PLATFORMUSERID_NONE

Static invalid platform user

Definition at line 378 of file CoreMiscDefines.h.