Add English documentation comments to all benchmark_cherrypick source files (adapters, scenarios, CLI, reporters, runner)

This commit is contained in:
Sergey Penkovsky
2025-08-06 23:15:28 +03:00
parent 01d82e1cd3
commit 134fc5207a
12 changed files with 114 additions and 1 deletions

View File

@@ -1,6 +1,11 @@
import 'package:cherrypick/cherrypick.dart';
import 'di_adapter.dart';
/// DIAdapter implementation for the CherryPick DI library.
///
/// Wraps a CherryPick [Scope] and provides methods
/// to setup modules, resolve dependencies, teardown,
/// and open nested sub-scopes for benchmarking.
class CherrypickDIAdapter implements DIAdapter {
Scope? _scope;
@@ -37,6 +42,8 @@ class CherrypickDIAdapter implements DIAdapter {
}
}
/// Internal adapter for a CherryPick sub-scope.
/// Used for simulating child/override DI scopes in benchmarks.
class _CherrypickSubScopeAdapter extends CherrypickDIAdapter {
final Scope _subScope;
_CherrypickSubScopeAdapter(this._subScope);

View File

@@ -1,9 +1,22 @@
import 'package:cherrypick/cherrypick.dart';
/// Abstraction for Dependency Injection (DI) Adapter.
///
/// Provides a uniform interface to setup, resolve, and teardown DI containers/modules
/// and open sub-scopes to benchmark them under different libraries.
abstract class DIAdapter {
/// Installs the provided modules into the DI container.
void setupModules(List<Module> modules);
/// Resolves an instance of type [T] by optional [named] tag.
T resolve<T>({String? named});
/// Asynchronously resolves an instance of type [T] by optional [named] tag.
Future<T> resolveAsync<T>({String? named});
/// Tears down or disposes of the DI container.
void teardown();
/// Opens a child DI sub-scope, useful for override/child-scope benchmarks.
DIAdapter openSubScope(String name);
}