Skip to content

Commit

Permalink
Renaming and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed May 7, 2024
1 parent 52a4c37 commit 3d47ff1
Show file tree
Hide file tree
Showing 46 changed files with 136 additions and 150 deletions.
6 changes: 3 additions & 3 deletions readme/EnumDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ partial class Enum
[MethodImpl((MethodImplOptions)0x100)]
public partial Benchmarks.Model.CompositionRoot TestPureDIByCR()
{
[MethodImpl((MethodImplOptions)0x200)]
IEnumerable<Benchmarks.Model.IService3> Local_perBlock10_IEnumerable()
[MethodImpl((MethodImplOptions)0x100)]
IEnumerable<Benchmarks.Model.IService3> EnumerationOf_perBlock10_IEnumerable()
{
yield return new Benchmarks.Model.Service3(new Benchmarks.Model.Service4(), new Benchmarks.Model.Service4());
yield return new Benchmarks.Model.Service3v2(new Benchmarks.Model.Service4(), new Benchmarks.Model.Service4());
yield return new Benchmarks.Model.Service3v3(new Benchmarks.Model.Service4(), new Benchmarks.Model.Service4());
yield return new Benchmarks.Model.Service3v4(new Benchmarks.Model.Service4(), new Benchmarks.Model.Service4());
}
IEnumerable<Benchmarks.Model.IService3> perBlock10_IEnumerable = Local_perBlock10_IEnumerable();
IEnumerable<Benchmarks.Model.IService3> perBlock10_IEnumerable = EnumerationOf_perBlock10_IEnumerable();
return new Benchmarks.Model.CompositionRoot(new Benchmarks.Model.Service1(new Benchmarks.Model.Service2Enum(perBlock10_IEnumerable)), new Benchmarks.Model.Service2Enum(perBlock10_IEnumerable), new Benchmarks.Model.Service2Enum(perBlock10_IEnumerable), new Benchmarks.Model.Service2Enum(perBlock10_IEnumerable), new Benchmarks.Model.Service3(new Benchmarks.Model.Service4(), new Benchmarks.Model.Service4()), new Benchmarks.Model.Service4(), new Benchmarks.Model.Service4());
}

Expand Down
8 changes: 4 additions & 4 deletions readme/SingletonDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ classDiagram
partial class Singleton
{
private readonly Singleton _root;
private Benchmarks.Model.Service1 _scoped37_Service1;
private Benchmarks.Model.Service4 _scoped40_Service4;
private Benchmarks.Model.Service1? _scoped37_Service1;
private Benchmarks.Model.Service4? _scoped40_Service4;

public Singleton()
{
Expand All @@ -92,9 +92,9 @@ partial class Singleton
}
if (_scoped37_Service1 == null)
{
_scoped37_Service1 = new Benchmarks.Model.Service1(new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4)));
_scoped37_Service1 = new Benchmarks.Model.Service1(new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!)));
}
return new Benchmarks.Model.CompositionRoot(_scoped37_Service1, new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4)), new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4)), new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4)), new Benchmarks.Model.Service3(_scoped40_Service4, _scoped40_Service4), _scoped40_Service4, _scoped40_Service4);
return new Benchmarks.Model.CompositionRoot(_scoped37_Service1!, new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!)), new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!)), new Benchmarks.Model.Service2(new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!)), new Benchmarks.Model.Service3(_scoped40_Service4!, _scoped40_Service4!), _scoped40_Service4!, _scoped40_Service4!);
}

