|
| uint8 | GetCurrentSubtypeIndex () const |
| |
| template<typename Subtype > |
| Subtype & | GetSubtype () |
| |
| template<typename Subtype > |
| const Subtype & | GetSubtype () const |
| |
| template<typename Subtype > |
| bool | HasSubtype () const |
| |
|
bool | operator== (const TUnion &Other) const |
| | Equality comparison.
|
| |
|
void | Reset () |
| | Sets the union's value to NULL.
|
| |
|
template<typename Subtype > |
| void | ResetSubtype () |
| | If the union's current value is of the given subtype, sets the union's value to a NULL value.
|
| |
|
template<typename Subtype > |
| Subtype * | SetSubtype (typename TCallTraits< Subtype >::ParamType NewValue) |
| | Replaces the value of the union with a value of the given subtype.
|
| |
|
| TUnion () |
| | Default constructor.
|
| |
|
| TUnion (const TUnion &Other) |
| | Copy constructor.
|
| |
|
| TUnion (typename TCallTraits< TypeA >::ParamType InValue, TDisambiguater< 0 > Disambiguater=TDisambiguater< 0 >()) |
| | Initialization constructor.
|
| |
|
| TUnion (typename TCallTraits< TypeB >::ParamType InValue, TDisambiguater< 1 > Disambiguater=TDisambiguater< 1 >()) |
| | Initialization constructor.
|
| |
|
| TUnion (typename TCallTraits< TypeC >::ParamType InValue, TDisambiguater< 2 > Disambiguater=TDisambiguater< 2 >()) |
| | Initialization constructor.
|
| |
|
| TUnion (typename TCallTraits< TypeD >::ParamType InValue, TDisambiguater< 3 > Disambiguater=TDisambiguater< 3 >()) |
| | Initialization constructor.
|
| |
|
| TUnion (typename TCallTraits< TypeE >::ParamType InValue, TDisambiguater< 4 > Disambiguater=TDisambiguater< 4 >()) |
| | Initialization constructor.
|
| |
|
| TUnion (typename TCallTraits< TypeF >::ParamType InValue, TDisambiguater< 5 > Disambiguater=TDisambiguater< 5 >()) |
| | Initialization constructor.
|
| |
|
| ~TUnion () |
| | Destructor.
|
| |
template<typename TypeA, typename TypeB = FNull, typename TypeC = FNull, typename TypeD = FNull, typename TypeE = FNull, typename TypeF = FNull>
class TUnion< TypeA, TypeB, TypeC, TypeD, TypeE, TypeF >
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.