Protected constructorPrivate _enginesPrivate _entityTracks which engines have loaded which entities. Key: entity name, Value: Set of engine class names
Private _entityCache of estimated bytes per row for each entity type. This avoids re-sampling the same entity type multiple times during a session.
Private _recordedTracks which engine instances have already recorded their entity loads. Uses WeakSet so engine instances can be garbage collected when no longer in use. This prevents false positive warnings when a subclass and base class share the same singleton.
Private Static Readonly DEFAULT_Default bytes per row when we can't sample (fallback)
Static InstanceReturns the singleton instance of BaseEngineRegistry
Private CheckPrivate CountPrivate EstimatePrivate EstimatePrivate EstimatePrivate GetGet registration info for a specific engine
The class name of the engine
The registration info or null if not found
The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
Get memory statistics for all registered engines
Memory statistics object
Private HasRecords that an engine has loaded a specific entity. If another engine has already loaded this entity, a warning is queued.
The class name of the engine loading the entity
The name of the entity being loaded
Records that an engine has loaded multiple entities. Convenience method for batch recording. Uses instance identity to prevent false positives when a subclass and base class share the same singleton (e.g., AIEngine extends AIEngineBase).
The engine instance that loaded the entities
Array of entity names being loaded
Register an engine instance with the registry. This is typically called automatically by BaseEngine during Config().
The engine instance to register
Optional className: stringOptional class name override (uses constructor name by default)
Private SampleProtected Static getReturns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.
BaseEngineRegistry is a central registry for tracking all BaseEngine instances.
It provides:
Example