[MethodImpl((MethodImplOptions)0x100)]
Expand Down
7 changes: 3 additions & 4 deletions readme/accumulators.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ partial class Composition
{
private readonly Composition _root;
private readonly object _lock;
private XyzDependency _singleton38_XyzDependency;
private XyzDependency? _singleton38_XyzDependency;

public Composition()
{
Expand Down Expand Up @@ -123,8 +123,7 @@ partial class Composition
_singleton38_XyzDependencyTemp = new XyzDependency();
accumulator42.Add(_singleton38_XyzDependencyTemp);
Thread.MemoryBarrier();
_singleton38_XyzDependency = _singleton38_XyzDependencyTemp;
_root._singleton38_XyzDependency = _singleton38_XyzDependency;
_root._singleton38_XyzDependency = _singleton38_XyzDependencyTemp;
}
}
}
Expand All @@ -133,7 +132,7 @@ partial class Composition
{
accumulator42.Add(transient3_AbcDependency);
}
Service transient1_Service = new Service(transient3_AbcDependency, _root._singleton38_XyzDependency, perBlock4_AbcDependency);
Service transient1_Service = new Service(transient3_AbcDependency, _root._singleton38_XyzDependency!, perBlock4_AbcDependency);
lock (_lock)
{
accumulator42.Add(transient1_Service);
Expand Down
4 changes: 2 additions & 2 deletions readme/advanced-interception.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class Service(IDependency dependency) : IService

internal partial class Composition: IInterceptor
{
private readonly List<string> _log;
private readonly List<string> _log = new();
private static readonly IProxyBuilder ProxyBuilder = new DefaultProxyBuilder();
private readonly IInterceptor[] _interceptors;
private readonly IInterceptor[] _interceptors = [];

public Composition(List<string> log)
: this()
Expand Down
6 changes: 3 additions & 3 deletions readme/async-disposable-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ partial class Composition: IDisposable, IAsyncDisposable
private readonly object _lock;
private object[] _disposables;
private int _disposeIndex;
private Dependency _scoped36_Dependency;
private Dependency? _scoped36_Dependency;

public Composition()
{
Expand Down Expand Up @@ -172,7 +172,7 @@ partial class Composition: IDisposable, IAsyncDisposable
}
}
}
return new Service(_scoped36_Dependency);
return new Service(_scoped36_Dependency!);
}
}

Expand All @@ -190,7 +190,7 @@ partial class Composition: IDisposable, IAsyncDisposable
var value_1 = new Session(transient2_Composition);
return value_1;
});
return new Program(perResolve43_Func);
return new Program(perResolve43_Func!);
}
}

Expand Down
10 changes: 5 additions & 5 deletions readme/async-disposable-singleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ partial class Composition: IDisposable, IAsyncDisposable
private readonly object _lock;
private object[] _disposables;
private int _disposeIndex;
private Dependency _singleton36_Dependency;
private Dependency? _singleton36_Dependency;

public Composition()
{
Expand All @@ -106,6 +106,7 @@ partial class Composition: IDisposable, IAsyncDisposable
{
_root = parentScope._root;
_lock = _root._lock;
_disposables = parentScope._disposables;
}

public IService Root
Expand All @@ -119,13 +120,12 @@ partial class Composition: IDisposable, IAsyncDisposable
{
if (_root._singleton36_Dependency == null)
{
_singleton36_Dependency = new Dependency();
_root._singleton36_Dependency = _singleton36_Dependency;
_root._disposables[_root._disposeIndex++] = _singleton36_Dependency;
_root._singleton36_Dependency = new Dependency();
_root._disposables[_root._disposeIndex++] = _root._singleton36_Dependency;
}
}
}
return new Service(_root._singleton36_Dependency);
return new Service(_root._singleton36_Dependency!);
}
}

Expand Down
7 changes: 4 additions & 3 deletions readme/async-enumerable.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ partial class Composition
[MethodImpl((MethodImplOptions)0x100)]
get
{
[MethodImpl((MethodImplOptions)0x200)]
async IAsyncEnumerable<IDependency> Local_transient1_IAsyncEnumerable()
[MethodImpl((MethodImplOptions)0x100)]
async IAsyncEnumerable<IDependency> EnumerationOf_transient1_IAsyncEnumerable()
{
yield return new AbcDependency();
yield return new XyzDependency();
await Task.CompletedTask;
}
IAsyncEnumerable<IDependency> transient1_IAsyncEnumerable = Local_transient1_IAsyncEnumerable();
IAsyncEnumerable<IDependency> transient1_IAsyncEnumerable = EnumerationOf_transient1_IAsyncEnumerable();
return new Service(transient1_IAsyncEnumerable);
}
}
Expand Down
6 changes: 3 additions & 3 deletions readme/auto-scoped.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ partial class Composition
{
private readonly Composition _root;
private readonly object _lock;
private Dependency _scoped36_Dependency;
private Dependency? _scoped36_Dependency;

public Composition()
{
Expand Down Expand Up @@ -137,7 +137,7 @@ partial class Composition
}
}
}
return new Service(_scoped36_Dependency);
return new Service(_scoped36_Dependency!);
}
}

