getSingletonCount method
Returns the total number of pods registered.
This method provides a count of all pods currently registered, which is useful for monitoring, capacity planning, and testing.
Returns the total number of pods in the registry. Returns 0 if the registry is empty.
Example:
final count = registry.getCount();
print('Total pods registered: $count');
if (count == 0) {
print('Registry is empty - initializing default pods...');
initializeDefaultPods(registry);
}
Implementation
@override
int getSingletonCount() {
int count = getPodFactory().getSingletonCount();
if (_parent != null) {
count += _parent!.getPodFactory().getSingletonCount();
}
return count;
}