|
| | FMovieSceneNumericVariant (ENoInit) |
| |
| MOVIESCENE_API | FMovieSceneNumericVariant () |
| |
| MOVIESCENE_API | FMovieSceneNumericVariant (double InValue) |
| |
| MOVIESCENE_API | FMovieSceneNumericVariant (UMovieSceneNumericVariantGetter *InGetter) |
| |
| | FMovieSceneNumericVariant (FMovieSceneNumericVariant &&In)=default |
| |
| FMovieSceneNumericVariant & | operator= (FMovieSceneNumericVariant &&In)=default |
| |
| MOVIESCENE_API void | Set (double InLiteralValue) |
| |
| MOVIESCENE_API void | Set (UMovieSceneNumericVariantGetter *InDynamicValue) |
| |
| MOVIESCENE_API void | SetWeakUnsafe (UMovieSceneNumericVariantGetter *InDynamicValue) |
| |
| MOVIESCENE_API void | MakeWeakUnsafe () |
| |
| MOVIESCENE_API double | Get () const |
| |
| MOVIESCENE_API UMovieSceneNumericVariantGetter * | GetCustomPtr () const |
| |
| bool | IsLiteral () const |
| |
| double | GetLiteral () const |
| |
| float | GetLiteralAsFloat () const |
| |
| bool | IsCustomPtr () const |
| |
| MOVIESCENE_API FMovieSceneNumericVariant | ShallowCopy () const |
| |
| MOVIESCENE_API FMovieSceneNumericVariant | DeepCopy (UObject *NewOuter) const |
| |
| bool | Serialize (FArchive &Ar) |
| |
| bool | Identical (const FMovieSceneNumericVariant *Other, uint32 PortFlags) const |
| |
| void | AddStructReferencedObjects (FReferenceCollector &Collector) |
| |
| bool | SerializeFromMismatchedTag (const FPropertyTag &Tag, FStructuredArchive::FSlot Slot) |
| |
| bool | ExportTextItem (FString &ValueStr, const FMovieSceneNumericVariant &DefaultValue, UObject *Parent, int32 PortFlags, UObject *ExportRootScope) const |
| |
| bool | ImportTextItem (const TCHAR *&Buffer, int32 PortFlags, UObject *Parent, FOutputDevice *ErrorText, FArchive *InSerializingArchive=nullptr) |
| |
| void | GetPreloadDependencies (TArray< UObject * > &OutDeps) |
| |
| bool | SerializeCustom (FArchive &Ar, TFunctionRef< void(FArchive &, uint8 &, void *)>) |
| |
| template<typename T > |
| void | SetTypedData (const T &InValue, uint8 InType) |
| |
| template<typename T > |
| T | UnsafePayloadCast () const |
| |
| MOVIESCENE_API void | SetTypeBits (uint8 InType) |
| |
| MOVIESCENE_API uint8 | GetTypeBits () const |
| |
| | FMovieSceneNumericVariant (const FMovieSceneNumericVariant &Other)=default |
| |
| FMovieSceneNumericVariant & | operator= (const FMovieSceneNumericVariant &Other)=default |
| |
A variant type that masquerades as a numeric (double) value.
This type is 8 bytes (sizeof(double)) and uses a technique called NaN-boxing to encode variants into those 8-bytes, while a literal double value maintains the exact same bits in-memory as a double. By default this variant can only represent a double, or a UMovieSceneNumericVariantGetter*, but additional variant types can be encoded by deriving from this type and associating type 'IDs' to typed-data (upto 48 bit in size), where the type bits are encoded into the nan bits of the double.
Extensive reading around NaN-boxing techniques can be found elsewhere.
UMovieSceneNumericVariantGetter may be used to assign an external, dynamic value to this variant.
The benefit of using this technique is that this type can be used as a drop-in replacement for any double member variable to provide it with dynamic getter functionality without inflating the size of the class, and with barely any runtime overhead whatsoever. Automatic UPROPERTY upgrade exists for all numeric property types that make sense: int64 and uint64 are not supported in this variant due to loss of precision (doubles only have 52 bits of mantissa)