Expand All @@ -162,7 +162,7 @@ partial class Composition
var value_1 = transient1_IService;
return value_1;
});
return new Program(perResolve43_Func);
return new Program(perResolve43_Func!);
}
}

Expand Down
12 changes: 5 additions & 7 deletions readme/default-lifetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ partial class Composition
{
private readonly Composition _root;
private readonly object _lock;
private Service _singleton37_Service;
private Dependency _singleton36_Dependency;
private Service? _singleton37_Service;
private Dependency? _singleton36_Dependency;

public Composition()
{
Expand All @@ -107,15 +107,13 @@ partial class Composition
{
if (_root._singleton36_Dependency == null)
{
_singleton36_Dependency = new Dependency();
_root._singleton36_Dependency = _singleton36_Dependency;
_root._singleton36_Dependency = new Dependency();
}
_singleton37_Service = new Service(_singleton36_Dependency, _root._singleton36_Dependency);
_root._singleton37_Service = _singleton37_Service;
_root._singleton37_Service = new Service(_root._singleton36_Dependency!, _root._singleton36_Dependency!);
}
}
}
return _root._singleton37_Service;
return _root._singleton37_Service!;
}
}

Expand Down
10 changes: 5 additions & 5 deletions readme/disposable-singleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ partial class Composition: IDisposable
private readonly object _lock;
private object[] _disposables;
private int _disposeIndex;
private Dependency _singleton36_Dependency;
private Dependency? _singleton36_Dependency;

public Composition()
{
Expand All @@ -99,6 +99,7 @@ partial class Composition: IDisposable
{
_root = parentScope._root;
_lock = _root._lock;
_disposables = parentScope._disposables;
}

public IService Root
Expand All @@ -112,13 +113,12 @@ partial class Composition: IDisposable
{
if (_root._singleton36_Dependency == null)
{
_singleton36_Dependency = new Dependency();
_root._singleton36_Dependency = _singleton36_Dependency;
_root._disposables[_root._disposeIndex++] = _singleton36_Dependency;
_root._singleton36_Dependency = new Dependency();
_root._disposables[_root._disposeIndex++] = _root._singleton36_Dependency;
}
}
}
return new Service(_root._singleton36_Dependency);
return new Service(_root._singleton36_Dependency!);
}
}

Expand Down
12 changes: 6 additions & 6 deletions readme/enumerable-generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ partial class Composition
[MethodImpl((MethodImplOptions)0x100)]
get
{
[MethodImpl((MethodImplOptions)0x200)]
IEnumerable<IDependency<int>> Local_perBlock1_IEnumerable()
[MethodImpl((MethodImplOptions)0x100)]
IEnumerable<IDependency<int>> EnumerationOf_perBlock1_IEnumerable()
{
yield return new AbcDependency<int>();
yield return new XyzDependency<int>();
}
IEnumerable<IDependency<int>> perBlock1_IEnumerable = Local_perBlock1_IEnumerable();
IEnumerable<IDependency<int>> perBlock1_IEnumerable = EnumerationOf_perBlock1_IEnumerable();
return new Service<int>(perBlock1_IEnumerable);
}
}
Expand All @@ -144,13 +144,13 @@ partial class Composition
[MethodImpl((MethodImplOptions)0x100)]
get
{
[MethodImpl((MethodImplOptions)0x200)]
IEnumerable<IDependency<string>> Local_perBlock1_IEnumerable()
[MethodImpl((MethodImplOptions)0x100)]
IEnumerable<IDependency<string>> EnumerationOf_perBlock1_IEnumerable()
{
yield return new AbcDependency<string>();
yield return new XyzDependency<string>();
}
IEnumerable<IDependency<string>> perBlock1_IEnumerable = Local_perBlock1_IEnumerable();
IEnumerable<IDependency<string>> perBlock1_IEnumerable = EnumerationOf_perBlock1_IEnumerable();
return new Service<string>(perBlock1_IEnumerable);
}
}
Expand Down
6 changes: 3 additions & 3 deletions readme/enumerable.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ partial class Composition
[MethodImpl((MethodImplOptions)0x100)]
get
{
[MethodImpl((MethodImplOptions)0x200)]
IEnumerable<IDependency> Local_perBlock1_IEnumerable()
[MethodImpl((MethodImplOptions)0x100)]
IEnumerable<IDependency> EnumerationOf_perBlock1_IEnumerable()
{
yield return new AbcDependency();
yield return new XyzDependency();
}
IEnumerable<IDependency> perBlock1_IEnumerable = Local_perBlock1_IEnumerable();
IEnumerable<IDependency> perBlock1_IEnumerable = EnumerationOf_perBlock1_IEnumerable();
return new Service(perBlock1_IEnumerable);
}
}
Expand Down
7 changes: 3 additions & 4 deletions readme/func-with-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ partial class Composition
{
private readonly Composition _root;
private readonly object _lock;
private Clock _singleton36_Clock;
private Clock? _singleton36_Clock;

public Composition()
{
Expand Down Expand Up @@ -141,12 +141,11 @@ partial class Composition
{
if (_root._singleton36_Clock == null)
{
_singleton36_Clock = new Clock();
_root._singleton36_Clock = _singleton36_Clock;
_root._singleton36_Clock = new Clock();
}
}
}
var dependency_1 = new Dependency(_root._singleton36_Clock, transient3_Int32);
var dependency_1 = new Dependency(_root._singleton36_Clock!, transient3_Int32);
return dependency_1;
};
return new Service(transient1_Func);
Expand Down
2 changes: 1 addition & 1 deletion readme/func-with-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ partial class Composition
var value_1 = new Dependency();
return value_1;
});
return new Service(perResolve39_Func);
return new Service(perResolve39_Func!);
}
}

Expand Down
2 changes: 1 addition & 1 deletion readme/func.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ partial class Composition
var value_1 = new Dependency();
return value_1;
});
return new Service(perResolve39_Func);
return new Service(perResolve39_Func!);
}
}

Expand Down
12 changes: 5 additions & 7 deletions readme/keyed-service-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ partial class Composition
{
private readonly Composition _root;
private readonly object _lock;
private Dependency _singleton36_Dependency;
private Dependency? _singleton36_Dependency;

public Composition()
{
Expand All @@ -111,12 +111,11 @@ partial class Composition
{
if (_root._singleton36_Dependency == null)
{
_singleton36_Dependency = new Dependency();
_root._singleton36_Dependency = _singleton36_Dependency;
_root._singleton36_Dependency = new Dependency();
}
}
}
return _root._singleton36_Dependency;
return _root._singleton36_Dependency!;
}
}

Expand All @@ -131,12 +130,11 @@ partial class Composition
{
if (_root._singleton36_Dependency == null)
{
_singleton36_Dependency = new Dependency();
_root._singleton36_Dependency = _singleton36_Dependency;
_root._singleton36_Dependency = new Dependency();
}
}
}
return new Service(_root._singleton36_Dependency);
return new Service(_root._singleton36_Dependency!);
}
}

Expand Down
2 changes: 1 addition & 1 deletion readme/lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ partial class Composition
});
Lazy<IDependency> transient1_Lazy;
{
var factory_2 = perResolve40_Func;
var factory_2 = perResolve40_Func!;
transient1_Lazy = new Lazy<IDependency>(factory_2, true);
}
return new Service(transient1_Lazy);
Expand Down
Loading

0 comments on commit 3d47ff1

Please sign in to comment.