Interface
: 객체 설계의 틀을 제공하는 추상 클래스Reflection
: Runtime에서 객체의 구조를 파악하고 객체에 meta-data를 부여Delegate
: 프로그램에서 발생한 event를 다수의 객체에 효과적으로 전달하는데 활용C++ -> 언리얼 C++
UHT는 언리얼 오브젝트에서 다양한 기능이 지원되도록 도와주는 역할을 한다. 개발자들은 단순히 macro만 지정해 주면 된다.
언리얼 엔진의 코드는 바로 컴파일 되지 않는다.
1 단계
: UHT(Unreal Header Tool)에 의해서 소스 코드를 자동으로 생성.
2 단계
: 자동으로 생성된 코드를 포함해서 마지막 최종 Build를 진행.
In Unreal Engine, a generated.h
file is an auto-generated header file that is created by the Unreal Header Tool (UHT)
as part of the build process. This file is associated with a corresponding .h file that contains Unreal Engine-specific macros, such as UCLASS, USTRUCT, UENUM, and UPROPERTY. These macros are used to mark up the code for Unreal's reflection
system, which provides runtime type information and other metadata that the engine uses for various purposes, such as serialization, network replication, and garbage collection.
Here's a more detailed explanation of its role and usage:
Reflection System
: The Unreal Header Tool processes the macros in your C++ header files and generates the necessary code for Unreal's reflection system. This system allows the engine to understand and manipulate your classes and properties at runtime.
Metadata
: The generated.h file contains metadata and boilerplate code that helps the engine interact with your classes and properties. This includes information about class hierarchies, property offsets, and various other details needed by the engine.
Automatic Inclusion
: When you include a header file that has Unreal Engine macros, you need to include the corresponding generated.h file at the end of your header file.
프로젝트 폴더 -> Intermediate -> Build -> Win64 -> UnrealEditor -> Inc -> UnrealObject -> UHT
GENERATED_BODY()
is a macro
that automates the generation of essential code for Unreal Engine's reflection, serialization, and other engine-specific functionalities.
The generated.h
file contains the code generated by the Unreal Header Tool (UHT) based on the Unreal-specific macros in your class.
The relationship between the two is that GENERATED_BODY()
pulls in and integrates the code from the generated.h
file into your class, ensuring it has all the necessary boilerplate to function correctly within the Unreal Engine ecosystem.
Unreal Build Tool (UBT)
is Unreal Engine's custom build system designed to manage the compilation and linking of code and assets efficiently. It handles dependency management, cross-platform builds, and integration with various IDEs, using configuration files like .Build.cs
and .Target.cs
to set up different build targets such as games, editor tools, and servers. UBT
automates the build process, ensuring faster and more reliable builds, and supports continuous integration systems for automated testing and deployment.
UBT
and UHT
work together to streamline the build process in Unreal Engine. UBT orchestrates the entire build sequence, invoking UHT to process header files with Unreal-specific macros and generate the necessary .generated.h files. This ensures that all reflection data and metadata required by the engine are up-to-date before UBT proceeds with the actual compilation and linking of the project. By coordinating their functions, UBT ensures efficient builds while UHT handles the generation of essential boilerplate code for the engine's reflection and serialization systems.