I am just curious about what exactly CastFlags are.
I have a use case where I want to be able to switch on the FFieldClass of a given FProperty without just manually using CastField or comparing to the ::StaticClass(). I noticed that CastField (and I think regular Cast too) makes use of some mysterious field called CastFlags to determine if a given object is a valid static_cast candidate for the desired destination type, and I have a hunch that I may be able to leverage this information to accomplish what I need.
My questions:
-
CastFlagscould theoretically just be a unique integer assigned to every class, but giving this fielduint64range for that seems like overkill to me and leads me to believe there is more information in this field than just “what is this class”. What all metadata is compacted into this innocent integer? -
Given an arbitrary
uint64value, if treated as though it was some class’sCastFlags, are there mechanisms to work backwards and determine what class that value would map to? (I am assuming no two classes would have the sameCastFlags) Is it possible to get the associated class for any perceivableCastFlagsvalue?