IReflectable Class Referenceabstract

Description

Interface implemented by classes that provide run time type information.

Note
Any class implementing this interface must implement the getRTTI() method, as well as a static getRTTIStatic() method, returning the same value as getRTTI(). Object returned by those methods is used for retrieving actual RTTI data about the class.

Inherited by AnimationSplitInfo, AutoExposureSettings, BlendState, BuildData, Camera, ColorGradingSettings, DepthStencilState, DockManagerLayout, EditorWidgetLayout, FontBitmap, FPhysicsMesh, GameObject, GameObjectHandleBase, GameSettings, GpuProgram, GpuResourceData, GUIElementStyle, ImportedAnimationEvents, ImportOptions, Light, ManagedSerializableArray, ManagedSerializableAssemblyInfo, ManagedSerializableDictionary, ManagedSerializableDictionaryKeyValue, ManagedSerializableDiff, ManagedSerializableDiff::Modification, ManagedSerializableDiff::ModifiedArrayEntry, ManagedSerializableDiff::ModifiedDictionaryEntry, ManagedSerializableDiff::ModifiedField, ManagedSerializableFieldData, ManagedSerializableFieldDataEntry, ManagedSerializableFieldKey, ManagedSerializableList, ManagedSerializableMemberInfo, ManagedSerializableObject, ManagedSerializableObjectInfo, ManagedSerializableTypeInfo, MaterialParams, MaterialParamStructData, MaterialParamTextureData, MorphChannel, MorphShape, MorphShapes, Pass, PlatformInfo, PostProcessSettings, PrefabComponentDiff, PrefabDiff, PrefabObjectDiff, ProjectFileMeta, ProjectLibraryEntries, ProjectResourceMeta, RasterizerState, ReflectionProbe, Renderable, Resource, ResourceHandleBase, ResourceManifest, ResourceMapping, ResourceMetaData, SamplerState, SavedResourceData, SerializedArrayEntry, SerializedEntry, SerializedInstance, SerializedSubObject, Settings, Skeleton, Skybox, Technique, TonemappingSettings, VertexDataDesc, VertexDeclaration, Viewport, and WhiteBalanceSettings.

Methods

virtual RTTITypeBasegetRTTI () const =0
 Returns an interface you can use to access class' Run Time Type Information. More...
 
bool isDerivedFrom (RTTITypeBase *base)
 Returns true if current RTTI class is derived from base (Or if it is the same type as base). More...
 
UINT32 getTypeId () const
 Returns an unique type identifier of the class. More...
 
const StringgetTypeName () const
 Returns the type name of the class. More...
 

Static methods

static Vector< RTTITypeBase * > & getDerivedClasses ()
 Returns all classes deriving directly from IReflectable. More...
 
static SPtr< IReflectablecreateInstanceFromTypeId (UINT32 rttiTypeId)
 Creates an empty instance of a class from a type identifier. More...
 
Internal
static void _registerDerivedClass (RTTITypeBase *derivedClass)
 Called by each type deriving from IReflectable, on program load. More...
 
static RTTITypeBase_getRTTIfromTypeId (UINT32 rttiTypeId)
 Returns class' RTTI type from type id. More...
 
static bool _isTypeIdDuplicate (UINT32 typeId)
 Checks if the provided type id is unique. More...
 
static void _checkForCircularReferences ()
 Iterates over all RTTI types and reports any circular references (for example one type having a field referencing another type, and that type having a field referencing the first type). More...
 
static RTTITypeBasegetRTTIStatic ()
 Returns an interface you can use to access class' Run Time Type Information. More...
 

Method documentation

static void _checkForCircularReferences ( )
static

Iterates over all RTTI types and reports any circular references (for example one type having a field referencing another type, and that type having a field referencing the first type).

Circular references are problematic because when serializing the system cannot determine in which order they should be resolved. In that case user should use RTTI_Flag_WeakRef to mark one of the references as weak. This flags tells the system that the reference may be resolved in an undefined order, but also no longer guarantees that object assigned to that field during deserialization will be fully deserialized itself, as that might be delayed to a later time.

static RTTITypeBase* _getRTTIfromTypeId ( UINT32  rttiTypeId)
static

Returns class' RTTI type from type id.

static bool _isTypeIdDuplicate ( UINT32  typeId)
static

Checks if the provided type id is unique.

static void _registerDerivedClass ( RTTITypeBase derivedClass)
static

Called by each type deriving from IReflectable, on program load.

static SPtr<IReflectable> createInstanceFromTypeId ( UINT32  rttiTypeId)
static

Creates an empty instance of a class from a type identifier.

static Vector<RTTITypeBase*>& getDerivedClasses ( )
static

Returns all classes deriving directly from IReflectable.

virtual RTTITypeBase* getRTTI ( ) const
pure virtual

Returns an interface you can use to access class' Run Time Type Information.

Note
You must derive your own version of RTTITypeBase, in which you may encapsulate all reflection specific operations.

