Navigation
API > API/Runtime > API/Runtime/uLangCore
Represents a type which is the union of several other types; i.e. it can have a value whose type is of any the union's subtypes. This differs from C union types by being type-safe, and supporting non-trivial data types as subtypes. Since a value for the union must be of a single subtype, the union stores potential values of different subtypes in overlapped memory, and keeps track of which one is currently valid.
| Name | TUnion |
| Type | class |
| Header File | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Misc/Union.h |
| Include Path | #include "uLang/Common/Misc/Union.h" |
Syntax
template<typename TypeA, typename TypeB, typename TypeC, typename TypeD, typename TypeE, typename TypeF>
class TUnion
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TUnion () |
Default constructor. | uLang/Common/Misc/Union.h | |
| Copy constructor. | uLang/Common/Misc/Union.h | ||
TUnion
(
typename TCallTraits< TypeA >::ParamType InValue, |
Initialization constructor. | uLang/Common/Misc/Union.h | |
TUnion
(
typename TCallTraits< TypeB >::ParamType InValue, |
Initialization constructor. | uLang/Common/Misc/Union.h | |
TUnion
(
typename TCallTraits< TypeC >::ParamType InValue, |
Initialization constructor. | uLang/Common/Misc/Union.h | |
TUnion
(
typename TCallTraits< TypeD >::ParamType InValue, |
Initialization constructor. | uLang/Common/Misc/Union.h | |
TUnion
(
typename TCallTraits< TypeE >::ParamType InValue, |
Initialization constructor. | uLang/Common/Misc/Union.h | |
TUnion
(
typename TCallTraits< TypeF >::ParamType InValue, |
Initialization constructor. | uLang/Common/Misc/Union.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TUnion() |
Destructor. | uLang/Common/Misc/Union.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| A | TTypeCompatibleBytes< TypeA > | uLang/Common/Misc/Union.h | ||
| B | TTypeCompatibleBytes< TypeB > | uLang/Common/Misc/Union.h | ||
| C | TTypeCompatibleBytes< TypeC > | uLang/Common/Misc/Union.h | ||
| D | TTypeCompatibleBytes< TypeD > | uLang/Common/Misc/Union.h | ||
| E | TTypeCompatibleBytes< TypeE > | uLang/Common/Misc/Union.h | ||
| F | TTypeCompatibleBytes< TypeF > | uLang/Common/Misc/Union.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CurrentSubtypeIndex | uint8_t | The index of the subtype that the union's current value is of. | uLang/Common/Misc/Union.h | |
| Values | union uLang::TUnion | The potential values for each subtype of the union. | uLang/Common/Misc/Union.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint8_t GetCurrentSubtypeIndex() |
uLang/Common/Misc/Union.h | ||
Subtype & GetSubtype () |
uLang/Common/Misc/Union.h | ||
const Subtype & GetSubtype () |
uLang/Common/Misc/Union.h | ||
bool HasSubtype() |
uLang/Common/Misc/Union.h | ||
void Reset() |
Sets the union's value to NULL. | uLang/Common/Misc/Union.h | |
void ResetSubtype() |
If the union's current value is of the given subtype, sets the union's value to a NULL value. | uLang/Common/Misc/Union.h | |
Subtype * SetSubtype
(
typename TCallTraits< Subtype >::ParamType NewValue |
Replaces the value of the union with a value of the given subtype. | uLang/Common/Misc/Union.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void FatalErrorUndefinedSubtype() |
uLang/Common/Misc/Union.h | ||
static void GetSubtypeIndexAndReference
(
const TUnion& Union, |
Determines the index and reference to the potential value for the given union subtype. | uLang/Common/Misc/Union.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| uLang/Common/Misc/Union.h | |||
bool operator==
(
const TUnion& Other |
Equality comparison. | uLang/Common/Misc/Union.h |