I3DHVersion.h Source File

instant3Dhub: I3DHVersion.h Source File
instant3Dhub
I3DHVersion.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "CoreMinimal.h"
9
10#include "Kismet\BlueprintFunctionLibrary.h"
11
12#include "I3DHVersion.generated.h"
13
14#define INSTANT3DHUB_VERSION_TEXT(x) TEXT(x)
15#define INSTANT3DHUB_VERSION_STRINGIFY_2(x) INSTANT3DHUB_VERSION_TEXT(#x)
16#define INSTANT3DHUB_VERSION_STRINGIFY(x) INSTANT3DHUB_VERSION_STRINGIFY_2(x)
17
19#define INSTANT3DHUB_VERSION_STRING \
20 INSTANT3DHUB_VERSION_STRINGIFY(INSTANT3DHUB_VERSION_MAJOR) \
21 INSTANT3DHUB_VERSION_TEXT(".") \
22 INSTANT3DHUB_VERSION_STRINGIFY(INSTANT3DHUB_VERSION_MINOR) \
23 INSTANT3DHUB_VERSION_TEXT(".") \
24 INSTANT3DHUB_VERSION_STRINGIFY(INSTANT3DHUB_VERSION_PATCH)
25
34namespace I3DHVersion
35{
40 INSTANT3DHUB_API int32 GetPluginVersionMajor();
41
46 INSTANT3DHUB_API int32 GetPluginVersionMinor();
47
52 INSTANT3DHUB_API int32 GetPluginVersionPatch();
53
58 INSTANT3DHUB_API FString GetPluginVersionString();
59
60} // namespace I3DHVersion
61
63UCLASS()
64class INSTANT3DHUB_API UI3DHVersion : public UBlueprintFunctionLibrary
65{
66 GENERATED_BODY()
67
68public:
69
74 UFUNCTION(BlueprintPure, Category = "{instant3Dhub}|Version")
75 static int32 GetPluginVersionMajor();
76
81 UFUNCTION(BlueprintPure, Category = "{instant3Dhub}|Version")
82 static int32 GetPluginVersionMinor();
83
88 UFUNCTION(BlueprintPure, Category = "{instant3Dhub}|Version")
89 static int32 GetPluginVersionPatch();
90
95 UFUNCTION(BlueprintPure, Category = "{instant3Dhub}|Version")
96 static FString GetPluginVersionString();
97};
98
99// ----------------------------------------------------------
100// Version Comparison Macros
101// ----------------------------------------------------------
102// NOTE: Sourced from EngineVersionComparison.h
103
104// Helper for INSTANT3DHUB_VERSION_NEWER_THAN and INSTANT3DHUB_VERSION_OLDER_THAN
105#define INSTANT3DHUB_GREATER_SORT(Value, ValueToBeGreaterThan, TieBreaker) \
106 (((Value) > (ValueToBeGreaterThan)) || (((Value) == (ValueToBeGreaterThan)) && (TieBreaker)))
107
108// Helper for INSTANT3DHUB_VERSION_EQUALS
109#define INSTANT3DHUB_EQUAL_SORT(Value, ValueToBeEqualTo, TieBreaker) \
110 (((Value) == (ValueToBeEqualTo)) && (TieBreaker))
111
119#define INSTANT3DHUB_VERSION_NEWER_THAN(MajorVersion, MinorVersion, PatchVersion) \
120 INSTANT3DHUB_GREATER_SORT(INSTANT3DHUB_VERSION_MAJOR, MajorVersion, INSTANT3DHUB_GREATER_SORT(INSTANT3DHUB_VERSION_MINOR, MinorVersion, INSTANT3DHUB_GREATER_SORT(INSTANT3DHUB_VERSION_PATCH, PatchVersion, false)))
121
129#define INSTANT3DHUB_VERSION_OLDER_THAN(MajorVersion, MinorVersion, PatchVersion) \
130 INSTANT3DHUB_GREATER_SORT(MajorVersion, INSTANT3DHUB_VERSION_MAJOR, INSTANT3DHUB_GREATER_SORT(MinorVersion, INSTANT3DHUB_VERSION_MINOR, INSTANT3DHUB_GREATER_SORT(PatchVersion, INSTANT3DHUB_VERSION_PATCH, false)))
131
138#define INSTANT3DHUB_VERSION_EQUALS(MajorVersion, MinorVersion, PatchVersion) \
139 INSTANT3DHUB_EQUAL_SORT(MajorVersion, INSTANT3DHUB_VERSION_MAJOR, INSTANT3DHUB_EQUAL_SORT(MinorVersion, INSTANT3DHUB_VERSION_MINOR, INSTANT3DHUB_EQUAL_SORT(PatchVersion, INSTANT3DHUB_VERSION_PATCH, true)))
140
166#define INSTANT3DHUB_FEATURE_METADATA 1
167
172#define INSTANT3DHUB_FEATURE_DEBUG_METRICS 1
173
183// ----------------------------------------------------------
184// Deprecation
185// ----------------------------------------------------------
186// NOTE: For more info on how to use see description of UE_DEPRECATED Macro in CoreMiscDefines.h
187#if defined (__INTELLISENSE__)
188#define INSTANT3DHUB_DEPRECATED(Version, Message)
189#else
201#define INSTANT3DHUB_DEPRECATED(Version, Message) [[deprecated(Message " - Please update your code to the new instant3Dhub API before upgrading to the next release, otherwise your project will no longer compile.")]]
202#endif
203
204// ----------------------------------------------------------
205// Experimental
206// ----------------------------------------------------------
207
208#ifndef I3DH_VALIDATE_EXPERIMENTAL_API
224#define I3DH_VALIDATE_EXPERIMENTAL_API 1
225#endif
226
227
228// NOTE: For more info on how to use see description of UE_DEPRECATED Macro in CoreMiscDefines.h
229#if defined (__INTELLISENSE__) || !I3DH_VALIDATE_EXPERIMENTAL_API
230#define INSTANT3DHUB_EXPERIMENTAL(Version, Message)
231#else
245#define INSTANT3DHUB_EXPERIMENTAL(Version, Message) [[deprecated(Message " - This API is experimental. As such, there is no guarantee that it won't change or be removed in future releases. Please use at your own risk.")]]
246#endif
247
248
249
250// NOTE: These macros are also defined by Unreal Engine starting with version 5.6. We provide these
251// definitions as fallback for backwards compatibility, therefore they do not have an INSTANT3DHUB /
252// I3DH prefix.
253#ifndef PRAGMA_DISABLE_EXPERIMENTAL_WARNINGS
267#define PRAGMA_DISABLE_EXPERIMENTAL_WARNINGS PRAGMA_DISABLE_DEPRECATION_WARNINGS
268#endif
269
270#ifndef PRAGMA_ENABLE_EXPERIMENTAL_WARNINGS
284#define PRAGMA_ENABLE_EXPERIMENTAL_WARNINGS PRAGMA_ENABLE_DEPRECATION_WARNINGS
285#endif
286
Blueprint Functions to query the instant3Dhub Unreal Plugin Version.
Definition I3DHVersion.h:65
Namespace offering functions to query the instant3Dhub Unreal Plugin version.
Definition I3DHVersion.h:35
FString GetPluginVersionString()
Gets plugin version string.
int32 GetPluginVersionPatch()
Gets plugin version patch.
int32 GetPluginVersionMajor()
Gets plugin version major.
int32 GetPluginVersionMinor()
Gets plugin version minor.