Implemented in ManagedSerializableFieldDataDictionary, ManagedSerializableFieldDataList, ManagedSerializableFieldDataArray, ManagedSerializableFieldDataObject, SceneObject, ManagedSerializableFieldDataGameObjectRef, Material, ManagedSerializableFieldDataResourceRef, MaterialParams, ManagedSerializableFieldDataString, Camera, ManagedSerializableFieldDataDouble, ManagedSerializableFieldDataFloat, ManagedSerializableFieldDataU64, ShaderMetaData, ManagedSerializableFieldDataI64, Shader, ManagedSerializableFieldDataU32, ManagedSerializableAssemblyInfo, ManagedSerializableObjectInfo, ManagedSerializableFieldDataI32, PixelData, ManagedSerializablePropertyInfo, ManagedSerializableFieldDataU16, StringTable, ManagedSerializableFieldInfo, ManagedSerializableFieldDataI16, Texture, MeshData, ManagedSerializableMemberInfo, ManagedSerializableFieldDataU8, AnimationClip, MaterialParamTextureData, StandardPostProcessSettings, Light, ManagedSerializableDiff, Renderable, ManagedSerializableFieldDataI8, CRigidbody, MaterialParamStructData, CCamera, ManagedSerializableTypeInfoDictionary, ReflectionProbe, ManagedSerializableDictionary, ManagedSerializableFieldDataChar, ManagedSerializableTypeInfoList, BlendState, DepthStencilState, CAnimation, Pass, VertexDeclaration, ColorGradingSettings, SerializedArray, ManagedSerializableFieldDataBool, ManagedSerializableTypeInfoArray, MeshImportOptions, CCollider, Viewport, Component, Skeleton, RasterizerState, Mesh, SamplerState, ManagedSerializableDiff::ModifiedEntry, SerializedDataBlock, ManagedSerializableArray, TResourceHandleBase< false >, ManagedSerializableTypeInfoObject, AudioClip, WhiteBalanceSettings, CAudioSource, PrefabDiff, ManagedComponent, ManagedSerializableFieldDataEntry, CCharacterController, GameObjectHandleBase, ManagedSerializableDiff::ModifiedDictionary, ProjectFileMeta, MorphShapes, EditorSettings, GpuProgram, ManagedSerializableList, ManagedSerializableObject, SerializedField, Technique, ManagedSerializableFieldData, ManagedSerializableTypeInfoRef, TResourceHandleBase< true >, CJoint, ManagedSerializableDiff::ModifiedArray, TonemappingSettings, CLight, MeshBase, GameObject, Skybox, ManagedSerializableDiff::ModifiedObject, SerializedObject, CGUIWidget, SpriteTexture, ManagedSerializableTypeInfoPrimitive, CD6Joint, Prefab, MorphChannel, DockManagerLayout, CReflectionProbe, FPhysicsMesh, VertexDataDesc, Font, ManagedSerializableDiff::ModifiedDictionaryEntry, GpuResourceData, SerializedSubObject, CRenderable, ResourceManifest, TextureImportOptions, ManagedSerializableTypeInfo, FontImportOptions, GUIElementStyle, CDistanceJoint, AutoExposureSettings, CAudioListener, PhysicsMaterial, ManagedResource, PrefabObjectDiff, GUISkin, ManagedSerializableDiff::ModifiedArrayEntry, CCapsuleCollider, CBone, CHingeJoint, SerializedArrayEntry, Settings, CSkybox, CSliderJoint, ProjectResourceMeta, FPhysXMesh, PhysicsMesh, CPlaneCollider, MorphShape, Resource, AudioClipImportOptions, CBoxCollider, CSphereCollider, EditorWidgetLayout, CSphericalJoint, CMeshCollider, WindowFrameWidget, ManagedSerializableDiff::ModifiedField, CProfilerOverlay, WinPlatformInfo, ScriptCode, ImportedAnimationEvents, CFixedJoint, SerializedEntry, PostProcessSettings, PlainText, ProjectLibraryEntries, ShaderInclude, SavedResourceData, ManagedSerializableFieldKey, PlatformInfo, AnimationSplitInfo, ResourceMapping, ManagedSerializableDiff::Modification, GameSettings, ScriptCodeImportOptions, SerializedInstance, ProjectSettings, PrefabComponentDiff, FontBitmap, BuildData, ShaderImportOptions, ManagedSerializableDictionaryKeyValue, ImportOptions, ResourceMetaData, and ManagedResourceMetaData.

static RTTITypeBase* getRTTIStatic ( )
static

Returns an interface you can use to access class' Run Time Type Information.

UINT32 getTypeId ( ) const

Returns an unique type identifier of the class.

const String& getTypeName ( ) const

Returns the type name of the class.

Note
Name is not necessarily unique.
bool isDerivedFrom ( RTTITypeBase base)

Returns true if current RTTI class is derived from base (Or if it is the same type as base).

Member Data Documentation

Any mRTTIData
protected

Temporary per-instance data storage used during various RTTI operations.

Needed since there is one RTTI class instance per type and sometimes we need per-instance data.