Used to initialize all reflection based systems with consistent validation and to ensure we are only doing the assembly sweeping once. We can also use this to setup up compile-time validation of our Attribute-based systems such as Content and Microservices.
More...
Used to initialize all reflection based systems with consistent validation and to ensure we are only doing the assembly sweeping once. We can also use this to setup up compile-time validation of our Attribute-based systems such as Content and Microservices.
◆ GenerateReflectionCache()
void Beamable.Common.Reflection.ReflectionCache.GenerateReflectionCache |
( |
IReadOnlyList< string > |
assembliesToSweep | ) |
|
|
inline |
This is a very slow function call. It triggers a full sweep of all assemblies in the project and regenerate _perBaseTypeCache and _perAttributeCache. Then, it invokes all callbacks of all IReflectionSystem registered via RegisterReflectionSystem.
- Parameters
-
assembliesToSweep | A list of Assembly names for us to sweep in. |
◆ GetFirstSystemOfType< TReflectionUserSystem >()
TReflectionUserSystem Beamable.Common.Reflection.ReflectionCache.GetFirstSystemOfType< TReflectionUserSystem > |
( |
| ) |
|
|
inline |
Returns the first instance of the IReflectionSystem of type TReflectionUserSystem that was previously registered. Fails if no system of type TReflectionUserSystem is found.
- Type Constraints
-
TReflectionUserSystem | : | IReflectionSystem | |
◆ TryFindBaseTypesOfInterest()
Checks type to see if it matches any of the BaseTypeOfInterest that were registered with the reflection cache.
- Parameters
-
- Returns
- true, if a type was found. false otherwise.
◆ TryRegisterReflectionSystem()
bool Beamable.Common.Reflection.ReflectionCache.TryRegisterReflectionSystem |
( |
IReflectionSystem |
system | ) |
|
|
inline |
Registers a IReflectionSystem with the Reflection Cache System. This must be called before Beamable's initialization or you must manage the initialization of this cache yourself. You can find Beamable's systems at: API.cs and EditorAPI.cs, for runtime dependencies and editor dependencies respectively.
- Returns
- True if the system was successfully added, or false if the system already existed in the cache.
◆ TryRegisterTypeProvider()
Register a IReflectionTypeProvider with the cache. This must be called before Beamable's initialization or you must manage the initialization of this cache yourself. Type providers define which types should the ReflectionCache gather up and build maps around. See the properties of IReflectionTypeProvider for more info on how they are used.
- Returns
- True if the type provider was successfully added, or false if the provider already existed in the cache.
The documentation for this class was generated from the following files:
- com.beamable/Common/Runtime/ReflectionCache/ReflectionCache.cs
- com.beamable/Common/Runtime/ReflectionCache/ReflectionCache_Attributes.cs
- com.beamable/Common/Runtime/ReflectionCache/ReflectionCache_BaseTypes.cs