Beamable SDK
Public Member Functions | List of all members
Beamable.Common.Reflection.IReflectionSystem Interface Reference

Implement on systems that want to perform an assembly sweep to cache reflection-related information. More...

Inheritance diagram for Beamable.Common.Reflection.IReflectionSystem:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Common.Reflection.IReflectionSystem:
Collaboration graph
[legend]

Public Member Functions

void ClearCachedReflectionData ()
 Called once on each IReflectionSystem before building the reflection cache. Exists mostly to deal with the fact that Unity's initialization hooks are weird and seem to trigger twice when entering playmode. More...
 
void OnSetupForCacheGeneration ()
 Called once on each IReflectionSystem before building the reflection cache. More...
 
void OnReflectionCacheBuilt (PerBaseTypeCache perBaseTypeCache, PerAttributeCache perAttributeCache)
 Called once per ReflectionCache.GenerateReflectionCache invocation after the assembly sweep ReflectionCache.RebuildReflectionCache is completed. More...
 
void OnBaseTypeOfInterestFound (BaseTypeOfInterest baseType, IReadOnlyList< MemberInfo > cachedSubTypes)
 Called once per declared IReflectionTypeProvider.BaseTypesOfInterest with each base type and the cached list of types for which Type.IsAssignableFrom returns true. More...
 
void OnAttributeOfInterestFound (AttributeOfInterest attributeType, IReadOnlyList< MemberAttribute > cachedMemberAttributes)
 Called once per declared IReflectionTypeProvider.AttributesOfInterest. More...
 
void SetStorage (IBeamHintGlobalStorage hintGlobalStorage)
 Injection point for reflections systems that wish to generate hints. Leave without implementation if no hints are generated. Remember to wrap hint code in "#if UNITY_EDITOR" directives as this storage instance is null during non-editor builds. More...
 

Additional Inherited Members

- Properties inherited from Beamable.Common.Reflection.IReflectionTypeProvider
List< BaseTypeOfInterestBaseTypesOfInterest [get]
 List of BaseTypeOfInterest this provider adds to the assembly sweep.
 
List< AttributeOfInterestAttributesOfInterest [get]
 List of AttributeOfInterest this provider adds to the assembly sweep.
 

Detailed Description

Implement on systems that want to perform an assembly sweep to cache reflection-related information.

Member Function Documentation

◆ ClearCachedReflectionData()

void Beamable.Common.Reflection.IReflectionSystem.ClearCachedReflectionData ( )

Called once on each IReflectionSystem before building the reflection cache. Exists mostly to deal with the fact that Unity's initialization hooks are weird and seem to trigger twice when entering playmode.

Implemented in Beamable.Server.Editor.MicroserviceReflectionCache.Registry, Beamable.Editor.Reflection.BeamHintReflectionCache.Registry, and Beamable.Reflection.BeamReflectionCache.Registry.

◆ OnAttributeOfInterestFound()

void Beamable.Common.Reflection.IReflectionSystem.OnAttributeOfInterestFound ( AttributeOfInterest  attributeType,
IReadOnlyList< MemberAttribute cachedMemberAttributes 
)

Called once per declared IReflectionTypeProvider.AttributesOfInterest.

Parameters
attributeTypeThe attribute type of interest.
cachedMemberAttributesThe list of all MemberInfo and Attribute instances matching attributeType that were found in the assembly sweep.

Implemented in Beamable.Server.Editor.MicroserviceReflectionCache.Registry, Beamable.Editor.Reflection.BeamHintReflectionCache.Registry, and Beamable.Reflection.BeamReflectionCache.Registry.

◆ OnBaseTypeOfInterestFound()

void Beamable.Common.Reflection.IReflectionSystem.OnBaseTypeOfInterestFound ( BaseTypeOfInterest  baseType,
IReadOnlyList< MemberInfo >  cachedSubTypes 
)

Called once per declared IReflectionTypeProvider.BaseTypesOfInterest with each base type and the cached list of types for which Type.IsAssignableFrom returns true.

Parameters
baseTypeThe base type of interest.
cachedSubTypesThe list of types for which Type.IsAssignableFrom returns true.

Implemented in Beamable.Server.Editor.MicroserviceReflectionCache.Registry, Beamable.Editor.Reflection.BeamHintReflectionCache.Registry, and Beamable.Reflection.BeamReflectionCache.Registry.

◆ OnReflectionCacheBuilt()

void Beamable.Common.Reflection.IReflectionSystem.OnReflectionCacheBuilt ( PerBaseTypeCache  perBaseTypeCache,
PerAttributeCache  perAttributeCache 
)

Called once per ReflectionCache.GenerateReflectionCache invocation after the assembly sweep ReflectionCache.RebuildReflectionCache is completed.

Parameters
perBaseTypeCacheCurrent cached Per-Base Type information.
perAttributeCacheCurrently cached Per-Attribute information.

Implemented in Beamable.Server.Editor.MicroserviceReflectionCache.Registry, Beamable.Editor.Reflection.BeamHintReflectionCache.Registry, and Beamable.Reflection.BeamReflectionCache.Registry.

◆ OnSetupForCacheGeneration()

void Beamable.Common.Reflection.IReflectionSystem.OnSetupForCacheGeneration ( )

◆ SetStorage()

void Beamable.Common.Reflection.IReflectionSystem.SetStorage ( IBeamHintGlobalStorage  hintGlobalStorage)

Injection point for reflections systems that wish to generate hints. Leave without implementation if no hints are generated. Remember to wrap hint code in "#if UNITY_EDITOR" directives as this storage instance is null during non-editor builds.

Implemented in Beamable.Server.Editor.MicroserviceReflectionCache.Registry, Beamable.Editor.Reflection.BeamHintReflectionCache.Registry, and Beamable.Reflection.BeamReflectionCache.Registry.


The documentation for this interface was generated from the following file: