From bb0027ec8180f1ae6745955c2e342eb496c2ed1c Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Wed, 27 Sep 2017 22:49:30 +0200 Subject: [PATCH 01/14] objectpooladapter for microsoft ext --- Directory.Build.props | 47 +++++++++++++++ ObjectPool.sln | 10 +++- ...jectPool.MicrosoftExtensionsAdapter.csproj | 22 +++++++ .../ObjectPoolAdapter.cs | 59 +++++++++++++++++++ .../CodeProject.ObjectPool.csproj | 40 +------------ .../Properties/AssemblyInfo.cs | 5 -- 6 files changed, 140 insertions(+), 43 deletions(-) create mode 100644 Directory.Build.props create mode 100644 src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj create mode 100644 src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..c7f6fbd --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,47 @@ + + + 3.2.0 + 3.0.0 + + + + Ofir Makmal <ofir.makmal@gmail.com>;Alessio Parma <alessio.parma@gmail.com> + Copyright (c) 2013 Ofir Makmal <ofir.makmal@gmail.com> + /~https://github.com/pomma89/ObjectPool/releases + http://pomma89.altervista.org/objectpool/logo-128.png + /~https://github.com/pomma89/ObjectPool + http://www.codeproject.com/info/cpol10.aspx + git + /~https://github.com/pomma89/ObjectPool + + + + + + + + + + $(DefineConstants);NETSTD10;LIBLOG_PORTABLE + + + + $(DefineConstants);NETSTD12;LIBLOG_PORTABLE + + + + $(DefineConstants);NETSTD13;LIBLOG_PORTABLE + + + + $(DefineConstants);NETSTD20 + + + + $(DefineConstants);NET40;HAS_SERIALIZABLE + + + + $(DefineConstants);NET45;HAS_SERIALIZABLE + + diff --git a/ObjectPool.sln b/ObjectPool.sln index 8fcf86f..fbf223b 100644 --- a/ObjectPool.sln +++ b/ObjectPool.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.15 +VisualStudioVersion = 15.0.26730.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{4C2B7C0C-7CDD-4125-B57A-88E168D24190}" ProjectSection(SolutionItems) = preProject @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{4C2B7C0C-7 build.cake = build.cake CHANGELOG.md = CHANGELOG.md config.wyam = config.wyam + Directory.Build.props = Directory.Build.props LICENSE.htm = LICENSE.htm NuGet.Config = NuGet.Config pomma89.snk = pomma89.snk @@ -45,6 +46,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{DA3DC42C tools\packages.config = tools\packages.config EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeProject.ObjectPool.MicrosoftExtensionsAdapter", "src\CodeProject.ObjectPool.MicrosoftExtensionsAdapter\CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj", "{1B2704CE-B3C5-4566-A932-C339E6BDD1CC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -67,6 +70,10 @@ Global {362C2E4A-3EE7-41BE-A233-70649B258439}.Debug|Any CPU.Build.0 = Debug|Any CPU {362C2E4A-3EE7-41BE-A233-70649B258439}.Release|Any CPU.ActiveCfg = Release|Any CPU {362C2E4A-3EE7-41BE-A233-70649B258439}.Release|Any CPU.Build.0 = Release|Any CPU + {1B2704CE-B3C5-4566-A932-C339E6BDD1CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1B2704CE-B3C5-4566-A932-C339E6BDD1CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1B2704CE-B3C5-4566-A932-C339E6BDD1CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1B2704CE-B3C5-4566-A932-C339E6BDD1CC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -77,6 +84,7 @@ Global {9C66B27C-8424-4D2E-A033-612776D59202} = {69DFB95F-7861-4E90-ABC1-33F75FBE67AF} {362C2E4A-3EE7-41BE-A233-70649B258439} = {69DFB95F-7861-4E90-ABC1-33F75FBE67AF} {DA3DC42C-80E7-4559-9737-F13BE6F4565C} = {4C2B7C0C-7CDD-4125-B57A-88E168D24190} + {1B2704CE-B3C5-4566-A932-C339E6BDD1CC} = {750142DD-9B82-47CB-A2D5-71E4950843D2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4C81698D-E18E-4669-B9D3-7FEFA57C794D} diff --git a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj new file mode 100644 index 0000000..34edc6a --- /dev/null +++ b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj @@ -0,0 +1,22 @@ + + + CodeProject.ObjectPool.MicrosoftExtensionsAdapter + Generic and concurrent Object Pool - Adapter for Microsoft Extensions + netstandard2.0;net461 + true + ../../pomma89.snk + true + true + + + + + + + + + All + + + + \ No newline at end of file diff --git a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs new file mode 100644 index 0000000..e963a45 --- /dev/null +++ b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs @@ -0,0 +1,59 @@ +// File name: ObjectPoolAdapter.cs +// +// Author(s): Alessio Parma +// +// The MIT License (MIT) +// +// Copyright (c) 2013-2018 Alessio Parma +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +// associated documentation files (the "Software"), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, publish, distribute, +// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +using System; + +namespace CodeProject.ObjectPool.MicrosoftExtensionsAdapter +{ + /// + /// Adapts an implementation to + /// abstract class. + /// + /// + public sealed class ObjectPoolAdapter : Microsoft.Extensions.ObjectPool.ObjectPool + where T : PooledObject + { + private readonly IObjectPool _adaptedObjectPool; + + /// + /// Adapts given object pool. + /// + /// The object pool that needs to be adapted. + public ObjectPoolAdapter(IObjectPool objectPool) + { + _adaptedObjectPool = objectPool ?? throw new ArgumentNullException(nameof(objectPool)); + } + + /// + /// Retrieves an object from the pool. + /// + /// An object from the pool. + public override T Get() => _adaptedObjectPool.GetObject(); + + /// + /// Returns given object to the pool. + /// + /// The object that should return to the pool. + public override void Return(T obj) => obj?.Dispose(); + } +} \ No newline at end of file diff --git a/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj b/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj index f86b86e..e90bfe8 100644 --- a/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj +++ b/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj @@ -2,13 +2,11 @@ CodeProject.ObjectPool Generic and concurrent Object Pool - 3.2.0 netstandard1.0;netstandard1.2;netstandard1.3;netstandard2.0;net40;net45 true ../../pomma89.snk true true - false @@ -16,70 +14,38 @@ Generic and concurrent Object Pool A generic, concurrent, portable and flexible Object Pool for the .NET Framework. $(Summary) It is completely based on the Code Project article of Ofir Makmal (http://goo.gl/4qig6T). Library is production ready and it is successfully working in real life systems. Original source code has been modified, in order to introduce a Parameterized Object Pool, already drafted by Ofir Makmal in the comments of the article. Moreover, a few unit tests have been added, in order to improve code reliability, and a lot of other small changes have also been applied. Of course, all modified source code is freely available at the project URL of this package. Many thanks to Ofir Makmal for his great work. - Ofir Makmal <ofir.makmal@gmail.com>;Alessio Parma <alessio.parma@gmail.com> - Copyright (c) 2013 Ofir Makmal <ofir.makmal@gmail.com> - /~https://github.com/pomma89/ObjectPool/releases - http://pomma89.altervista.org/objectpool/logo-128.png - /~https://github.com/pomma89/ObjectPool - http://www.codeproject.com/info/cpol10.aspx codeproject;object;pool;concurrent;generic;threadsafe;portable;netstandard;stringbuilder;memorystream - git - /~https://github.com/pomma89/ObjectPool - - - + + All + - - $(DefineConstants);NETSTD10;LIBLOG_PORTABLE - - - - $(DefineConstants);NETSTD12;LIBLOG_PORTABLE - - - - $(DefineConstants);NETSTD13;LIBLOG_PORTABLE - - - - $(DefineConstants);NETSTD20 - - - - $(DefineConstants);NET40;HAS_SERIALIZABLE - - - - $(DefineConstants);NET45;HAS_SERIALIZABLE - - diff --git a/src/CodeProject.ObjectPool/Properties/AssemblyInfo.cs b/src/CodeProject.ObjectPool/Properties/AssemblyInfo.cs index 3b842b4..5cc8055 100644 --- a/src/CodeProject.ObjectPool/Properties/AssemblyInfo.cs +++ b/src/CodeProject.ObjectPool/Properties/AssemblyInfo.cs @@ -9,14 +9,9 @@ */ using System; -using System.Reflection; using System.Runtime.InteropServices; using System.Security; -// General Information about an assembly is controlled through the following set of attributes. -// Change these attribute values to modify the information associated with an assembly. -[assembly: AssemblyVersion("3.0.0")] - // Setting ComVisible to false makes the types in this assembly not visible to COM components. If you // need to access a type in this assembly from COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] From 9c9e11b16cebe6fa5ccb1e60f5cf6c22e81651c5 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Wed, 27 Sep 2017 22:55:01 +0200 Subject: [PATCH 02/14] v3.2.1 --- CHANGELOG.md | 4 ++++ Directory.Build.props | 4 ++-- README.md | 2 +- appveyor.yml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c7b60..570164c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog for CodeProject.ObjectPool # +### v3.2.1 (2017-09-27) + +* Added an adapter for Microsoft.Extensions.ObjectPool. + ### v3.2.0 (2017-08-16) * Added support for .NET Standard 2.0. diff --git a/Directory.Build.props b/Directory.Build.props index c7f6fbd..4c194f3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 3.2.0 + 3.2.1 3.0.0 @@ -44,4 +44,4 @@ $(DefineConstants);NET45;HAS_SERIALIZABLE - + \ No newline at end of file diff --git a/README.md b/README.md index 2a8697c..3a050c5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Summary ## -* Latest release version: `v3.2.0` +* Latest release version: `v3.2.1` * Build status on [Travis CI](https://travis-ci.org): [![Build Status](https://travis-ci.org/pomma89/ObjectPool.svg?branch=master)](https://travis-ci.org/pomma89/ObjectPool) * Build status on [AppVeyor](https://www.appveyor.com/): [![Build status](https://ci.appveyor.com/api/projects/status/cgldtxe3p9v7nf0i/branch/master?svg=true)](https://ci.appveyor.com/project/pomma89/objectpool/branch/master) * [Doxygen](http://www.stack.nl/~dimitri/doxygen/index.html) documentation: diff --git a/appveyor.yml b/appveyor.yml index a91e7be..cd78471 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.2.0.{build} +version: 3.2.1.{build} image: Visual Studio 2017 build_script: - ps: .\build.ps1 From 4645b8a5305b470c4376bb89ec10fde7b5ea6af0 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Wed, 27 Sep 2017 22:56:22 +0200 Subject: [PATCH 03/14] api --- .../PooledObjectInfo/7C18C1AA.html | 6 +- .../PooledObjectInfo/index.html | 2 +- .../CodeProject.ObjectPool.Core/index.html | 1 + .../LogProvider/index.html | 2 +- .../CodeProject.ObjectPool.Logging/index.html | 3 +- .../MemoryStreamPool/A3099D76.html | 2 +- .../MemoryStreamPool/index.html | 2 +- .../PooledMemoryStream/index.html | 2 +- .../PooledStringBuilder/index.html | 2 +- .../StringBuilderPool/F9DE04DD.html | 2 +- .../StringBuilderPool/index.html | 2 +- .../index.html | 1 + .../IObjectPool_1/index.html | 34 +-- .../ObjectPool_1/index.html | 14 +- .../PooledObject/85048E65.html | 2 +- .../PooledObject/index.html | 16 +- .../PooledObjectWrapper_1/index.html | 2 +- docs/api/CodeProject.ObjectPool/index.html | 5 + docs/api/CodeProject/index.html | 1 + docs/api/global/index.html | 1 + docs/api/index.html | 4 + docs/assets/js/searchIndex.js | 234 ++++++++++-------- docs/feed.atom | 2 +- docs/feed.rss | 4 +- 24 files changed, 187 insertions(+), 159 deletions(-) diff --git a/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/7C18C1AA.html b/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/7C18C1AA.html index a12235f..ec958bd 100644 --- a/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/7C18C1AA.html +++ b/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/7C18C1AA.html @@ -169,7 +169,7 @@

Equals(object) Method

Summary

- Determines whether the specified System.Object is equal to the current PooledObjectInfo. + Determines whether the specified object is equal to the current PooledObjectInfo.
@@ -207,7 +207,7 @@

Parameters

obj object - The System.Object to compare with the current PooledObjectInfo. + The object to compare with the current PooledObjectInfo.
@@ -226,7 +226,7 @@

Return Value

bool - true if the specified System.Object is equal to the current + true if the specified object is equal to the current PooledObjectInfo; otherwise, false. diff --git a/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/index.html b/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/index.html index 59b08da..f3d5552 100644 --- a/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/index.html +++ b/docs/api/CodeProject.ObjectPool.Core/PooledObjectInfo/index.html @@ -281,7 +281,7 @@

Methods

bool
- Determines whether the specified System.Object is equal to the current PooledObjectInfo. + Determines whether the specified object is equal to the current PooledObjectInfo.
diff --git a/docs/api/CodeProject.ObjectPool.Core/index.html b/docs/api/CodeProject.ObjectPool.Core/index.html index be45439..498bba5 100644 --- a/docs/api/CodeProject.ObjectPool.Core/index.html +++ b/docs/api/CodeProject.ObjectPool.Core/index.html @@ -143,6 +143,7 @@
  • global
  • diff --git a/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html b/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html index 3136ee4..7676b2a 100644 --- a/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html +++ b/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html @@ -165,7 +165,7 @@

    LogProvider Class

    Summary

    - Provides a mechanism to create instances of CodeProject.ObjectPool.Logging.ILog objects. + Provides a mechanism to create instances of ILog objects.
    diff --git a/docs/api/CodeProject.ObjectPool.Logging/index.html b/docs/api/CodeProject.ObjectPool.Logging/index.html index d5289e9..a1b14b8 100644 --- a/docs/api/CodeProject.ObjectPool.Logging/index.html +++ b/docs/api/CodeProject.ObjectPool.Logging/index.html @@ -145,6 +145,7 @@
  • global
  • @@ -238,7 +239,7 @@

    Class Types

    LogProvider - Provides a mechanism to create instances of CodeProject.ObjectPool.Logging.ILog objects. + Provides a mechanism to create instances of ILog objects. diff --git a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html index 9a4624d..377690c 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html @@ -180,7 +180,7 @@

    MaximumMemoryStreamCapacity Property

    Summary

    - Maximum capacity a MemoryStream might have in order to be able to return + Maximum capacity a System.IO.MemoryStream might have in order to be able to return to pool. Defaults to DefaultMaximumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html index 85a2418..3c12a15 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html @@ -338,7 +338,7 @@

    Properties

    int
    - Maximum capacity a MemoryStream might have in order to be able to return + Maximum capacity a System.IO.MemoryStream might have in order to be able to return to pool. Defaults to DefaultMaximumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html index fdec606..db1cebd 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html @@ -338,7 +338,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html index e1d441b..0a76d65 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html @@ -348,7 +348,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html index caf3a62..a33b0c0 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html @@ -181,7 +181,7 @@

    MinimumStringBuilderCapacity Property

    Summary

    - Minimum capacity a StringBuilder should have when created and this is the + Minimum capacity a System.Text.StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html index 0108f24..4c937e1 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html @@ -359,7 +359,7 @@

    Properties

    int
    - Minimum capacity a StringBuilder should have when created and this is the + Minimum capacity a System.Text.StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/index.html b/docs/api/CodeProject.ObjectPool.Specialized/index.html index 626d584..0f263a9 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/index.html @@ -143,6 +143,7 @@
  • global
  • diff --git a/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html b/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html index 100baaa..dce276d 100644 --- a/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html +++ b/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html @@ -190,13 +190,13 @@

    Summary

    Implementing Types
    @@ -206,20 +206,20 @@

    Summary

    graph TD Type["IObjectPool<T>"] class Type type-node - Type-.->Implementing0["MemoryStreamPool"] - click Implementing0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" - Type-.->Implementing1["TimedObjectPool<T>"] - click Implementing1 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" - Type-.->Implementing2["IMemoryStreamPool"] - click Implementing2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool" - Type-.->Implementing3["IStringBuilderPool"] - click Implementing3 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool" - Type-.->Implementing4["StringBuilderPool"] - click Implementing4 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool" - Type-.->Implementing5["ObjectPool<T>"] - click Implementing5 "/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1" - Type-.->Implementing6["ITimedObjectPool<T>"] - click Implementing6 "/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1" + Type-.->Implementing0["TimedObjectPool<T>"] + click Implementing0 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" + Type-.->Implementing1["ObjectPool<T>"] + click Implementing1 "/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1" + Type-.->Implementing2["IStringBuilderPool"] + click Implementing2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool" + Type-.->Implementing3["StringBuilderPool"] + click Implementing3 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool" + Type-.->Implementing4["ITimedObjectPool<T>"] + click Implementing4 "/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1" + Type-.->Implementing5["MemoryStreamPool"] + click Implementing5 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" + Type-.->Implementing6["IMemoryStreamPool"] + click Implementing6 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool"
    diff --git a/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html b/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html index 97037e1..f6b1d8c 100644 --- a/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html +++ b/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html @@ -203,9 +203,9 @@

    Summary

    Derived Types
    @@ -220,12 +220,12 @@

    Summary

    Interface1["IObjectPoolHandle"]-.->Type Type["ObjectPool<T>"] class Type type-node - Type-->Derived0["MemoryStreamPool"] - click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" - Type-->Derived1["TimedObjectPool<T>"] - click Derived1 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" - Type-->Derived2["StringBuilderPool"] - click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool" + Type-->Derived0["TimedObjectPool<T>"] + click Derived0 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" + Type-->Derived1["StringBuilderPool"] + click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool" + Type-->Derived2["MemoryStreamPool"] + click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html index 359a2c1..8804bc8 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html @@ -171,7 +171,7 @@

    Dispose() Method

    Summary

    - See System.IDisposable docs. + See IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/index.html b/docs/api/CodeProject.ObjectPool/PooledObject/index.html index 45f6881..a2a5b53 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/index.html @@ -202,9 +202,9 @@

    Summary

    Derived Types
    @@ -218,12 +218,12 @@

    Summary

    Interface1["IEquatable<T>"]-.->Type Type["PooledObject"] class Type type-node - Type-->Derived0["PooledMemoryStream"] - click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream" - Type-->Derived1["PooledStringBuilder"] - click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" - Type-->Derived2["PooledObjectWrapper<T>"] - click Derived2 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" + Type-->Derived0["PooledStringBuilder"] + click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" + Type-->Derived1["PooledObjectWrapper<T>"] + click Derived1 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" + Type-->Derived2["PooledMemoryStream"] + click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream"
    @@ -320,7 +320,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html index 062e3e3..2af9db6 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html @@ -381,7 +381,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool/index.html b/docs/api/CodeProject.ObjectPool/index.html index 66d949c..87e86b4 100644 --- a/docs/api/CodeProject.ObjectPool/index.html +++ b/docs/api/CodeProject.ObjectPool/index.html @@ -144,6 +144,7 @@
  • global
  • @@ -284,6 +285,10 @@

    Namespaces

    CodeProject.ObjectPool.Logging + + CodeProject.ObjectPool.MicrosoftExtensionsAdapter + + CodeProject.ObjectPool.Specialized diff --git a/docs/api/CodeProject/index.html b/docs/api/CodeProject/index.html index 763312e..3aff161 100644 --- a/docs/api/CodeProject/index.html +++ b/docs/api/CodeProject/index.html @@ -142,6 +142,7 @@
  • global
  • diff --git a/docs/api/global/index.html b/docs/api/global/index.html index 8529492..279933f 100644 --- a/docs/api/global/index.html +++ b/docs/api/global/index.html @@ -142,6 +142,7 @@
  • global
  • diff --git a/docs/api/index.html b/docs/api/index.html index fa7e59e..543a315 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -174,6 +174,10 @@

    Namespaces

    CodeProject.ObjectPool.Logging + + CodeProject.ObjectPool.MicrosoftExtensionsAdapter + + CodeProject.ObjectPool.Specialized diff --git a/docs/assets/js/searchIndex.js b/docs/assets/js/searchIndex.js index e4ff43c..f5fb59a 100644 --- a/docs/assets/js/searchIndex.js +++ b/docs/assets/js/searchIndex.js @@ -34,309 +34,311 @@ var searchModule = function() { a({ id:0, - title:"IStringBuilderPool", - content:"IStringBuilderPool", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:1, - title:"PooledStringBuilder", - content:"PooledStringBuilder", + title:"IParameterizedObjectPool", + content:"IParameterizedObjectPool", description:'', tags:'' }); a({ id:2, - title:"StringBuilderPool", - content:"StringBuilderPool", + title:"IMemoryStreamPool", + content:"IMemoryStreamPool", description:'', tags:'' }); a({ id:3, - title:"PooledObjectDirection", - content:"PooledObjectDirection", + title:"LogLevel", + content:"LogLevel", description:'', tags:'' }); a({ id:4, - title:"ObjectPool", - content:"ObjectPool", + title:"ObjectPoolAdapter", + content:"ObjectPoolAdapter", description:'', tags:'' }); a({ id:5, - title:"IParameterizedObjectPool", - content:"IParameterizedObjectPool", + title:"LogProvider", + content:"LogProvider", description:'', tags:'' }); a({ id:6, - title:"ObjectPool", - content:"ObjectPool", + title:"IObjectPool", + content:"IObjectPool", description:'', tags:'' }); a({ id:7, - title:"PooledObjectBuffer", - content:"PooledObjectBuffer", + title:"PooledObjectValidationContext", + content:"PooledObjectValidationContext", description:'', tags:'' }); a({ id:8, - title:"MemoryStreamPool", - content:"MemoryStreamPool", + title:"PooledObjectState", + content:"PooledObjectState", description:'', tags:'' }); a({ id:9, - title:"IEvictionTimer", - content:"IEvictionTimer", + title:"ParameterizedObjectPool", + content:"ParameterizedObjectPool", description:'', tags:'' }); a({ id:10, - title:"TimedObjectPool", - content:"TimedObjectPool", + title:"PooledObjectBuffer", + content:"PooledObjectBuffer", description:'', tags:'' }); a({ id:11, - title:"IMemoryStreamPool", - content:"IMemoryStreamPool", + title:"StringBuilderPool", + content:"StringBuilderPool", description:'', tags:'' }); a({ id:12, - title:"PooledMemoryStream", - content:"PooledMemoryStream", + title:"PooledObjectWrapper", + content:"PooledObjectWrapper", description:'', tags:'' }); a({ id:13, - title:"PooledObjectValidationContext", - content:"PooledObjectValidationContext", + title:"ObjectPoolDiagnostics", + content:"ObjectPoolDiagnostics", description:'', tags:'' }); a({ id:14, - title:"ObjectPoolDiagnostics", - content:"ObjectPoolDiagnostics", + title:"EvictionTimer", + content:"EvictionTimer", description:'', tags:'' }); a({ id:15, - title:"LogProvider", - content:"LogProvider", + title:"PooledObjectDirection", + content:"PooledObjectDirection", description:'', tags:'' }); a({ id:16, - title:"PooledObject", - content:"PooledObject", + title:"IEvictionTimer", + content:"IEvictionTimer", description:'', tags:'' }); a({ id:17, - title:"ILogProvider", - content:"ILogProvider", + title:"PooledStringBuilder", + content:"PooledStringBuilder", description:'', tags:'' }); a({ id:18, - title:"IObjectPool", - content:"IObjectPool", + title:"ITimedObjectPool", + content:"ITimedObjectPool", description:'', tags:'' }); a({ id:19, - title:"PooledObjectWrapper", - content:"PooledObjectWrapper", + title:"TimedObjectPool", + content:"TimedObjectPool", description:'', tags:'' }); a({ id:20, - title:"EvictionSettings", - content:"EvictionSettings", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:21, - title:"PooledObjectState", - content:"PooledObjectState", + title:"MemoryStreamPool", + content:"MemoryStreamPool", description:'', tags:'' }); a({ id:22, - title:"PooledObjectInfo", - content:"PooledObjectInfo", + title:"IStringBuilderPool", + content:"IStringBuilderPool", description:'', tags:'' }); a({ id:23, - title:"Logger", - content:"Logger", + title:"EvictionSettings", + content:"EvictionSettings", description:'', tags:'' }); a({ id:24, - title:"ParameterizedObjectPool", - content:"ParameterizedObjectPool", + title:"Logger", + content:"Logger", description:'', tags:'' }); a({ id:25, - title:"LogLevel", - content:"LogLevel", + title:"PooledMemoryStream", + content:"PooledMemoryStream", description:'', tags:'' }); a({ id:26, - title:"ITimedObjectPool", - content:"ITimedObjectPool", + title:"PooledObject", + content:"PooledObject", description:'', tags:'' }); a({ id:27, - title:"EvictionTimer", - content:"EvictionTimer", + title:"PooledObjectInfo", + content:"PooledObjectInfo", description:'', tags:'' }); - y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', - title:"IStringBuilderPool", - description:"" + a({ + id:28, + title:"ILogProvider", + content:"ILogProvider", + description:'', + tags:'' }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', - title:"PooledStringBuilder", + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', + title:"ObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool', - title:"StringBuilderPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', + title:"IParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectDirection', - title:"PooledObjectDirection", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', + title:"IMemoryStreamPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', + title:"LogLevel", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', - title:"IParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', + title:"ObjectPoolAdapter", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', + title:"LogProvider", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', - title:"PooledObjectBuffer", + url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', + title:"IObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', - title:"MemoryStreamPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', + title:"PooledObjectValidationContext", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', - title:"IEvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', + title:"PooledObjectState", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1', - title:"TimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/ParameterizedObjectPool_2', + title:"ParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', - title:"IMemoryStreamPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', + title:"PooledObjectBuffer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', - title:"PooledMemoryStream", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool', + title:"StringBuilderPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', - title:"PooledObjectValidationContext", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1', + title:"PooledObjectWrapper", description:"" }); @@ -347,50 +349,62 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', - title:"LogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionTimer', + title:"EvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObject', - title:"PooledObject", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectDirection', + title:"PooledObjectDirection", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', - title:"ILogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', + title:"IEvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', - title:"IObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', + title:"PooledStringBuilder", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1', - title:"PooledObjectWrapper", + url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', + title:"ITimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', - title:"EvictionSettings", + url:'/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1', + title:"TimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', - title:"PooledObjectState", + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', + title:"ObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', - title:"PooledObjectInfo", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', + title:"MemoryStreamPool", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', + title:"IStringBuilderPool", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', + title:"EvictionSettings", description:"" }); @@ -401,26 +415,26 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ParameterizedObjectPool_2', - title:"ParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', + title:"PooledMemoryStream", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', - title:"LogLevel", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObject', + title:"PooledObject", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', - title:"ITimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', + title:"PooledObjectInfo", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionTimer', - title:"EvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', + title:"ILogProvider", description:"" }); diff --git a/docs/feed.atom b/docs/feed.atom index 22e0935..0fa6096 100644 --- a/docs/feed.atom +++ b/docs/feed.atom @@ -4,7 +4,7 @@ https://pomma89.github.io/ObjectPool CodeProject.ObjectPool 2017 - 2017-09-16T08:53:10Z + 2017-09-27T20:55:18Z me diff --git a/docs/feed.rss b/docs/feed.rss index 6abe2d2..e41b15b 100644 --- a/docs/feed.rss +++ b/docs/feed.rss @@ -5,8 +5,8 @@ https://pomma89.github.io/ObjectPool 2017 - Sat, 16 Sep 2017 08:53:10 GMT - Sat, 16 Sep 2017 08:53:10 GMT + Wed, 27 Sep 2017 20:55:18 GMT + Wed, 27 Sep 2017 20:55:18 GMT New Release https://pomma89.github.io/ObjectPool/blog/new-release From c8516af432b94c3e9faec9bf2821fb005c1f7246 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Wed, 27 Sep 2017 22:56:38 +0200 Subject: [PATCH 04/14] api docs --- .../ObjectPoolAdapter_1/000B13E7.html | 287 +++++++++++++++ .../ObjectPoolAdapter_1/C4E819C8.html | 287 +++++++++++++++ .../ObjectPoolAdapter_1/FE9D92C7.html | 267 ++++++++++++++ .../ObjectPoolAdapter_1/index.html | 342 ++++++++++++++++++ .../index.html | 245 +++++++++++++ 5 files changed, 1428 insertions(+) create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html new file mode 100644 index 0000000..f6b4009 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html @@ -0,0 +1,287 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.Return(T) Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter<T>.

    +

    Return(T) Method

    +
    +
    + + +

    Summary

    +
    + Returns given object to the pool. +
    + +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + +
    Containing Type
    +
    ObjectPoolAdapter<T>
    + +
    +
    +
    + +

    Syntax

    +
    public override void Return(T obj)
    + + + + + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    objTThe object that should return to the pool.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    void
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html new file mode 100644 index 0000000..9f08b7f --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html @@ -0,0 +1,287 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.ObjectPoolAdapter(IObjectPool<T>) Constructor + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter<T>.

    +

    ObjectPoolAdapter(IObjectPool<T>) Constructor

    +
    +
    + + +

    Summary

    +
    + Adapts given object pool. +
    + +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + +
    Containing Type
    +
    ObjectPoolAdapter<T>
    + +
    +
    +
    + +

    Syntax

    +
    public ObjectPoolAdapter(IObjectPool<T> objectPool)
    + + + + + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    objectPoolIObjectPool<T>The object pool that needs to be adapted.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    void
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html new file mode 100644 index 0000000..a19fa20 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html @@ -0,0 +1,267 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.Get() Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter<T>.

    +

    Get() Method

    +
    +
    + + +

    Summary

    +
    + Retrieves an object from the pool. +
    + +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + +
    Containing Type
    +
    ObjectPoolAdapter<T>
    + +
    +
    +
    + +

    Syntax

    +
    public override T Get()
    + + + + + + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    TAn object from the pool.
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html new file mode 100644 index 0000000..f2d192b --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html @@ -0,0 +1,342 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter<T> Class + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter<T> Class

    +
    +
    + + +

    Summary

    +
    + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    + +
    +
    +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + + +
    Base Types
    +
    +
      +
    • Extensions.ObjectPool.ObjectPool<>
    • +
    +
    + + +
    +
    +
    +
    + graph TD + Base0["Extensions.ObjectPool.ObjectPool<>"]-->Type + Type["ObjectPoolAdapter<T>"] +class Type type-node + +
    +
    +
    +
    +
    + +

    Syntax

    +
    public sealed class ObjectPoolAdapter<T> : Extensions.ObjectPool.ObjectPool<T> 
    +    where T : PooledObject
    + + + + +

    Type Parameters

    +
    +
    + + + + + + + + + + + +
    NameDescription
    T
    +
    +
    + + +

    Constructors

    +
    +
    + + + + + + + + + + + +
    NameSummary
    ObjectPoolAdapter(IObjectPool<T>) + Adapts given object pool. +
    +
    +
    + + + + + +

    Methods

    +
    +
    + + + + + + + + + + + + + + + + + + +
    NameValueSummary
    Get()T +
    + Retrieves an object from the pool. +
    +
    Return(T)void +
    + Returns given object to the pool. +
    +
    +
    +
    + + + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html new file mode 100644 index 0000000..8b15643 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html @@ -0,0 +1,245 @@ + + + + + + + + + CodeProject.ObjectPool - API - CodeProject.ObjectPool.MicrosoftExtensionsAdapter Namespace + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter Namespace

    +
    +
    + + + + +

    Class Types

    +
    +
    + + + + + + + + + + + +
    ClassSummary
    ObjectPoolAdapter<T> + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    +
    +
    + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file From bd027d8706c094ba70488eb33089f6e9fab99c13 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Wed, 27 Sep 2017 22:59:30 +0200 Subject: [PATCH 05/14] adapter nuspec --- ...deProject.ObjectPool.MicrosoftExtensionsAdapter.csproj | 8 ++++++++ src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj index 34edc6a..d04d0e4 100644 --- a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj +++ b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj @@ -9,6 +9,14 @@ true + + CodeProject.ObjectPool.MicrosoftExtensionsAdapter + Generic and concurrent Object Pool - Adapter for Microsoft Extensions + A generic, concurrent, portable and flexible Object Pool for the .NET Framework. + $(Summary) It is completely based on the Code Project article of Ofir Makmal (http://goo.gl/4qig6T). Library is production ready and it is successfully working in real life systems. Original source code has been modified, in order to introduce a Parameterized Object Pool, already drafted by Ofir Makmal in the comments of the article. Moreover, a few unit tests have been added, in order to improve code reliability, and a lot of other small changes have also been applied. Of course, all modified source code is freely available at the project URL of this package. Many thanks to Ofir Makmal for his great work. + codeproject;object;pool;microsoft;extensions;adapter + + diff --git a/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj b/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj index e90bfe8..cebe224 100644 --- a/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj +++ b/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj @@ -9,7 +9,7 @@ true - + CodeProject.ObjectPool Generic and concurrent Object Pool A generic, concurrent, portable and flexible Object Pool for the .NET Framework. From ec54184a2b36f05110a4436c99916d15dd81c1d3 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Wed, 27 Sep 2017 23:04:15 +0200 Subject: [PATCH 06/14] wyam docs --- .../IStringBuilderPool/index.html | 2 +- .../PooledMemoryStream/index.html | 2 +- .../PooledStringBuilder/index.html | 2 +- .../StringBuilderPool/BA8E0A8A.html | 2 +- .../StringBuilderPool/index.html | 4 +- .../index.html | 4 +- .../IObjectPool_1/index.html | 24 +- .../PooledObject/85048E65.html | 2 +- .../PooledObject/index.html | 16 +- .../PooledObjectWrapper_1/index.html | 2 +- docs/assets/js/searchIndex.js | 224 +++++++++--------- docs/feed.atom | 2 +- docs/feed.rss | 4 +- 13 files changed, 145 insertions(+), 145 deletions(-) diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html index 08adc62..c28b67e 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html @@ -165,7 +165,7 @@

    IStringBuilderPool Interface

    Summary

    - An object pool specialized in StringBuilder management. + An object pool specialized in System.Text.StringBuilder management.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html index db1cebd..fdec606 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html @@ -338,7 +338,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html index 0a76d65..e1d441b 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html @@ -348,7 +348,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html index ec49070..ac3d8e6 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html @@ -181,7 +181,7 @@

    MaximumStringBuilderCapacity Property

    Summary

    - Maximum capacity a StringBuilder might have in order to be able to return + Maximum capacity a System.Text.StringBuilder might have in order to be able to return to pool. Defaults to DefaultMaximumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html index 4c937e1..88924d1 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html @@ -168,7 +168,7 @@

    StringBuilderPool Class

    Summary

    An IObjectPool<T> ready to be used. - StringBuilder management can be further configured using the + System.Text.StringBuilder management can be further configured using the MinimumStringBuilderCapacity and MaximumStringBuilderCapacity properties.
    @@ -349,7 +349,7 @@

    Properties

    int
    - Maximum capacity a StringBuilder might have in order to be able to return + Maximum capacity a System.Text.StringBuilder might have in order to be able to return to pool. Defaults to DefaultMaximumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/index.html b/docs/api/CodeProject.ObjectPool.Specialized/index.html index 0f263a9..8458458 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/index.html @@ -200,7 +200,7 @@

    Class Types

    StringBuilderPool An IObjectPool<T> ready to be used. - StringBuilder management can be further configured using the + System.Text.StringBuilder management can be further configured using the MinimumStringBuilderCapacity and MaximumStringBuilderCapacity properties. @@ -227,7 +227,7 @@

    Interface Types

    IStringBuilderPool - An object pool specialized in StringBuilder management. + An object pool specialized in System.Text.StringBuilder management. diff --git a/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html b/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html index dce276d..7ae1fab 100644 --- a/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html +++ b/docs/api/CodeProject.ObjectPool/IObjectPool_1/index.html @@ -190,13 +190,13 @@

    Summary

    Implementing Types
    @@ -206,20 +206,20 @@

    Summary

    graph TD Type["IObjectPool<T>"] class Type type-node - Type-.->Implementing0["TimedObjectPool<T>"] - click Implementing0 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" - Type-.->Implementing1["ObjectPool<T>"] - click Implementing1 "/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1" - Type-.->Implementing2["IStringBuilderPool"] - click Implementing2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool" + Type-.->Implementing0["IStringBuilderPool"] + click Implementing0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool" + Type-.->Implementing1["TimedObjectPool<T>"] + click Implementing1 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" + Type-.->Implementing2["ObjectPool<T>"] + click Implementing2 "/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1" Type-.->Implementing3["StringBuilderPool"] click Implementing3 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool" Type-.->Implementing4["ITimedObjectPool<T>"] click Implementing4 "/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1" - Type-.->Implementing5["MemoryStreamPool"] - click Implementing5 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" - Type-.->Implementing6["IMemoryStreamPool"] - click Implementing6 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool" + Type-.->Implementing5["IMemoryStreamPool"] + click Implementing5 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool" + Type-.->Implementing6["MemoryStreamPool"] + click Implementing6 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool"
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html index 8804bc8..359a2c1 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html @@ -171,7 +171,7 @@

    Dispose() Method

    Summary

    - See IDisposable docs. + See System.IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/index.html b/docs/api/CodeProject.ObjectPool/PooledObject/index.html index a2a5b53..45f6881 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/index.html @@ -202,9 +202,9 @@

    Summary

    Derived Types
    @@ -218,12 +218,12 @@

    Summary

    Interface1["IEquatable<T>"]-.->Type Type["PooledObject"] class Type type-node - Type-->Derived0["PooledStringBuilder"] - click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" - Type-->Derived1["PooledObjectWrapper<T>"] - click Derived1 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" - Type-->Derived2["PooledMemoryStream"] - click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream" + Type-->Derived0["PooledMemoryStream"] + click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream" + Type-->Derived1["PooledStringBuilder"] + click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" + Type-->Derived2["PooledObjectWrapper<T>"] + click Derived2 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1"
    @@ -320,7 +320,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html index 2af9db6..062e3e3 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html @@ -381,7 +381,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/assets/js/searchIndex.js b/docs/assets/js/searchIndex.js index f5fb59a..b129259 100644 --- a/docs/assets/js/searchIndex.js +++ b/docs/assets/js/searchIndex.js @@ -34,120 +34,120 @@ var searchModule = function() { a({ id:0, - title:"ObjectPool", - content:"ObjectPool", + title:"PooledObjectState", + content:"PooledObjectState", description:'', tags:'' }); a({ id:1, - title:"IParameterizedObjectPool", - content:"IParameterizedObjectPool", + title:"PooledObjectValidationContext", + content:"PooledObjectValidationContext", description:'', tags:'' }); a({ id:2, - title:"IMemoryStreamPool", - content:"IMemoryStreamPool", + title:"IStringBuilderPool", + content:"IStringBuilderPool", description:'', tags:'' }); a({ id:3, - title:"LogLevel", - content:"LogLevel", + title:"LogProvider", + content:"LogProvider", description:'', tags:'' }); a({ id:4, - title:"ObjectPoolAdapter", - content:"ObjectPoolAdapter", + title:"ILogProvider", + content:"ILogProvider", description:'', tags:'' }); a({ id:5, - title:"LogProvider", - content:"LogProvider", + title:"IEvictionTimer", + content:"IEvictionTimer", description:'', tags:'' }); a({ id:6, - title:"IObjectPool", - content:"IObjectPool", + title:"EvictionTimer", + content:"EvictionTimer", description:'', tags:'' }); a({ id:7, - title:"PooledObjectValidationContext", - content:"PooledObjectValidationContext", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:8, - title:"PooledObjectState", - content:"PooledObjectState", + title:"IObjectPool", + content:"IObjectPool", description:'', tags:'' }); a({ id:9, - title:"ParameterizedObjectPool", - content:"ParameterizedObjectPool", + title:"PooledObject", + content:"PooledObject", description:'', tags:'' }); a({ id:10, - title:"PooledObjectBuffer", - content:"PooledObjectBuffer", + title:"PooledMemoryStream", + content:"PooledMemoryStream", description:'', tags:'' }); a({ id:11, - title:"StringBuilderPool", - content:"StringBuilderPool", + title:"IParameterizedObjectPool", + content:"IParameterizedObjectPool", description:'', tags:'' }); a({ id:12, - title:"PooledObjectWrapper", - content:"PooledObjectWrapper", + title:"PooledStringBuilder", + content:"PooledStringBuilder", description:'', tags:'' }); a({ id:13, - title:"ObjectPoolDiagnostics", - content:"ObjectPoolDiagnostics", + title:"ITimedObjectPool", + content:"ITimedObjectPool", description:'', tags:'' }); a({ id:14, - title:"EvictionTimer", - content:"EvictionTimer", + title:"ObjectPoolAdapter", + content:"ObjectPoolAdapter", description:'', tags:'' }); @@ -162,195 +162,195 @@ var searchModule = function() { a({ id:16, - title:"IEvictionTimer", - content:"IEvictionTimer", + title:"StringBuilderPool", + content:"StringBuilderPool", description:'', tags:'' }); a({ id:17, - title:"PooledStringBuilder", - content:"PooledStringBuilder", + title:"EvictionSettings", + content:"EvictionSettings", description:'', tags:'' }); a({ id:18, - title:"ITimedObjectPool", - content:"ITimedObjectPool", + title:"PooledObjectBuffer", + content:"PooledObjectBuffer", description:'', tags:'' }); a({ id:19, - title:"TimedObjectPool", - content:"TimedObjectPool", + title:"Logger", + content:"Logger", description:'', tags:'' }); a({ id:20, - title:"ObjectPool", - content:"ObjectPool", + title:"ObjectPoolDiagnostics", + content:"ObjectPoolDiagnostics", description:'', tags:'' }); a({ id:21, - title:"MemoryStreamPool", - content:"MemoryStreamPool", + title:"IMemoryStreamPool", + content:"IMemoryStreamPool", description:'', tags:'' }); a({ id:22, - title:"IStringBuilderPool", - content:"IStringBuilderPool", + title:"TimedObjectPool", + content:"TimedObjectPool", description:'', tags:'' }); a({ id:23, - title:"EvictionSettings", - content:"EvictionSettings", + title:"ParameterizedObjectPool", + content:"ParameterizedObjectPool", description:'', tags:'' }); a({ id:24, - title:"Logger", - content:"Logger", + title:"MemoryStreamPool", + content:"MemoryStreamPool", description:'', tags:'' }); a({ id:25, - title:"PooledMemoryStream", - content:"PooledMemoryStream", + title:"PooledObjectWrapper", + content:"PooledObjectWrapper", description:'', tags:'' }); a({ id:26, - title:"PooledObject", - content:"PooledObject", + title:"PooledObjectInfo", + content:"PooledObjectInfo", description:'', tags:'' }); a({ id:27, - title:"PooledObjectInfo", - content:"PooledObjectInfo", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:28, - title:"ILogProvider", - content:"ILogProvider", + title:"LogLevel", + content:"LogLevel", description:'', tags:'' }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', + title:"PooledObjectState", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', - title:"IParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', + title:"PooledObjectValidationContext", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', - title:"IMemoryStreamPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', + title:"IStringBuilderPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', - title:"LogLevel", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', + title:"LogProvider", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', - title:"ObjectPoolAdapter", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', + title:"ILogProvider", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', - title:"LogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', + title:"IEvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', - title:"IObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionTimer', + title:"EvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', - title:"PooledObjectValidationContext", + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', + title:"ObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', - title:"PooledObjectState", + url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', + title:"IObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ParameterizedObjectPool_2', - title:"ParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObject', + title:"PooledObject", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', - title:"PooledObjectBuffer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', + title:"PooledMemoryStream", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool', - title:"StringBuilderPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', + title:"IParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1', - title:"PooledObjectWrapper", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', + title:"PooledStringBuilder", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/ObjectPoolDiagnostics', - title:"ObjectPoolDiagnostics", + url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', + title:"ITimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionTimer', - title:"EvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', + title:"ObjectPoolAdapter", description:"" }); @@ -361,80 +361,80 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', - title:"IEvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool', + title:"StringBuilderPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', - title:"PooledStringBuilder", + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', + title:"EvictionSettings", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', - title:"ITimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', + title:"PooledObjectBuffer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1', - title:"TimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/Logger', + title:"Logger", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/ObjectPoolDiagnostics', + title:"ObjectPoolDiagnostics", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', - title:"MemoryStreamPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', + title:"IMemoryStreamPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', - title:"IStringBuilderPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1', + title:"TimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', - title:"EvictionSettings", + url:'/ObjectPool/api/CodeProject.ObjectPool/ParameterizedObjectPool_2', + title:"ParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/Logger', - title:"Logger", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', + title:"MemoryStreamPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', - title:"PooledMemoryStream", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1', + title:"PooledObjectWrapper", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObject', - title:"PooledObject", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', + title:"PooledObjectInfo", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', - title:"PooledObjectInfo", + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', + title:"ObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', - title:"ILogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', + title:"LogLevel", description:"" }); diff --git a/docs/feed.atom b/docs/feed.atom index 0fa6096..fd44a88 100644 --- a/docs/feed.atom +++ b/docs/feed.atom @@ -4,7 +4,7 @@ https://pomma89.github.io/ObjectPool CodeProject.ObjectPool 2017 - 2017-09-27T20:55:18Z + 2017-09-27T21:02:21Z me diff --git a/docs/feed.rss b/docs/feed.rss index e41b15b..d087fb7 100644 --- a/docs/feed.rss +++ b/docs/feed.rss @@ -5,8 +5,8 @@ https://pomma89.github.io/ObjectPool 2017 - Wed, 27 Sep 2017 20:55:18 GMT - Wed, 27 Sep 2017 20:55:18 GMT + Wed, 27 Sep 2017 21:02:21 GMT + Wed, 27 Sep 2017 21:02:21 GMT New Release https://pomma89.github.io/ObjectPool/blog/new-release From 4962c6de8157305e81077bc0c4a65d941c8166ce Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 12:35:27 +0200 Subject: [PATCH 07/14] wrapper + docs --- .../LogProvider/index.html | 2 +- .../CodeProject.ObjectPool.Logging/index.html | 2 +- .../ObjectPoolAdapter_1/000B13E7.html | 18 +- .../{C4E819C8.html => 075639F2.html} | 16 +- .../ObjectPoolAdapter_1/FE9D92C7.html | 16 +- .../ObjectPoolAdapter_1/index.html | 24 +- .../index.html | 2 +- .../IMemoryStreamPool/index.html | 6 +- .../IStringBuilderPool/index.html | 8 +- .../MemoryStreamPool/index.html | 6 +- .../PooledMemoryStream/index.html | 8 +- .../PooledStringBuilder/index.html | 8 +- .../StringBuilderPool/BA8E0A8A.html | 2 +- .../StringBuilderPool/F9DE04DD.html | 2 +- .../StringBuilderPool/index.html | 12 +- .../index.html | 58 ++-- .../EvictionSettings/index.html | 1 + .../EvictionTimer/index.html | 1 + .../IEvictionTimer/index.html | 1 + .../IObjectPool_1/index.html | 33 +- .../IParameterizedObjectPool_2/index.html | 1 + .../ITimedObjectPool_1/index.html | 1 + .../ObjectPool/index.html | 1 + .../ObjectPool_1/index.html | 11 +- .../ParameterizedObjectPool_2/index.html | 1 + .../PooledObject/85048E65.html | 2 +- .../PooledObject/index.html | 15 +- .../PooledObjectWrapper/5E3A7FC3.html | 302 +++++++++++++++++ .../PooledObjectWrapper/index.html | 306 ++++++++++++++++++ .../PooledObjectWrapper_1/index.html | 5 +- .../TimedObjectPool_1/index.html | 1 + docs/api/CodeProject.ObjectPool/index.html | 6 + docs/assets/js/searchIndex.js | 230 ++++++------- docs/feed.atom | 2 +- docs/feed.rss | 4 +- .../ObjectPoolAdapter.cs | 27 +- src/CodeProject.ObjectPool/ObjectPool.cs | 8 +- .../PooledObjectWrapper.cs | 16 + .../CodeProject.ObjectPool.Benchmarks.csproj | 2 + .../RetrieveObjectsConcurrently.cs | 29 +- .../RetrieveOneObject.cs | 30 +- .../CodeProject.ObjectPool.UnitTests.csproj | 29 +- 42 files changed, 972 insertions(+), 283 deletions(-) rename docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/{C4E819C8.html => 075639F2.html} (94%) create mode 100644 docs/api/CodeProject.ObjectPool/PooledObjectWrapper/5E3A7FC3.html create mode 100644 docs/api/CodeProject.ObjectPool/PooledObjectWrapper/index.html diff --git a/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html b/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html index 7676b2a..3136ee4 100644 --- a/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html +++ b/docs/api/CodeProject.ObjectPool.Logging/LogProvider/index.html @@ -165,7 +165,7 @@

    LogProvider Class

    Summary

    - Provides a mechanism to create instances of ILog objects. + Provides a mechanism to create instances of CodeProject.ObjectPool.Logging.ILog objects.
    diff --git a/docs/api/CodeProject.ObjectPool.Logging/index.html b/docs/api/CodeProject.ObjectPool.Logging/index.html index a1b14b8..3f1f4bb 100644 --- a/docs/api/CodeProject.ObjectPool.Logging/index.html +++ b/docs/api/CodeProject.ObjectPool.Logging/index.html @@ -239,7 +239,7 @@

    Class Types

    LogProvider - Provides a mechanism to create instances of ILog objects. + Provides a mechanism to create instances of CodeProject.ObjectPool.Logging.ILog objects. diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html index f6b4009..35c43a3 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.Return(T) Method + CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes>.Return(TRes) Method @@ -137,13 +137,13 @@
  • Namespace
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Type
  • -
  • ObjectPoolAdapter<T>
  • +
  • ObjectPoolAdapter<TRes>
  • Constructors
  • -
  • ObjectPoolAdapter(IObjectPool<T>)
  • +
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>)
  • Method Members
  • Get()
  • -
  • Return(T)
  • +
  • Return(TRes)
  • @@ -157,8 +157,8 @@
    -

    ObjectPoolAdapter<T>.

    -

    Return(T) Method

    +

    ObjectPoolAdapter<TRes>.

    +

    Return(TRes) Method

    @@ -176,14 +176,14 @@

    Summary

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    Containing Type
    -
    ObjectPoolAdapter<T>
    +
    ObjectPoolAdapter<TRes>

    Syntax

    -
    public override void Return(T obj)
    +
    public override void Return(TRes obj)
    @@ -202,7 +202,7 @@

    Parameters

    obj - T + TRes The object that should return to the pool. diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html similarity index 94% rename from docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html rename to docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html index 9f08b7f..b444b85 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/C4E819C8.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.ObjectPoolAdapter(IObjectPool<T>) Constructor + CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes>.ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>) Constructor @@ -137,13 +137,13 @@
  • Namespace
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Type
  • -
  • ObjectPoolAdapter<T>
  • +
  • ObjectPoolAdapter<TRes>
  • Constructors
  • -
  • ObjectPoolAdapter(IObjectPool<T>)
  • +
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>)
  • Method Members
  • Get()
  • -
  • Return(T)
  • +
  • Return(TRes)
  • @@ -157,8 +157,8 @@
    -

    ObjectPoolAdapter<T>.

    -

    ObjectPoolAdapter(IObjectPool<T>) Constructor

    +

    ObjectPoolAdapter<TRes>.

    +

    ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>) Constructor

    @@ -176,14 +176,14 @@

    Summary

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    Containing Type
    -
    ObjectPoolAdapter<T>
    +
    ObjectPoolAdapter<TRes>

    Syntax

    -
    public ObjectPoolAdapter(IObjectPool<T> objectPool)
    +
    public ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>> objectPool)
    diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html index a19fa20..daddd1c 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.Get() Method + CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes>.Get() Method @@ -136,13 +136,13 @@
  • Namespace
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Type
  • -
  • ObjectPoolAdapter<T>
  • +
  • ObjectPoolAdapter<TRes>
  • Constructors
  • -
  • ObjectPoolAdapter(IObjectPool<T>)
  • +
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>)
  • Method Members
  • Get()
  • -
  • Return(T)
  • +
  • Return(TRes)
  • @@ -156,7 +156,7 @@
    -

    ObjectPoolAdapter<T>.

    +

    ObjectPoolAdapter<TRes>.

    Get() Method

    @@ -175,14 +175,14 @@

    Summary

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    Containing Type
    -
    ObjectPoolAdapter<T>
    +
    ObjectPoolAdapter<TRes>

    Syntax

    -
    public override T Get()
    +
    public override TRes Get()
    @@ -200,7 +200,7 @@

    Return Value

    - T + TRes An object from the pool. diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html index f2d192b..1b67b1f 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<T> Class + CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes> Class @@ -139,7 +139,7 @@
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Class Types
  • -
  • ObjectPoolAdapter<T>
  • +
  • ObjectPoolAdapter<TRes>
  • @@ -153,7 +153,7 @@
    -

    ObjectPoolAdapter<T> Class

    +

    ObjectPoolAdapter<TRes> Class

    @@ -188,7 +188,7 @@

    Summary

    graph TD Base0["Extensions.ObjectPool.ObjectPool<>"]-->Type - Type["ObjectPoolAdapter<T>"] + Type["ObjectPoolAdapter<TRes>"] class Type type-node
    @@ -198,8 +198,8 @@

    Summary

    Syntax

    -
    public sealed class ObjectPoolAdapter<T> : Extensions.ObjectPool.ObjectPool<T> 
    -    where T : PooledObject
    +
    public sealed class ObjectPoolAdapter<TRes> : Extensions.ObjectPool.ObjectPool<TRes> 
    +    where TRes : class
    @@ -214,9 +214,9 @@

    Type Parameters

    Description - - T - + + TRes + The type of the resource. @@ -234,7 +234,7 @@

    Constructors

    - ObjectPoolAdapter(IObjectPool<T>) + ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>) Adapts given object pool. @@ -260,7 +260,7 @@

    Methods

    Get() - T + TRes
    Retrieves an object from the pool. @@ -268,7 +268,7 @@

    Methods

    - Return(T) + Return(TRes) void
    diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html index 8b15643..0c51318 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html @@ -176,7 +176,7 @@

    Class Types

    - ObjectPoolAdapter<T> + ObjectPoolAdapter<TRes> Adapts an IObjectPool<T> implementation to Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html index 56ba414..42ce9c6 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html @@ -136,14 +136,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html index c28b67e..b9e9d58 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html @@ -137,14 +137,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • @@ -165,7 +165,7 @@

    IStringBuilderPool Interface

    Summary

    - An object pool specialized in System.Text.StringBuilder management. + An object pool specialized in StringBuilder management.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html index 3c12a15..74375f6 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html index fdec606..d122662 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • @@ -338,7 +338,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html index e1d441b..7342a79 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • @@ -348,7 +348,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html index ac3d8e6..ec49070 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/BA8E0A8A.html @@ -181,7 +181,7 @@

    MaximumStringBuilderCapacity Property

    Summary

    - Maximum capacity a System.Text.StringBuilder might have in order to be able to return + Maximum capacity a StringBuilder might have in order to be able to return to pool. Defaults to DefaultMaximumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html index a33b0c0..caf3a62 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html @@ -181,7 +181,7 @@

    MinimumStringBuilderCapacity Property

    Summary

    - Minimum capacity a System.Text.StringBuilder should have when created and this is the + Minimum capacity a StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html index 88924d1..9d13f0c 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • @@ -168,7 +168,7 @@

    StringBuilderPool Class

    Summary

    An IObjectPool<T> ready to be used. - System.Text.StringBuilder management can be further configured using the + StringBuilder management can be further configured using the MinimumStringBuilderCapacity and MaximumStringBuilderCapacity properties.
    @@ -349,7 +349,7 @@

    Properties

    int
    - Maximum capacity a System.Text.StringBuilder might have in order to be able to return + Maximum capacity a StringBuilder might have in order to be able to return to pool. Defaults to DefaultMaximumStringBuilderCapacity.
    @@ -359,7 +359,7 @@

    Properties

    int
    - Minimum capacity a System.Text.StringBuilder should have when created and this is the + Minimum capacity a StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/index.html b/docs/api/CodeProject.ObjectPool.Specialized/index.html index 8458458..a85e3c2 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/index.html @@ -73,8 +73,8 @@
    diff --git a/docs/api/CodeProject.ObjectPool/IParameterizedObjectPool_2/index.html b/docs/api/CodeProject.ObjectPool/IParameterizedObjectPool_2/index.html index 01f9e33..673604f 100644 --- a/docs/api/CodeProject.ObjectPool/IParameterizedObjectPool_2/index.html +++ b/docs/api/CodeProject.ObjectPool/IParameterizedObjectPool_2/index.html @@ -145,6 +145,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • diff --git a/docs/api/CodeProject.ObjectPool/ITimedObjectPool_1/index.html b/docs/api/CodeProject.ObjectPool/ITimedObjectPool_1/index.html index 7310ae9..ca4d058 100644 --- a/docs/api/CodeProject.ObjectPool/ITimedObjectPool_1/index.html +++ b/docs/api/CodeProject.ObjectPool/ITimedObjectPool_1/index.html @@ -144,6 +144,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • diff --git a/docs/api/CodeProject.ObjectPool/ObjectPool/index.html b/docs/api/CodeProject.ObjectPool/ObjectPool/index.html index ee8f34b..41789a3 100644 --- a/docs/api/CodeProject.ObjectPool/ObjectPool/index.html +++ b/docs/api/CodeProject.ObjectPool/ObjectPool/index.html @@ -143,6 +143,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • diff --git a/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html b/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html index f6b1d8c..7237997 100644 --- a/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html +++ b/docs/api/CodeProject.ObjectPool/ObjectPool_1/index.html @@ -146,6 +146,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • @@ -204,8 +205,8 @@

    Summary

    @@ -222,10 +223,10 @@

    Summary

    class Type type-node Type-->Derived0["TimedObjectPool<T>"] click Derived0 "/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1" - Type-->Derived1["StringBuilderPool"] - click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool" - Type-->Derived2["MemoryStreamPool"] - click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" + Type-->Derived1["MemoryStreamPool"] + click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool" + Type-->Derived2["StringBuilderPool"] + click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool"
    diff --git a/docs/api/CodeProject.ObjectPool/ParameterizedObjectPool_2/index.html b/docs/api/CodeProject.ObjectPool/ParameterizedObjectPool_2/index.html index 1798fe1..bf623e7 100644 --- a/docs/api/CodeProject.ObjectPool/ParameterizedObjectPool_2/index.html +++ b/docs/api/CodeProject.ObjectPool/ParameterizedObjectPool_2/index.html @@ -146,6 +146,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html index 359a2c1..8804bc8 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html @@ -171,7 +171,7 @@

    Dispose() Method

    Summary

    - See System.IDisposable docs. + See IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/index.html b/docs/api/CodeProject.ObjectPool/PooledObject/index.html index 45f6881..8374e26 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/index.html @@ -145,6 +145,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • @@ -202,9 +203,9 @@

    Summary

    Derived Types
    @@ -218,12 +219,12 @@

    Summary

    Interface1["IEquatable<T>"]-.->Type Type["PooledObject"] class Type type-node - Type-->Derived0["PooledMemoryStream"] - click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream" + Type-->Derived0["PooledObjectWrapper<T>"] + click Derived0 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" Type-->Derived1["PooledStringBuilder"] click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" - Type-->Derived2["PooledObjectWrapper<T>"] - click Derived2 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" + Type-->Derived2["PooledMemoryStream"] + click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream"
    @@ -320,7 +321,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper/5E3A7FC3.html b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper/5E3A7FC3.html new file mode 100644 index 0000000..70c561f --- /dev/null +++ b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper/5E3A7FC3.html @@ -0,0 +1,302 @@ + + + + + + + + + CodeProject.ObjectPool - API - PooledObjectWrapper.Create<T>(T) Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    PooledObjectWrapper.

    +

    Create<T>(T) Method

    +
    +
    + + +

    Summary

    +
    + Wraps a given resource so that it can be put in the pool. +
    + +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool
    + +
    Containing Type
    +
    PooledObjectWrapper
    + +
    +
    +
    + +

    Syntax

    +
    public static PooledObjectWrapper<T> Create<T>(T resource) where T : class
    + + + + +

    Type Parameters

    +
    +
    + + + + + + + + + + + +
    NameDescription
    TThe type of the resource.
    +
    +
    + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    resourceTThe resource to be wrapped.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    PooledObjectWrapper<T>A wrapper for given resource.
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper/index.html b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper/index.html new file mode 100644 index 0000000..c1f4ac4 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper/index.html @@ -0,0 +1,306 @@ + + + + + + + + + CodeProject.ObjectPool - API - PooledObjectWrapper Class + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    PooledObjectWrapper Class

    +
    +
    + + +

    Summary

    +
    + Helper class for building pooled object wrappers. +
    + +
    +
    +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool
    + + +
    Base Types
    +
    +
      +
    • object
    • +
    +
    + + +
    +
    +
    +
    + graph TD + Base0["object"]-->Type + Type["PooledObjectWrapper"] +class Type type-node + +
    +
    +
    +
    +
    + +

    Syntax

    +
    public static class PooledObjectWrapper
    + + + + + + + + + + +

    Methods

    +
    +
    + + + + + + + + + + + + + +
    NameValueSummary
    Create<T>(T)PooledObjectWrapper<T> +
    + Wraps a given resource so that it can be put in the pool. +
    +
    static
    +
    +
    +
    + + + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html index 062e3e3..75c54e1 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html @@ -147,6 +147,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • @@ -241,7 +242,7 @@

    Type Parameters

    T - + The type of the resource. @@ -381,7 +382,7 @@

    Methods

    void
    - See System.IDisposable docs. + See IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool/TimedObjectPool_1/index.html b/docs/api/CodeProject.ObjectPool/TimedObjectPool_1/index.html index e2cbed1..53c5aad 100644 --- a/docs/api/CodeProject.ObjectPool/TimedObjectPool_1/index.html +++ b/docs/api/CodeProject.ObjectPool/TimedObjectPool_1/index.html @@ -146,6 +146,7 @@
  • ObjectPool<T>
  • ParameterizedObjectPool<TKey, TValue>
  • PooledObject
  • +
  • PooledObjectWrapper
  • PooledObjectWrapper<T>
  • TimedObjectPool<T>
  • Interface Types
  • diff --git a/docs/api/CodeProject.ObjectPool/index.html b/docs/api/CodeProject.ObjectPool/index.html index 87e86b4..4b8c8b0 100644 --- a/docs/api/CodeProject.ObjectPool/index.html +++ b/docs/api/CodeProject.ObjectPool/index.html @@ -211,6 +211,12 @@

    Class Types

    PooledObject PooledObject base class. + + + + PooledObjectWrapper + + Helper class for building pooled object wrappers. diff --git a/docs/assets/js/searchIndex.js b/docs/assets/js/searchIndex.js index b129259..e0b96dd 100644 --- a/docs/assets/js/searchIndex.js +++ b/docs/assets/js/searchIndex.js @@ -34,128 +34,128 @@ var searchModule = function() { a({ id:0, - title:"PooledObjectState", - content:"PooledObjectState", + title:"PooledObjectWrapper", + content:"PooledObjectWrapper", description:'', tags:'' }); a({ id:1, - title:"PooledObjectValidationContext", - content:"PooledObjectValidationContext", + title:"IMemoryStreamPool", + content:"IMemoryStreamPool", description:'', tags:'' }); a({ id:2, - title:"IStringBuilderPool", - content:"IStringBuilderPool", + title:"ObjectPoolAdapter", + content:"ObjectPoolAdapter", description:'', tags:'' }); a({ id:3, - title:"LogProvider", - content:"LogProvider", + title:"TimedObjectPool", + content:"TimedObjectPool", description:'', tags:'' }); a({ id:4, - title:"ILogProvider", - content:"ILogProvider", + title:"MemoryStreamPool", + content:"MemoryStreamPool", description:'', tags:'' }); a({ id:5, - title:"IEvictionTimer", - content:"IEvictionTimer", + title:"EvictionTimer", + content:"EvictionTimer", description:'', tags:'' }); a({ id:6, - title:"EvictionTimer", - content:"EvictionTimer", + title:"LogProvider", + content:"LogProvider", description:'', tags:'' }); a({ id:7, - title:"ObjectPool", - content:"ObjectPool", + title:"LogLevel", + content:"LogLevel", description:'', tags:'' }); a({ id:8, - title:"IObjectPool", - content:"IObjectPool", + title:"PooledObjectDirection", + content:"PooledObjectDirection", description:'', tags:'' }); a({ id:9, - title:"PooledObject", - content:"PooledObject", + title:"ITimedObjectPool", + content:"ITimedObjectPool", description:'', tags:'' }); a({ id:10, - title:"PooledMemoryStream", - content:"PooledMemoryStream", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:11, - title:"IParameterizedObjectPool", - content:"IParameterizedObjectPool", + title:"PooledObject", + content:"PooledObject", description:'', tags:'' }); a({ id:12, - title:"PooledStringBuilder", - content:"PooledStringBuilder", + title:"IStringBuilderPool", + content:"IStringBuilderPool", description:'', tags:'' }); a({ id:13, - title:"ITimedObjectPool", - content:"ITimedObjectPool", + title:"PooledObjectWrapper", + content:"PooledObjectWrapper", description:'', tags:'' }); a({ id:14, - title:"ObjectPoolAdapter", - content:"ObjectPoolAdapter", + title:"PooledStringBuilder", + content:"PooledStringBuilder", description:'', tags:'' }); a({ id:15, - title:"PooledObjectDirection", - content:"PooledObjectDirection", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); @@ -170,48 +170,48 @@ var searchModule = function() { a({ id:17, - title:"EvictionSettings", - content:"EvictionSettings", + title:"IEvictionTimer", + content:"IEvictionTimer", description:'', tags:'' }); a({ id:18, - title:"PooledObjectBuffer", - content:"PooledObjectBuffer", + title:"IObjectPool", + content:"IObjectPool", description:'', tags:'' }); a({ id:19, - title:"Logger", - content:"Logger", + title:"PooledMemoryStream", + content:"PooledMemoryStream", description:'', tags:'' }); a({ id:20, - title:"ObjectPoolDiagnostics", - content:"ObjectPoolDiagnostics", + title:"PooledObjectBuffer", + content:"PooledObjectBuffer", description:'', tags:'' }); a({ id:21, - title:"IMemoryStreamPool", - content:"IMemoryStreamPool", + title:"EvictionSettings", + content:"EvictionSettings", description:'', tags:'' }); a({ id:22, - title:"TimedObjectPool", - content:"TimedObjectPool", + title:"PooledObjectValidationContext", + content:"PooledObjectValidationContext", description:'', tags:'' }); @@ -226,77 +226,79 @@ var searchModule = function() { a({ id:24, - title:"MemoryStreamPool", - content:"MemoryStreamPool", + title:"IParameterizedObjectPool", + content:"IParameterizedObjectPool", description:'', tags:'' }); a({ id:25, - title:"PooledObjectWrapper", - content:"PooledObjectWrapper", + title:"PooledObjectInfo", + content:"PooledObjectInfo", description:'', tags:'' }); a({ id:26, - title:"PooledObjectInfo", - content:"PooledObjectInfo", + title:"PooledObjectState", + content:"PooledObjectState", description:'', tags:'' }); a({ id:27, - title:"ObjectPool", - content:"ObjectPool", + title:"ObjectPoolDiagnostics", + content:"ObjectPoolDiagnostics", description:'', tags:'' }); a({ id:28, - title:"LogLevel", - content:"LogLevel", + title:"ILogProvider", + content:"ILogProvider", description:'', tags:'' }); - y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', - title:"PooledObjectState", - description:"" + a({ + id:29, + title:"Logger", + content:"Logger", + description:'', + tags:'' }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', - title:"PooledObjectValidationContext", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper', + title:"PooledObjectWrapper", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', - title:"IStringBuilderPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', + title:"IMemoryStreamPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', - title:"LogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', + title:"ObjectPoolAdapter", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', - title:"ILogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1', + title:"TimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', - title:"IEvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', + title:"MemoryStreamPool", description:"" }); @@ -307,56 +309,62 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', + title:"LogProvider", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', - title:"IObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', + title:"LogLevel", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObject', - title:"PooledObject", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectDirection', + title:"PooledObjectDirection", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', - title:"PooledMemoryStream", + url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', + title:"ITimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', - title:"IParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', + title:"ObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', - title:"PooledStringBuilder", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObject', + title:"PooledObject", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', - title:"ITimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', + title:"IStringBuilderPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', - title:"ObjectPoolAdapter", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1', + title:"PooledObjectWrapper", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectDirection', - title:"PooledObjectDirection", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', + title:"PooledStringBuilder", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', + title:"ObjectPool", description:"" }); @@ -367,38 +375,38 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', - title:"EvictionSettings", + url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', + title:"IEvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', - title:"PooledObjectBuffer", + url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', + title:"IObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/Logger', - title:"Logger", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', + title:"PooledMemoryStream", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/ObjectPoolDiagnostics', - title:"ObjectPoolDiagnostics", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', + title:"PooledObjectBuffer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', - title:"IMemoryStreamPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', + title:"EvictionSettings", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/TimedObjectPool_1', - title:"TimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', + title:"PooledObjectValidationContext", description:"" }); @@ -409,32 +417,38 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', - title:"MemoryStreamPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', + title:"IParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1', - title:"PooledObjectWrapper", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', + title:"PooledObjectInfo", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', - title:"PooledObjectInfo", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', + title:"PooledObjectState", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/ObjectPoolDiagnostics', + title:"ObjectPoolDiagnostics", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', - title:"LogLevel", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', + title:"ILogProvider", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/Logger', + title:"Logger", description:"" }); diff --git a/docs/feed.atom b/docs/feed.atom index fd44a88..47b02d7 100644 --- a/docs/feed.atom +++ b/docs/feed.atom @@ -4,7 +4,7 @@ https://pomma89.github.io/ObjectPool CodeProject.ObjectPool 2017 - 2017-09-27T21:02:21Z + 2017-09-30T10:34:11Z me diff --git a/docs/feed.rss b/docs/feed.rss index d087fb7..8ebe70d 100644 --- a/docs/feed.rss +++ b/docs/feed.rss @@ -5,8 +5,8 @@ https://pomma89.github.io/ObjectPool 2017 - Wed, 27 Sep 2017 21:02:21 GMT - Wed, 27 Sep 2017 21:02:21 GMT + Sat, 30 Sep 2017 10:34:11 GMT + Sat, 30 Sep 2017 10:34:11 GMT New Release https://pomma89.github.io/ObjectPool/blog/new-release diff --git a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs index e963a45..554c37e 100644 --- a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs +++ b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs @@ -22,6 +22,7 @@ // OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; +using System.Runtime.CompilerServices; namespace CodeProject.ObjectPool.MicrosoftExtensionsAdapter { @@ -29,17 +30,18 @@ namespace CodeProject.ObjectPool.MicrosoftExtensionsAdapter /// Adapts an implementation to /// abstract class. /// - /// - public sealed class ObjectPoolAdapter : Microsoft.Extensions.ObjectPool.ObjectPool - where T : PooledObject + /// The type of the resource. + public sealed class ObjectPoolAdapter : Microsoft.Extensions.ObjectPool.ObjectPool + where TRes : class { - private readonly IObjectPool _adaptedObjectPool; + private readonly ConditionalWeakTable> _wrapperMap = new ConditionalWeakTable>(); + private readonly IObjectPool> _adaptedObjectPool; /// /// Adapts given object pool. /// /// The object pool that needs to be adapted. - public ObjectPoolAdapter(IObjectPool objectPool) + public ObjectPoolAdapter(IObjectPool> objectPool) { _adaptedObjectPool = objectPool ?? throw new ArgumentNullException(nameof(objectPool)); } @@ -48,12 +50,23 @@ public ObjectPoolAdapter(IObjectPool objectPool) /// Retrieves an object from the pool. /// /// An object from the pool. - public override T Get() => _adaptedObjectPool.GetObject(); + public override TRes Get() + { + var pooledObject = _adaptedObjectPool.GetObject(); + _wrapperMap.GetValue(pooledObject.InternalResource, _ => pooledObject); + return pooledObject.InternalResource; + } /// /// Returns given object to the pool. /// /// The object that should return to the pool. - public override void Return(T obj) => obj?.Dispose(); + public override void Return(TRes obj) + { + if (_wrapperMap.TryGetValue(obj, out var pooledObject)) + { + pooledObject?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/CodeProject.ObjectPool/ObjectPool.cs b/src/CodeProject.ObjectPool/ObjectPool.cs index 77a7ae9..a766d53 100644 --- a/src/CodeProject.ObjectPool/ObjectPool.cs +++ b/src/CodeProject.ObjectPool/ObjectPool.cs @@ -293,14 +293,14 @@ void IObjectPoolHandle.ReturnObjectToPool(PooledObject objectToReturnToPool, boo #region Protected Methods /// - /// Keeps track of last pooled object ID. + /// Used to schedule an async validation and eviction job. /// - private int _lastPooledObjectId; + private readonly IEvictionTimer _evictionTimer; /// - /// Used to schedule an async validation and eviction job. + /// Keeps track of last pooled object ID. /// - private IEvictionTimer _evictionTimer; + private int _lastPooledObjectId; /// /// Stores the ticket returned by diff --git a/src/CodeProject.ObjectPool/PooledObjectWrapper.cs b/src/CodeProject.ObjectPool/PooledObjectWrapper.cs index eb84d1c..aa25931 100644 --- a/src/CodeProject.ObjectPool/PooledObjectWrapper.cs +++ b/src/CodeProject.ObjectPool/PooledObjectWrapper.cs @@ -13,9 +13,25 @@ namespace CodeProject.ObjectPool { + /// + /// Helper class for building pooled object wrappers. + /// + public static class PooledObjectWrapper + { + /// + /// Wraps a given resource so that it can be put in the pool. + /// + /// The type of the resource. + /// The resource to be wrapped. + /// Given resource is null. + /// A wrapper for given resource. + public static PooledObjectWrapper Create(T resource) where T : class => new PooledObjectWrapper(resource); + } + /// /// PooledObject wrapper, for classes which cannot inherit from that class. /// + /// The type of the resource. #if HAS_SERIALIZABLE [Serializable] #endif diff --git a/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj b/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj index f1edad7..ce8a61f 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj +++ b/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj @@ -2,10 +2,12 @@ netcoreapp2.0 exe + latest + diff --git a/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs b/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs index 37b5956..0375061 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs +++ b/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs @@ -22,6 +22,7 @@ // OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using BenchmarkDotNet.Attributes; +using CodeProject.ObjectPool.MicrosoftExtensionsAdapter; using System; using System.Threading.Tasks; @@ -32,8 +33,9 @@ public class RetrieveObjectsConcurrently { private readonly ObjectPool _objectPool = new ObjectPool(21, () => new MyResource { Value = DateTime.UtcNow.ToString() }); private readonly ParameterizedObjectPool _paramObjectPool = new ParameterizedObjectPool(21, x => new MyResource { Value = (DateTime.UtcNow + "#" + x) }); - private readonly Microsoft.Extensions.ObjectPool.ObjectPool _microsoftObjectPool = new Microsoft.Extensions.ObjectPool.DefaultObjectPoolProvider().Create(new MyResource.Policy()); private readonly Original.ObjectPool _originalObjectPool = new Original.ObjectPool(0, 21, () => new MyOriginalResource { Value = DateTime.UtcNow.ToString() }); + private readonly Microsoft.Extensions.ObjectPool.ObjectPool _microsoftObjectPool = new Microsoft.Extensions.ObjectPool.DefaultObjectPoolProvider().Create(new MyResource.Policy()); + private readonly Microsoft.Extensions.ObjectPool.ObjectPool _adaptedMicrosoftObjectPool = new ObjectPoolAdapter(new ObjectPool>(21, () => PooledObjectWrapper.Create(new MyResource { Value = DateTime.UtcNow.ToString() }))); private sealed class MyResource : PooledObject { @@ -79,6 +81,16 @@ public ParallelLoopResult Parameterized() => Parallel.For(0, Count, _ => } }); + [Benchmark] + public ParallelLoopResult Original() => Parallel.For(0, Count, _ => + { + string str; + using (var x = _originalObjectPool.GetObject()) + { + str = x.Value; + } + }); + [Benchmark] public ParallelLoopResult Microsoft() => Parallel.For(0, Count, _ => { @@ -99,12 +111,21 @@ public ParallelLoopResult Microsoft() => Parallel.For(0, Count, _ => }); [Benchmark] - public ParallelLoopResult Original() => Parallel.For(0, Count, _ => + public ParallelLoopResult AdaptedMicrosoft() => Parallel.For(0, Count, _ => { + MyResource res = null; string str; - using (var x = _originalObjectPool.GetObject()) + try { - str = x.Value; + res = _adaptedMicrosoftObjectPool.Get(); + str = res.Value; + } + finally + { + if (res != null) + { + _adaptedMicrosoftObjectPool.Return(res); + } } }); } diff --git a/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs b/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs index 103e163..2db2b3e 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs +++ b/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs @@ -22,6 +22,7 @@ // OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using BenchmarkDotNet.Attributes; +using CodeProject.ObjectPool.MicrosoftExtensionsAdapter; using System; namespace CodeProject.ObjectPool.Benchmarks @@ -31,8 +32,9 @@ public class RetrieveOneObject { private readonly ObjectPool _objectPool = new ObjectPool(21, () => new MyResource { Value = DateTime.UtcNow.ToString() }); private readonly ParameterizedObjectPool _paramObjectPool = new ParameterizedObjectPool(21, x => new MyResource { Value = (DateTime.UtcNow + "#" + x) }); - private readonly Microsoft.Extensions.ObjectPool.ObjectPool _microsoftObjectPool = new Microsoft.Extensions.ObjectPool.DefaultObjectPoolProvider().Create(new MyResource.Policy()); private readonly Original.ObjectPool _originalObjectPool = new Original.ObjectPool(0, 21, () => new MyOriginalResource { Value = DateTime.UtcNow.ToString() }); + private readonly Microsoft.Extensions.ObjectPool.ObjectPool _microsoftObjectPool = new Microsoft.Extensions.ObjectPool.DefaultObjectPoolProvider().Create(new MyResource.Policy()); + private readonly Microsoft.Extensions.ObjectPool.ObjectPool _adaptedMicrosoftObjectPool = new ObjectPoolAdapter(new ObjectPool>(21, () => PooledObjectWrapper.Create(new MyResource { Value = DateTime.UtcNow.ToString() }))); private sealed class MyResource : PooledObject { @@ -77,6 +79,17 @@ public string Parameterized() return str; } + [Benchmark] + public string Original() + { + string str; + using (var x = _originalObjectPool.GetObject()) + { + str = x.Value; + } + return str; + } + [Benchmark] public string Microsoft() { @@ -98,12 +111,21 @@ public string Microsoft() } [Benchmark] - public string Original() + public string AdaptedMicrosoft() { + MyResource res = null; string str; - using (var x = _originalObjectPool.GetObject()) + try { - str = x.Value; + res = _microsoftObjectPool.Get(); + str = res.Value; + } + finally + { + if (res != null) + { + _microsoftObjectPool.Return(res); + } } return str; } diff --git a/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj b/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj index 405fcbd..e8b678f 100644 --- a/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj +++ b/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj @@ -1,6 +1,6 @@  - netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;net40;net45;net46 + netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;net40;net45;net461 exe @@ -21,46 +21,21 @@ $(DefineConstants);NETSTD16 - - - $(DefineConstants);NETSTD16 - - - - - $(DefineConstants);NETSTD20 - - - - - - - $(DefineConstants);NET40 - - - - $(DefineConstants);NET45 - - - - $(DefineConstants);NET46 - - - + From dae09c49dfc8848d3e9e8ab9e91ad078074a6b12 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 15:29:20 +0200 Subject: [PATCH 08/14] bdn artifacts --- .gitignore | 3 +++ Directory.Build.props | 6 ------ .../CodeProject.ObjectPool.Benchmarks.csproj | 6 ++++++ test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 224ca86..f057bc3 100644 --- a/.gitignore +++ b/.gitignore @@ -168,6 +168,9 @@ App_Data/*.ldf artifacts tools +# BenchmarkDotNet +BenchmarkDotNet.Artifacts + ############# ## Windows detritus ############# diff --git a/Directory.Build.props b/Directory.Build.props index 4c194f3..31968d3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,12 +15,6 @@ /~https://github.com/pomma89/ObjectPool - - - - - - $(DefineConstants);NETSTD10;LIBLOG_PORTABLE diff --git a/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj b/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj index ce8a61f..7abd345 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj +++ b/test/CodeProject.ObjectPool.Benchmarks/CodeProject.ObjectPool.Benchmarks.csproj @@ -5,6 +5,12 @@ latest + + + + + + diff --git a/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs b/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs index 2db2b3e..e075125 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs +++ b/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs @@ -117,14 +117,14 @@ public string AdaptedMicrosoft() string str; try { - res = _microsoftObjectPool.Get(); + res = _adaptedMicrosoftObjectPool.Get(); str = res.Value; } finally { if (res != null) { - _microsoftObjectPool.Return(res); + _adaptedMicrosoftObjectPool.Return(res); } } return str; From c727199641a4d259451e9f58d8244aa81bf4671c Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 19:44:42 +0200 Subject: [PATCH 09/14] tweaks for wrapper --- .../ObjectPoolAdapter.cs | 90 +++++++++++++++++-- .../RetrieveObjectsConcurrently.cs | 2 +- .../RetrieveOneObject.cs | 2 +- 3 files changed, 84 insertions(+), 10 deletions(-) diff --git a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs index 554c37e..91521fe 100644 --- a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs +++ b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs @@ -26,22 +26,60 @@ namespace CodeProject.ObjectPool.MicrosoftExtensionsAdapter { + /// + /// Helper for getting object pool adapters. + /// + public static class ObjectPoolAdapter + { + /// + /// Adapts an implementation to + /// abstract class. + /// + /// The type of the resource. + /// The object pool that needs to be adapted. + /// An adapter for given object pool. + /// is null. + /// + /// This adapter should be used for types that do _not_ extend class. + /// + public static Microsoft.Extensions.ObjectPool.ObjectPool Create(IObjectPool> objectPool) + where T : class => new ObjectPoolAdapter(objectPool); + + /// + /// Adapts an implementation to + /// abstract class. + /// + /// The type of the resource. + /// The object pool that needs to be adapted. + /// An adapter for given object pool. + /// is null. + /// + /// This adapter should be used for types that extend class. + /// + public static Microsoft.Extensions.ObjectPool.ObjectPool CreateForPooledObject(IObjectPool objectPool) + where T : PooledObject => new ObjectPoolAdapterForPooledObject(objectPool); + } + /// /// Adapts an implementation to /// abstract class. /// - /// The type of the resource. - public sealed class ObjectPoolAdapter : Microsoft.Extensions.ObjectPool.ObjectPool - where TRes : class + /// The type of the resource. + /// + /// This adapter should be used for types that do _not_ extend class. + /// + public sealed class ObjectPoolAdapter : Microsoft.Extensions.ObjectPool.ObjectPool + where T : class { - private readonly ConditionalWeakTable> _wrapperMap = new ConditionalWeakTable>(); - private readonly IObjectPool> _adaptedObjectPool; + private readonly ConditionalWeakTable> _wrapperMap = new ConditionalWeakTable>(); + private readonly IObjectPool> _adaptedObjectPool; /// /// Adapts given object pool. /// /// The object pool that needs to be adapted. - public ObjectPoolAdapter(IObjectPool> objectPool) + /// is null. + public ObjectPoolAdapter(IObjectPool> objectPool) { _adaptedObjectPool = objectPool ?? throw new ArgumentNullException(nameof(objectPool)); } @@ -50,7 +88,7 @@ public ObjectPoolAdapter(IObjectPool> objectPool) /// Retrieves an object from the pool. /// /// An object from the pool. - public override TRes Get() + public override T Get() { var pooledObject = _adaptedObjectPool.GetObject(); _wrapperMap.GetValue(pooledObject.InternalResource, _ => pooledObject); @@ -61,7 +99,7 @@ public override TRes Get() /// Returns given object to the pool. /// /// The object that should return to the pool. - public override void Return(TRes obj) + public override void Return(T obj) { if (_wrapperMap.TryGetValue(obj, out var pooledObject)) { @@ -69,4 +107,40 @@ public override void Return(TRes obj) } } } + + /// + /// Adapts an implementation to + /// abstract class. + /// + /// The type of the resource. + /// + /// This adapter should be used for types that extend class. + /// + public sealed class ObjectPoolAdapterForPooledObject : Microsoft.Extensions.ObjectPool.ObjectPool + where T : PooledObject + { + private readonly IObjectPool _adaptedObjectPool; + + /// + /// Adapts given object pool. + /// + /// The object pool that needs to be adapted. + /// is null. + public ObjectPoolAdapterForPooledObject(IObjectPool objectPool) + { + _adaptedObjectPool = objectPool ?? throw new ArgumentNullException(nameof(objectPool)); + } + + /// + /// Retrieves an object from the pool. + /// + /// An object from the pool. + public override T Get() => _adaptedObjectPool.GetObject(); + + /// + /// Returns given object to the pool. + /// + /// The object that should return to the pool. + public override void Return(T obj) => obj?.Dispose(); + } } \ No newline at end of file diff --git a/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs b/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs index 0375061..25a431a 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs +++ b/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs @@ -35,7 +35,7 @@ public class RetrieveObjectsConcurrently private readonly ParameterizedObjectPool _paramObjectPool = new ParameterizedObjectPool(21, x => new MyResource { Value = (DateTime.UtcNow + "#" + x) }); private readonly Original.ObjectPool _originalObjectPool = new Original.ObjectPool(0, 21, () => new MyOriginalResource { Value = DateTime.UtcNow.ToString() }); private readonly Microsoft.Extensions.ObjectPool.ObjectPool _microsoftObjectPool = new Microsoft.Extensions.ObjectPool.DefaultObjectPoolProvider().Create(new MyResource.Policy()); - private readonly Microsoft.Extensions.ObjectPool.ObjectPool _adaptedMicrosoftObjectPool = new ObjectPoolAdapter(new ObjectPool>(21, () => PooledObjectWrapper.Create(new MyResource { Value = DateTime.UtcNow.ToString() }))); + private readonly Microsoft.Extensions.ObjectPool.ObjectPool _adaptedMicrosoftObjectPool = ObjectPoolAdapter.CreateForPooledObject(new ObjectPool(21, () => new MyResource { Value = DateTime.UtcNow.ToString() })); private sealed class MyResource : PooledObject { diff --git a/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs b/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs index e075125..8faa3b9 100644 --- a/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs +++ b/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs @@ -34,7 +34,7 @@ public class RetrieveOneObject private readonly ParameterizedObjectPool _paramObjectPool = new ParameterizedObjectPool(21, x => new MyResource { Value = (DateTime.UtcNow + "#" + x) }); private readonly Original.ObjectPool _originalObjectPool = new Original.ObjectPool(0, 21, () => new MyOriginalResource { Value = DateTime.UtcNow.ToString() }); private readonly Microsoft.Extensions.ObjectPool.ObjectPool _microsoftObjectPool = new Microsoft.Extensions.ObjectPool.DefaultObjectPoolProvider().Create(new MyResource.Policy()); - private readonly Microsoft.Extensions.ObjectPool.ObjectPool _adaptedMicrosoftObjectPool = new ObjectPoolAdapter(new ObjectPool>(21, () => PooledObjectWrapper.Create(new MyResource { Value = DateTime.UtcNow.ToString() }))); + private readonly Microsoft.Extensions.ObjectPool.ObjectPool _adaptedMicrosoftObjectPool = ObjectPoolAdapter.CreateForPooledObject(new ObjectPool(21, () => new MyResource { Value = DateTime.UtcNow.ToString() })); private sealed class MyResource : PooledObject { From 65c12ae7eced91f17207a867d1edf55ac5fa9329 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 20:03:02 +0200 Subject: [PATCH 10/14] unit test for adapter --- .../CodeProject.ObjectPool.UnitTests.csproj | 13 ++++ .../ObjectPoolAdapterTests.cs | 70 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs diff --git a/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj b/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj index e8b678f..7adece4 100644 --- a/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj +++ b/test/CodeProject.ObjectPool.UnitTests/CodeProject.ObjectPool.UnitTests.csproj @@ -25,6 +25,14 @@ $(DefineConstants);NETSTD16 + + $(DefineConstants);NETSTD20;HAS_EXTENSIONS + + + + + + @@ -35,7 +43,12 @@ + + $(DefineConstants);HAS_EXTENSIONS + + + diff --git a/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs b/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs new file mode 100644 index 0000000..42df922 --- /dev/null +++ b/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs @@ -0,0 +1,70 @@ +// File name: ObjectPoolAdapterTests.cs +// +// Author(s): Alessio Parma +// +// The MIT License (MIT) +// +// Copyright (c) 2013-2018 Alessio Parma +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +// associated documentation files (the "Software"), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, publish, distribute, +// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#if HAS_EXTENSIONS + +using CodeProject.ObjectPool.MicrosoftExtensionsAdapter; +using NUnit.Framework; +using Shouldly; +using System.Collections.Generic; + +namespace CodeProject.ObjectPool.UnitTests.MicrosoftExtensionsAdapter +{ + [TestFixture] + internal sealed class ObjectPoolAdapterTests + { + [Test] + public void ObjectPoolAdapter_GetAndReturnObject_SameInstance() + { + // Arrange + var pool = ObjectPoolAdapter.Create(new ObjectPool>>()); + + var list1 = pool.Get(); + pool.Return(list1); + + // Act + var list2 = pool.Get(); + + // Assert + list1.ShouldBe(list2); + } + + [Test] + public void ObjectPoolAdapterForPooledObject_GetAndReturnObject_SameInstance() + { + // Arrange + var pool = ObjectPoolAdapter.CreateForPooledObject(new ObjectPool()); + + var pooledObject = pool.Get(); + pool.Return(pooledObject); + + // Act + var list2 = pool.Get(); + + // Assert + pooledObject.ShouldBe(list2); + } + } +} + +#endif \ No newline at end of file From 122c2b78fc351c399f9a7e704edf980a70753b46 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 20:06:07 +0200 Subject: [PATCH 11/14] unit test --- .../ObjectPoolAdapterTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs b/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs index 42df922..9cffab3 100644 --- a/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs +++ b/test/CodeProject.ObjectPool.UnitTests/MicrosoftExtensionsAdapter/ObjectPoolAdapterTests.cs @@ -37,7 +37,7 @@ internal sealed class ObjectPoolAdapterTests public void ObjectPoolAdapter_GetAndReturnObject_SameInstance() { // Arrange - var pool = ObjectPoolAdapter.Create(new ObjectPool>>()); + var pool = ObjectPoolAdapter.Create(new ObjectPool>>(() => PooledObjectWrapper.Create(new List()))); var list1 = pool.Get(); pool.Return(list1); @@ -55,14 +55,14 @@ public void ObjectPoolAdapterForPooledObject_GetAndReturnObject_SameInstance() // Arrange var pool = ObjectPoolAdapter.CreateForPooledObject(new ObjectPool()); - var pooledObject = pool.Get(); - pool.Return(pooledObject); + var pooledObject1 = pool.Get(); + pool.Return(pooledObject1); // Act - var list2 = pool.Get(); + var pooledObject2 = pool.Get(); // Assert - pooledObject.ShouldBe(list2); + pooledObject1.ShouldBe(pooledObject2); } } } From 3bc08e6e629f85957719a51c69f61b9b82080c26 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 20:09:24 +0200 Subject: [PATCH 12/14] wyam docs --- .../ObjectPoolAdapter/7B0501A9.html | 310 ++++++++++++++++ .../ObjectPoolAdapter/84305C31.html | 310 ++++++++++++++++ .../ObjectPoolAdapter/index.html | 307 +++++++++++++++ .../62E00DD1.html | 267 ++++++++++++++ .../B7ECA3DF.html | 287 ++++++++++++++ .../D5B1E35E.html | 287 ++++++++++++++ .../index.html | 349 ++++++++++++++++++ .../ObjectPoolAdapter_1/000B13E7.html | 18 +- .../ObjectPoolAdapter_1/075639F2.html | 16 +- .../ObjectPoolAdapter_1/FE9D92C7.html | 16 +- .../ObjectPoolAdapter_1/index.html | 28 +- .../index.html | 15 +- .../IMemoryStreamPool/3BADE41B.html | 2 +- .../IMemoryStreamPool/4FCB017D.html | 2 +- .../IMemoryStreamPool/index.html | 12 +- .../IStringBuilderPool/19CAA55A.html | 2 +- .../IStringBuilderPool/5A9AAB0D.html | 2 +- .../IStringBuilderPool/index.html | 12 +- .../MemoryStreamPool/A3099D76.html | 2 +- .../MemoryStreamPool/D76F7810.html | 2 +- .../MemoryStreamPool/index.html | 12 +- .../PooledMemoryStream/index.html | 10 +- .../PooledStringBuilder/index.html | 8 +- .../StringBuilderPool/F9DE04DD.html | 2 +- .../StringBuilderPool/index.html | 10 +- .../index.html | 60 +-- .../IObjectPool_1/index.html | 30 +- .../ObjectPool_1/index.html | 14 +- .../PooledObject/85048E65.html | 2 +- .../PooledObject/index.html | 12 +- .../PooledObjectWrapper_1/index.html | 2 +- docs/assets/js/searchIndex.js | 256 +++++++------ docs/feed.atom | 2 +- docs/feed.rss | 4 +- 34 files changed, 2417 insertions(+), 253 deletions(-) create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/7B0501A9.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/84305C31.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/index.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/62E00DD1.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/B7ECA3DF.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/D5B1E35E.html create mode 100644 docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/index.html diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/7B0501A9.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/7B0501A9.html new file mode 100644 index 0000000..8a3df39 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/7B0501A9.html @@ -0,0 +1,310 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter.CreateForPooledObject<T>(IObjectPool<T>) Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter.

    +

    CreateForPooledObject<T>(IObjectPool<T>) Method

    +
    +
    + + +

    Summary

    +
    + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    + +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + +
    Containing Type
    +
    ObjectPoolAdapter
    + +
    +
    +
    + +

    Syntax

    +
    public static Extensions.ObjectPool.ObjectPool<T> CreateForPooledObject<T>(IObjectPool<T> objectPool) 
    +    where T : PooledObject
    + + +

    Remarks

    +
    + This adapter should be used for types that extend PooledObject class. +
    + + +

    Type Parameters

    +
    +
    + + + + + + + + + + + +
    NameDescription
    TThe type of the resource.
    +
    +
    + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    objectPoolIObjectPool<T>The object pool that needs to be adapted.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    Extensions.ObjectPool.ObjectPool<>An adapter for given object pool.
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/84305C31.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/84305C31.html new file mode 100644 index 0000000..85baa12 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/84305C31.html @@ -0,0 +1,310 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter.Create<T>(IObjectPool<PooledObjectWrapper<T>>) Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter.

    +

    Create<T>(IObjectPool<PooledObjectWrapper<T>>) Method

    +
    +
    + + +

    Summary

    +
    + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    + +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + +
    Containing Type
    +
    ObjectPoolAdapter
    + +
    +
    +
    + +

    Syntax

    +
    public static Extensions.ObjectPool.ObjectPool<T> Create<T>(IObjectPool<PooledObjectWrapper<T>> objectPool) 
    +    where T : class
    + + +

    Remarks

    +
    + This adapter should be used for types that do _not_ extend PooledObject class. +
    + + +

    Type Parameters

    +
    +
    + + + + + + + + + + + +
    NameDescription
    TThe type of the resource.
    +
    +
    + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    objectPoolIObjectPool<T>The object pool that needs to be adapted.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    Extensions.ObjectPool.ObjectPool<>An adapter for given object pool.
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/index.html new file mode 100644 index 0000000..cff71d3 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter/index.html @@ -0,0 +1,307 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapter Class + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapter Class

    +
    +
    + + +

    Summary

    +
    + Helper for getting object pool adapters. +
    + +
    +
    +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + + +
    Base Types
    +
    +
      +
    • object
    • +
    +
    + + +
    +
    +
    +
    + graph TD + Base0["object"]-->Type + Type["ObjectPoolAdapter"] +class Type type-node + +
    +
    +
    +
    +
    + +

    Syntax

    +
    public static class ObjectPoolAdapter
    + + + + + + + + + + +

    Methods

    +
    +
    + + + + + + + + + + + + + + + + + + +
    NameValueSummary
    Create<T>(IObjectPool<PooledObjectWrapper<T>>)Extensions.ObjectPool.ObjectPool<> +
    + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    +
    static
    +
    CreateForPooledObject<T>(IObjectPool<T>)Extensions.ObjectPool.ObjectPool<> +
    + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    +
    static
    +
    +
    +
    + + + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/62E00DD1.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/62E00DD1.html new file mode 100644 index 0000000..f934bca --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/62E00DD1.html @@ -0,0 +1,267 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapterForPooledObject<T>.Get() Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapterForPooledObject<T>.

    +

    Get() Method

    +
    +
    + + +

    Summary

    +
    + Retrieves an object from the pool. +
    + + + +

    Syntax

    +
    public override T Get()
    + + + + + + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    TAn object from the pool.
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/B7ECA3DF.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/B7ECA3DF.html new file mode 100644 index 0000000..411eec7 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/B7ECA3DF.html @@ -0,0 +1,287 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapterForPooledObject<T>.ObjectPoolAdapterForPooledObject(IObjectPool<T>) Constructor + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapterForPooledObject<T>.

    +

    ObjectPoolAdapterForPooledObject(IObjectPool<T>) Constructor

    +
    +
    + + +

    Summary

    +
    + Adapts given object pool. +
    + + + +

    Syntax

    +
    public ObjectPoolAdapterForPooledObject(IObjectPool<T> objectPool)
    + + + + + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    objectPoolIObjectPool<T>The object pool that needs to be adapted.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    void
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/D5B1E35E.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/D5B1E35E.html new file mode 100644 index 0000000..5626ecc --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/D5B1E35E.html @@ -0,0 +1,287 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapterForPooledObject<T>.Return(T) Method + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapterForPooledObject<T>.

    +

    Return(T) Method

    +
    +
    + + +

    Summary

    +
    + Returns given object to the pool. +
    + + + +

    Syntax

    +
    public override void Return(T obj)
    + + + + + +

    Parameters

    +
    +
    + + + + + + + + + + + + + +
    NameTypeDescription
    objTThe object that should return to the pool.
    +
    +
    + +

    Return Value

    +
    +
    + + + + + + + + + + + +
    TypeDescription
    void
    +
    +
    + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/index.html new file mode 100644 index 0000000..ac9aca4 --- /dev/null +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1/index.html @@ -0,0 +1,349 @@ + + + + + + + + + CodeProject.ObjectPool - API - ObjectPoolAdapterForPooledObject<T> Class + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + + + + +
    + + + + +
    +

    ObjectPoolAdapterForPooledObject<T> Class

    +
    +
    + + +

    Summary

    +
    + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. +
    + +
    +
    +
    +
    +
    + +
    Namespace
    +
    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    + + +
    Base Types
    +
    +
      +
    • Extensions.ObjectPool.ObjectPool<>
    • +
    +
    + + +
    +
    +
    +
    + graph TD + Base0["Extensions.ObjectPool.ObjectPool<>"]-->Type + Type["ObjectPoolAdapterForPooledObject<T>"] +class Type type-node + +
    +
    +
    +
    +
    + +

    Syntax

    +
    public sealed class ObjectPoolAdapterForPooledObject<T> : Extensions.ObjectPool.ObjectPool<T> 
    +    where T : PooledObject
    + + +

    Remarks

    +
    + This adapter should be used for types that extend PooledObject class. +
    + + +

    Type Parameters

    +
    +
    + + + + + + + + + + + +
    NameDescription
    TThe type of the resource.
    +
    +
    + + +

    Constructors

    +
    +
    + + + + + + + + + + + +
    NameSummary
    ObjectPoolAdapterForPooledObject(IObjectPool<T>) + Adapts given object pool. +
    +
    +
    + + + + + +

    Methods

    +
    +
    + + + + + + + + + + + + + + + + + + +
    NameValueSummary
    Get()T +
    + Retrieves an object from the pool. +
    +
    Return(T)void +
    + Returns given object to the pool. +
    +
    +
    +
    + + + + + +
    + +
    + + +
    +
    + +
    +
    +
    + Generated by Wyam +
    +
    + + + + + \ No newline at end of file diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html index 35c43a3..f778dde 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/000B13E7.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes>.Return(TRes) Method + CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.Return(T) Method @@ -137,13 +137,13 @@
  • Namespace
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Type
  • -
  • ObjectPoolAdapter<TRes>
  • +
  • ObjectPoolAdapter<T>
  • Constructors
  • -
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>)
  • +
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>>)
  • Method Members
  • Get()
  • -
  • Return(TRes)
  • +
  • Return(T)
  • @@ -157,8 +157,8 @@
    -

    ObjectPoolAdapter<TRes>.

    -

    Return(TRes) Method

    +

    ObjectPoolAdapter<T>.

    +

    Return(T) Method

    @@ -176,14 +176,14 @@

    Summary

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    Containing Type
    -
    ObjectPoolAdapter<TRes>
    +
    ObjectPoolAdapter<T>

    Syntax

    -
    public override void Return(TRes obj)
    +
    public override void Return(T obj)
    @@ -202,7 +202,7 @@

    Parameters

    obj - TRes + T The object that should return to the pool. diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html index b444b85..714568a 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/075639F2.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes>.ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>) Constructor + CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>>) Constructor @@ -137,13 +137,13 @@
  • Namespace
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Type
  • -
  • ObjectPoolAdapter<TRes>
  • +
  • ObjectPoolAdapter<T>
  • Constructors
  • -
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>)
  • +
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>>)
  • Method Members
  • Get()
  • -
  • Return(TRes)
  • +
  • Return(T)
  • @@ -157,8 +157,8 @@
    -

    ObjectPoolAdapter<TRes>.

    -

    ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>) Constructor

    +

    ObjectPoolAdapter<T>.

    +

    ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>>) Constructor

    @@ -176,14 +176,14 @@

    Summary

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    Containing Type
    -
    ObjectPoolAdapter<TRes>
    +
    ObjectPoolAdapter<T>

    Syntax

    -
    public ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>> objectPool)
    +
    public ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>> objectPool)
    diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html index daddd1c..7195859 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/FE9D92C7.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes>.Get() Method + CodeProject.ObjectPool - API - ObjectPoolAdapter<T>.Get() Method @@ -136,13 +136,13 @@
  • Namespace
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Type
  • -
  • ObjectPoolAdapter<TRes>
  • +
  • ObjectPoolAdapter<T>
  • Constructors
  • -
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>)
  • +
  • ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>>)
  • Method Members
  • Get()
  • -
  • Return(TRes)
  • +
  • Return(T)
  • @@ -156,7 +156,7 @@
    -

    ObjectPoolAdapter<TRes>.

    +

    ObjectPoolAdapter<T>.

    Get() Method

    @@ -175,14 +175,14 @@

    Summary

    CodeProject.ObjectPool.MicrosoftExtensionsAdapter
    Containing Type
    -
    ObjectPoolAdapter<TRes>
    +
    ObjectPoolAdapter<T>

    Syntax

    -
    public override TRes Get()
    +
    public override T Get()
    @@ -200,7 +200,7 @@

    Return Value

    - TRes + T An object from the pool. diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html index 1b67b1f..55ba558 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1/index.html @@ -6,7 +6,7 @@ - CodeProject.ObjectPool - API - ObjectPoolAdapter<TRes> Class + CodeProject.ObjectPool - API - ObjectPoolAdapter<T> Class @@ -75,6 +75,7 @@
    On This Page

    Summary

    Syntax

    +

    Remarks

    Type Parameters

    Constructors

    Methods

    @@ -139,7 +140,9 @@
  • CodeProject.ObjectPool.MicrosoftExtensionsAdapter
  • Class Types
  • -
  • ObjectPoolAdapter<TRes>
  • +
  • ObjectPoolAdapter
  • +
  • ObjectPoolAdapter<T>
  • +
  • ObjectPoolAdapterForPooledObject<T>
  • @@ -153,7 +156,7 @@
    -

    ObjectPoolAdapter<TRes> Class

    +

    ObjectPoolAdapter<T> Class

    @@ -188,7 +191,7 @@

    Summary

    graph TD Base0["Extensions.ObjectPool.ObjectPool<>"]-->Type - Type["ObjectPoolAdapter<TRes>"] + Type["ObjectPoolAdapter<T>"] class Type type-node
    @@ -198,10 +201,13 @@

    Summary

    Syntax

    -
    public sealed class ObjectPoolAdapter<TRes> : Extensions.ObjectPool.ObjectPool<TRes> 
    -    where TRes : class
    +
    public sealed class ObjectPoolAdapter<T> : Extensions.ObjectPool.ObjectPool<T> where T : class
    +

    Remarks

    +
    + This adapter should be used for types that do _not_ extend PooledObject class. +

    Type Parameters

    @@ -214,8 +220,8 @@

    Type Parameters

    Description - - TRes + + T The type of the resource. @@ -234,7 +240,7 @@

    Constructors

    - ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<TRes>>) + ObjectPoolAdapter(IObjectPool<PooledObjectWrapper<T>>) Adapts given object pool. @@ -260,7 +266,7 @@

    Methods

    Get() - TRes + T
    Retrieves an object from the pool. @@ -268,7 +274,7 @@

    Methods

    - Return(TRes) + Return(T) void
    diff --git a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html index 0c51318..d288aaf 100644 --- a/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html +++ b/docs/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/index.html @@ -176,7 +176,20 @@

    Class Types

    - ObjectPoolAdapter<TRes> + ObjectPoolAdapter + + Helper for getting object pool adapters. + + + + ObjectPoolAdapter<T> + + Adapts an IObjectPool<T> implementation to + Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. + + + + ObjectPoolAdapterForPooledObject<T> Adapts an IObjectPool<T> implementation to Microsoft.Extensions.ObjectPool.ObjectPool<T> abstract class. diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/3BADE41B.html b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/3BADE41B.html index 8742bca..3c34243 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/3BADE41B.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/3BADE41B.html @@ -162,7 +162,7 @@

    MinimumMemoryStreamCapacity Property

    Summary

    - Minimum capacity a System.IO.MemoryStream should have when created and this is the + Minimum capacity a MemoryStream should have when created and this is the minimum capacity of all streams stored in the pool. Defaults to DefaultMinimumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/4FCB017D.html b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/4FCB017D.html index 0488904..419e9f2 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/4FCB017D.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/4FCB017D.html @@ -162,7 +162,7 @@

    MaximumMemoryStreamCapacity Property

    Summary

    - Maximum capacity a System.IO.MemoryStream might have in order to be able to return + Maximum capacity a MemoryStream might have in order to be able to return to pool. Defaults to DefaultMaximumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html index 42ce9c6..a0dc8fe 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool/index.html @@ -136,14 +136,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • @@ -164,7 +164,7 @@

    IMemoryStreamPool Interface

    Summary

    - An object pool specialized in System.IO.MemoryStream management. + An object pool specialized in MemoryStream management.
    @@ -236,7 +236,7 @@

    Properties

    int
    - Maximum capacity a System.IO.MemoryStream might have in order to be able to return + Maximum capacity a MemoryStream might have in order to be able to return to pool. Defaults to DefaultMaximumMemoryStreamCapacity.
    @@ -246,7 +246,7 @@

    Properties

    int
    - Minimum capacity a System.IO.MemoryStream should have when created and this is the + Minimum capacity a MemoryStream should have when created and this is the minimum capacity of all streams stored in the pool. Defaults to DefaultMinimumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/19CAA55A.html b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/19CAA55A.html index 03eccbd..c777f8c 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/19CAA55A.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/19CAA55A.html @@ -164,7 +164,7 @@

    MinimumStringBuilderCapacity Property

    Summary

    - Minimum capacity a StringBuilder should have when created and this is the + Minimum capacity a System.Text.StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/5A9AAB0D.html b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/5A9AAB0D.html index 8084544..fe24b5d 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/5A9AAB0D.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/5A9AAB0D.html @@ -164,7 +164,7 @@

    MaximumStringBuilderCapacity Property

    Summary

    - Maximum capacity a StringBuilder might have in order to be able to return + Maximum capacity a System.Text.StringBuilder might have in order to be able to return to pool. Defaults to DefaultMaximumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html index b9e9d58..44ada5b 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool/index.html @@ -137,14 +137,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • @@ -165,7 +165,7 @@

    IStringBuilderPool Interface

    Summary

    - An object pool specialized in StringBuilder management. + An object pool specialized in System.Text.StringBuilder management.
    @@ -237,7 +237,7 @@

    Properties

    int
    - Maximum capacity a StringBuilder might have in order to be able to return + Maximum capacity a System.Text.StringBuilder might have in order to be able to return to pool. Defaults to DefaultMaximumStringBuilderCapacity.
    @@ -247,7 +247,7 @@

    Properties

    int
    - Minimum capacity a StringBuilder should have when created and this is the + Minimum capacity a System.Text.StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html index 377690c..9a4624d 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/A3099D76.html @@ -180,7 +180,7 @@

    MaximumMemoryStreamCapacity Property

    Summary

    - Maximum capacity a System.IO.MemoryStream might have in order to be able to return + Maximum capacity a MemoryStream might have in order to be able to return to pool. Defaults to DefaultMaximumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/D76F7810.html b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/D76F7810.html index 7f2d9fe..a0bd586 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/D76F7810.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/D76F7810.html @@ -180,7 +180,7 @@

    MinimumMemoryStreamCapacity Property

    Summary

    - Minimum capacity a System.IO.MemoryStream should have when created and this is the + Minimum capacity a MemoryStream should have when created and this is the minimum capacity of all streams stored in the pool. Defaults to DefaultMinimumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html index 74375f6..b89113e 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • @@ -168,7 +168,7 @@

    MemoryStreamPool Class

    Summary

    An IObjectPool<T> ready to be used. - System.IO.MemoryStream management can be further configured using the + MemoryStream management can be further configured using the MinimumMemoryStreamCapacity and MaximumMemoryStreamCapacity properties.
    @@ -338,7 +338,7 @@

    Properties

    int
    - Maximum capacity a System.IO.MemoryStream might have in order to be able to return + Maximum capacity a MemoryStream might have in order to be able to return to pool. Defaults to DefaultMaximumMemoryStreamCapacity.
    @@ -359,7 +359,7 @@

    Properties

    int
    - Minimum capacity a System.IO.MemoryStream should have when created and this is the + Minimum capacity a MemoryStream should have when created and this is the minimum capacity of all streams stored in the pool. Defaults to DefaultMinimumMemoryStreamCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html index d122662..9ff9307 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • @@ -167,7 +167,7 @@

    PooledMemoryStream Class

    Summary

    - Pooled object prepared to work with System.IO.MemoryStream instances. + Pooled object prepared to work with MemoryStream instances.
    @@ -338,7 +338,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html index 7342a79..e1d441b 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • @@ -348,7 +348,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html index caf3a62..a33b0c0 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/F9DE04DD.html @@ -181,7 +181,7 @@

    MinimumStringBuilderCapacity Property

    Summary

    - Minimum capacity a StringBuilder should have when created and this is the + Minimum capacity a System.Text.StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html index 9d13f0c..7e0c991 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/StringBuilderPool/index.html @@ -139,14 +139,14 @@
  • Namespace
  • CodeProject.ObjectPool.Specialized
  • -
  • Interface Types
  • -
  • IMemoryStreamPool
  • -
  • IStringBuilderPool
  • Class Types
  • MemoryStreamPool
  • PooledMemoryStream
  • PooledStringBuilder
  • StringBuilderPool
  • +
  • Interface Types
  • +
  • IMemoryStreamPool
  • +
  • IStringBuilderPool
  • @@ -168,7 +168,7 @@

    StringBuilderPool Class

    Summary

    An IObjectPool<T> ready to be used. - StringBuilder management can be further configured using the + System.Text.StringBuilder management can be further configured using the MinimumStringBuilderCapacity and MaximumStringBuilderCapacity properties.
    @@ -359,7 +359,7 @@

    Properties

    int
    - Minimum capacity a StringBuilder should have when created and this is the + Minimum capacity a System.Text.StringBuilder should have when created and this is the minimum capacity of all builders stored in the pool. Defaults to DefaultMinimumStringBuilderCapacity.
    diff --git a/docs/api/CodeProject.ObjectPool.Specialized/index.html b/docs/api/CodeProject.ObjectPool.Specialized/index.html index a85e3c2..a014b6f 100644 --- a/docs/api/CodeProject.ObjectPool.Specialized/index.html +++ b/docs/api/CodeProject.ObjectPool.Specialized/index.html @@ -73,8 +73,8 @@
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html index 8804bc8..359a2c1 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/85048E65.html @@ -171,7 +171,7 @@

    Dispose() Method

    Summary

    - See IDisposable docs. + See System.IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObject/index.html b/docs/api/CodeProject.ObjectPool/PooledObject/index.html index 8374e26..aa48eb3 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObject/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObject/index.html @@ -203,8 +203,8 @@

    Summary

    Derived Types
    @@ -219,10 +219,10 @@

    Summary

    Interface1["IEquatable<T>"]-.->Type Type["PooledObject"] class Type type-node - Type-->Derived0["PooledObjectWrapper<T>"] - click Derived0 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" - Type-->Derived1["PooledStringBuilder"] - click Derived1 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" + Type-->Derived0["PooledStringBuilder"] + click Derived0 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder" + Type-->Derived1["PooledObjectWrapper<T>"] + click Derived1 "/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper_1" Type-->Derived2["PooledMemoryStream"] click Derived2 "/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream" @@ -321,7 +321,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    diff --git a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html index 75c54e1..53940de 100644 --- a/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html +++ b/docs/api/CodeProject.ObjectPool/PooledObjectWrapper_1/index.html @@ -382,7 +382,7 @@

    Methods

    void
    - See IDisposable docs. + See System.IDisposable docs.
    Inherited from PooledObject
    diff --git a/docs/assets/js/searchIndex.js b/docs/assets/js/searchIndex.js index e0b96dd..fba6913 100644 --- a/docs/assets/js/searchIndex.js +++ b/docs/assets/js/searchIndex.js @@ -34,88 +34,88 @@ var searchModule = function() { a({ id:0, - title:"PooledObjectWrapper", - content:"PooledObjectWrapper", + title:"Logger", + content:"Logger", description:'', tags:'' }); a({ id:1, - title:"IMemoryStreamPool", - content:"IMemoryStreamPool", + title:"TimedObjectPool", + content:"TimedObjectPool", description:'', tags:'' }); a({ id:2, - title:"ObjectPoolAdapter", - content:"ObjectPoolAdapter", + title:"ILogProvider", + content:"ILogProvider", description:'', tags:'' }); a({ id:3, - title:"TimedObjectPool", - content:"TimedObjectPool", + title:"MemoryStreamPool", + content:"MemoryStreamPool", description:'', tags:'' }); a({ id:4, - title:"MemoryStreamPool", - content:"MemoryStreamPool", + title:"PooledMemoryStream", + content:"PooledMemoryStream", description:'', tags:'' }); a({ id:5, - title:"EvictionTimer", - content:"EvictionTimer", + title:"PooledObjectValidationContext", + content:"PooledObjectValidationContext", description:'', tags:'' }); a({ id:6, - title:"LogProvider", - content:"LogProvider", + title:"PooledStringBuilder", + content:"PooledStringBuilder", description:'', tags:'' }); a({ id:7, - title:"LogLevel", - content:"LogLevel", + title:"IEvictionTimer", + content:"IEvictionTimer", description:'', tags:'' }); a({ id:8, - title:"PooledObjectDirection", - content:"PooledObjectDirection", + title:"StringBuilderPool", + content:"StringBuilderPool", description:'', tags:'' }); a({ id:9, - title:"ITimedObjectPool", - content:"ITimedObjectPool", + title:"IObjectPool", + content:"IObjectPool", description:'', tags:'' }); a({ id:10, - title:"ObjectPool", - content:"ObjectPool", + title:"ObjectPoolAdapterForPooledObject", + content:"ObjectPoolAdapterForPooledObject", description:'', tags:'' }); @@ -130,163 +130,167 @@ var searchModule = function() { a({ id:12, - title:"IStringBuilderPool", - content:"IStringBuilderPool", + title:"ObjectPoolDiagnostics", + content:"ObjectPoolDiagnostics", description:'', tags:'' }); a({ id:13, - title:"PooledObjectWrapper", - content:"PooledObjectWrapper", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:14, - title:"PooledStringBuilder", - content:"PooledStringBuilder", + title:"ObjectPool", + content:"ObjectPool", description:'', tags:'' }); a({ id:15, - title:"ObjectPool", - content:"ObjectPool", + title:"PooledObjectWrapper", + content:"PooledObjectWrapper", description:'', tags:'' }); a({ id:16, - title:"StringBuilderPool", - content:"StringBuilderPool", + title:"ObjectPoolAdapter", + content:"ObjectPoolAdapter", description:'', tags:'' }); a({ id:17, - title:"IEvictionTimer", - content:"IEvictionTimer", + title:"PooledObjectBuffer", + content:"PooledObjectBuffer", description:'', tags:'' }); a({ id:18, - title:"IObjectPool", - content:"IObjectPool", + title:"ObjectPoolAdapter", + content:"ObjectPoolAdapter", description:'', tags:'' }); a({ id:19, - title:"PooledMemoryStream", - content:"PooledMemoryStream", + title:"LogProvider", + content:"LogProvider", description:'', tags:'' }); a({ id:20, - title:"PooledObjectBuffer", - content:"PooledObjectBuffer", + title:"IParameterizedObjectPool", + content:"IParameterizedObjectPool", description:'', tags:'' }); a({ id:21, - title:"EvictionSettings", - content:"EvictionSettings", + title:"IMemoryStreamPool", + content:"IMemoryStreamPool", description:'', tags:'' }); a({ id:22, - title:"PooledObjectValidationContext", - content:"PooledObjectValidationContext", + title:"LogLevel", + content:"LogLevel", description:'', tags:'' }); a({ id:23, - title:"ParameterizedObjectPool", - content:"ParameterizedObjectPool", + title:"PooledObjectWrapper", + content:"PooledObjectWrapper", description:'', tags:'' }); a({ id:24, - title:"IParameterizedObjectPool", - content:"IParameterizedObjectPool", + title:"PooledObjectState", + content:"PooledObjectState", description:'', tags:'' }); a({ id:25, - title:"PooledObjectInfo", - content:"PooledObjectInfo", + title:"ITimedObjectPool", + content:"ITimedObjectPool", description:'', tags:'' }); a({ id:26, - title:"PooledObjectState", - content:"PooledObjectState", + title:"ParameterizedObjectPool", + content:"ParameterizedObjectPool", description:'', tags:'' }); a({ id:27, - title:"ObjectPoolDiagnostics", - content:"ObjectPoolDiagnostics", + title:"EvictionSettings", + content:"EvictionSettings", description:'', tags:'' }); a({ id:28, - title:"ILogProvider", - content:"ILogProvider", + title:"PooledObjectInfo", + content:"PooledObjectInfo", description:'', tags:'' }); a({ id:29, - title:"Logger", - content:"Logger", + title:"PooledObjectDirection", + content:"PooledObjectDirection", description:'', tags:'' }); - y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper', - title:"PooledObjectWrapper", - description:"" + a({ + id:30, + title:"EvictionTimer", + content:"EvictionTimer", + description:'', + tags:'' }); - y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', - title:"IMemoryStreamPool", - description:"" + a({ + id:31, + title:"IStringBuilderPool", + content:"IStringBuilderPool", + description:'', + tags:'' }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', - title:"ObjectPoolAdapter", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/Logger', + title:"Logger", description:"" }); @@ -296,6 +300,12 @@ var searchModule = function() { description:"" }); + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', + title:"ILogProvider", + description:"" + }); + y({ url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/MemoryStreamPool', title:"MemoryStreamPool", @@ -303,38 +313,44 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionTimer', - title:"EvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', + title:"PooledMemoryStream", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', - title:"LogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', + title:"PooledObjectValidationContext", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', - title:"LogLevel", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', + title:"PooledStringBuilder", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectDirection', - title:"PooledObjectDirection", + url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', + title:"IEvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', - title:"ITimedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool', + title:"StringBuilderPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', + title:"IObjectPool", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapterForPooledObject_1', + title:"ObjectPoolAdapterForPooledObject", description:"" }); @@ -345,8 +361,20 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', - title:"IStringBuilderPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/ObjectPoolDiagnostics', + title:"ObjectPoolDiagnostics", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool', + title:"ObjectPool", + description:"" + }); + + y({ + url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', + title:"ObjectPool", description:"" }); @@ -357,98 +385,98 @@ var searchModule = function() { }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledStringBuilder', - title:"PooledStringBuilder", + url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter_1', + title:"ObjectPoolAdapter", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ObjectPool_1', - title:"ObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', + title:"PooledObjectBuffer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/StringBuilderPool', - title:"StringBuilderPool", + url:'/ObjectPool/api/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter', + title:"ObjectPoolAdapter", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IEvictionTimer', - title:"IEvictionTimer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogProvider', + title:"LogProvider", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IObjectPool_1', - title:"IObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', + title:"IParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/PooledMemoryStream', - title:"PooledMemoryStream", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IMemoryStreamPool', + title:"IMemoryStreamPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectBuffer_1', - title:"PooledObjectBuffer", + url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/LogLevel', + title:"LogLevel", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', - title:"EvictionSettings", + url:'/ObjectPool/api/CodeProject.ObjectPool/PooledObjectWrapper', + title:"PooledObjectWrapper", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectValidationContext', - title:"PooledObjectValidationContext", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', + title:"PooledObjectState", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/ParameterizedObjectPool_2', - title:"ParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/ITimedObjectPool_1', + title:"ITimedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool/IParameterizedObjectPool_2', - title:"IParameterizedObjectPool", + url:'/ObjectPool/api/CodeProject.ObjectPool/ParameterizedObjectPool_2', + title:"ParameterizedObjectPool", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', - title:"PooledObjectInfo", + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionSettings', + title:"EvictionSettings", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectState', - title:"PooledObjectState", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectInfo', + title:"PooledObjectInfo", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Core/ObjectPoolDiagnostics', - title:"ObjectPoolDiagnostics", + url:'/ObjectPool/api/CodeProject.ObjectPool.Core/PooledObjectDirection', + title:"PooledObjectDirection", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/ILogProvider', - title:"ILogProvider", + url:'/ObjectPool/api/CodeProject.ObjectPool/EvictionTimer', + title:"EvictionTimer", description:"" }); y({ - url:'/ObjectPool/api/CodeProject.ObjectPool.Logging/Logger', - title:"Logger", + url:'/ObjectPool/api/CodeProject.ObjectPool.Specialized/IStringBuilderPool', + title:"IStringBuilderPool", description:"" }); diff --git a/docs/feed.atom b/docs/feed.atom index 47b02d7..70d376d 100644 --- a/docs/feed.atom +++ b/docs/feed.atom @@ -4,7 +4,7 @@ https://pomma89.github.io/ObjectPool CodeProject.ObjectPool 2017 - 2017-09-30T10:34:11Z + 2017-09-30T18:08:23Z me diff --git a/docs/feed.rss b/docs/feed.rss index 8ebe70d..ddef99a 100644 --- a/docs/feed.rss +++ b/docs/feed.rss @@ -5,8 +5,8 @@ https://pomma89.github.io/ObjectPool 2017 - Sat, 30 Sep 2017 10:34:11 GMT - Sat, 30 Sep 2017 10:34:11 GMT + Sat, 30 Sep 2017 18:08:23 GMT + Sat, 30 Sep 2017 18:08:23 GMT New Release https://pomma89.github.io/ObjectPool/blog/new-release From 410dd6c70df11eadc66e5c0bcf966737d916ce86 Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sat, 30 Sep 2017 22:09:38 +0200 Subject: [PATCH 13/14] readme --- CHANGELOG.md | 2 +- README.md | 88 ++++++++++++++++++++++++++++------------------------ 2 files changed, 49 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 570164c..59cdc31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog for CodeProject.ObjectPool # -### v3.2.1 (2017-09-27) +### v3.2.1 (2017-09-30) * Added an adapter for Microsoft.Extensions.ObjectPool. diff --git a/README.md b/README.md index 3a050c5..f0463af 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ + [PDF](http://pomma89.altervista.org/objectpool/doc/refman.pdf) * [NuGet](https://www.nuget.org) package(s): + [CodeProject.ObjectPool](https://nuget.org/packages/CodeProject.ObjectPool/) + + [CodeProject.ObjectPool.MicrosoftExtensionsAdapter](https://nuget.org/packages/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/) ## Introduction ## @@ -137,26 +138,29 @@ In this benchmark we evaluate how long it takes to extract and return an object * [This project's ObjectPool](/~https://github.com/pomma89/ObjectPool/blob/master/src/CodeProject.ObjectPool/ObjectPool.cs) * [This project's ParameterizedObjectPool](/~https://github.com/pomma89/ObjectPool/blob/master/src/CodeProject.ObjectPool/ParameterizedObjectPool.cs) -* [Microsoft's ObjectPool](http://www.nuget.org/packages/Microsoft.Extensions.ObjectPool/) * [Original ObjectPool](http://www.codeproject.com/Articles/535735/Implementing-a-Generic-Object-Pool-in-NET) +* [Microsoft's ObjectPool](http://www.nuget.org/packages/Microsoft.Extensions.ObjectPool/) +* [This project's adapter for Microsoft's ObjectPool](/~https://github.com/pomma89/ObjectPool/blob/master/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs) ``` ini -BenchmarkDotNet=v0.10.3.0, OS=Microsoft Windows NT 6.2.9200.0 +BenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 1 (10.0.14393) Processor=AMD A10 Extreme Edition Radeon R8, 4C+8G, ProcessorCount=4 -Frequency=1949466 Hz, Resolution=512.9610 ns, Timer=TSC - [Host] : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1637.0 - RyuJitX64 : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1637.0 +Frequency=1949467 Hz, Resolution=512.9607 ns, Timer=TSC +.NET Core SDK=2.0.0 + [Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT + RyuJitX64 : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT Job=RyuJitX64 Jit=RyuJit Platform=X64 ``` - | Method | Mean | StdErr | StdDev | Median | Scaled | Scaled-StdDev | Gen 0 | Allocated | - |-------------- |-------------- |---------- |----------- |-------------- |------- |-------------- |------- |---------- | - | Simple | 121.7587 ns | 2.6138 ns | 9.7801 ns | 117.3474 ns | 1.00 | 0.00 | - | 0 B | - | Parameterized | 180.3051 ns | 0.4339 ns | 1.5644 ns | 180.0446 ns | 1.49 | 0.10 | 0.0331 | 24 B | - | Microsoft | 60.0949 ns | 0.7015 ns | 5.0583 ns | 57.2039 ns | 0.50 | 0.05 | - | 0 B | - | Original | 2,015.6827 ns | 8.4539 ns | 32.7417 ns | 2,023.0768 ns | 16.64 | 1.18 | - | 239 B | + | Method | Mean | Error | StdDev | Median | Scaled | ScaledSD | Gen 0 | Gen 1 | Allocated | + |----------------- |------------:|----------:|----------:|------------:|-------:|---------:|-------:|-------:|----------:| + | Simple | 235.58 ns | 4.935 ns | 10.729 ns | 237.90 ns | 1.00 | 0.00 | 0.1216 | - | 64 B | + | Parameterized | 334.42 ns | 6.966 ns | 20.211 ns | 340.66 ns | 1.42 | 0.11 | 0.1674 | - | 88 B | + | Original | 1,100.13 ns | 12.239 ns | 10.850 ns | 1,099.87 ns | 4.68 | 0.22 | 0.3399 | 0.0046 | 196 B | + | Microsoft | 79.35 ns | 1.791 ns | 2.329 ns | 79.92 ns | 0.34 | 0.02 | - | - | 0 B | + | AdaptedMicrosoft | 243.91 ns | 5.221 ns | 15.394 ns | 246.22 ns | 1.04 | 0.08 | 0.1216 | - | 64 B | ![](http://pomma89.altervista.org/objectpool/perf/RetrieveOneObject-barplot.png "Retrieve one object barplot") @@ -166,34 +170,39 @@ In this benchmark we evaluate how long it takes to extract and return an object * [This project's ObjectPool](/~https://github.com/pomma89/ObjectPool/blob/master/src/CodeProject.ObjectPool/ObjectPool.cs) * [This project's ParameterizedObjectPool](/~https://github.com/pomma89/ObjectPool/blob/master/src/CodeProject.ObjectPool/ParameterizedObjectPool.cs) -* [Microsoft's ObjectPool](http://www.nuget.org/packages/Microsoft.Extensions.ObjectPool/) * [Original ObjectPool](http://www.codeproject.com/Articles/535735/Implementing-a-Generic-Object-Pool-in-NET) +* [Microsoft's ObjectPool](http://www.nuget.org/packages/Microsoft.Extensions.ObjectPool/) +* [This project's adapter for Microsoft's ObjectPool](/~https://github.com/pomma89/ObjectPool/blob/master/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/ObjectPoolAdapter.cs) ``` ini -BenchmarkDotNet=v0.10.3.0, OS=Microsoft Windows NT 6.2.9200.0 +BenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 1 (10.0.14393) Processor=AMD A10 Extreme Edition Radeon R8, 4C+8G, ProcessorCount=4 -Frequency=1949466 Hz, Resolution=512.9610 ns, Timer=TSC - [Host] : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1637.0 - RyuJitX64 : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1637.0 +Frequency=1949467 Hz, Resolution=512.9607 ns, Timer=TSC +.NET Core SDK=2.0.0 + [Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT + RyuJitX64 : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT Job=RyuJitX64 Jit=RyuJit Platform=X64 ``` - | Method | Count | Mean | StdErr | StdDev | Scaled | Scaled-StdDev | Gen 0 | Gen 1 | Allocated | - |-------------- |------ |-------------- |----------- |----------- |------- |-------------- |-------- |-------- |---------- | - | **Simple** | **10** | **12.5464 us** | **0.0161 us** | **0.0559 us** | **1.00** | **0.00** | **2.0091** | **-** | **1.15 kB** | - | Parameterized | 10 | 14.6937 us | 0.1460 us | 0.8758 us | 1.17 | 0.07 | 2.4578 | - | 1.43 kB | - | Microsoft | 10 | 9.9922 us | 0.0994 us | 0.9325 us | 0.80 | 0.07 | 1.8722 | - | 1.12 kB | - | Original | 10 | 27.0116 us | 0.1161 us | 0.4184 us | 2.15 | 0.03 | - | - | 3.72 kB | - | **Simple** | **100** | **69.6033 us** | **0.4120 us** | **1.4271 us** | **1.00** | **0.00** | **0.0163** | **-** | **1.47 kB** | - | Parameterized | 100 | 78.6620 us | 0.6899 us | 2.3897 us | 1.13 | 0.04 | 6.0963 | - | 3.92 kB | - | Microsoft | 100 | 33.5158 us | 0.3347 us | 2.5710 us | 0.48 | 0.04 | 4.1996 | 0.7410 | 2.42 kB | - | Original | 100 | 177.8085 us | 0.8120 us | 3.1450 us | 2.56 | 0.07 | 3.6719 | - | 27.01 kB | - | **Simple** | **1000** | **800.4478 us** | **1.4427 us** | **5.2017 us** | **1.00** | **0.00** | **-** | **-** | **4.75 kB** | - | Parameterized | 1000 | 847.4692 us | 2.5917 us | 10.0377 us | 1.06 | 0.01 | 31.3802 | - | 27.91 kB | - | Microsoft | 1000 | 367.3571 us | 3.6502 us | 28.0380 us | 0.46 | 0.03 | 53.3482 | 10.9933 | 33.35 kB | - | Original | 1000 | 1,447.6767 us | 22.5522 us | 84.3827 us | 1.81 | 0.10 | - | - | 267.77 kB | + | Method | Count | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Gen 1 | Allocated | + |----------------- |------ |------------:|-----------:|-----------:|-------:|---------:|---------:|--------:|----------:| + | **Simple** | **10** | **16.20 us** | **0.3121 us** | **0.4166 us** | **1.00** | **0.00** | **4.9215** | **-** | **2.35 KB** | + | Parameterized | 10 | 16.04 us | 0.2204 us | 0.2062 us | 0.99 | 0.03 | 5.6030 | - | 2.56 KB | + | Original | 10 | 18.60 us | 0.1700 us | 0.1420 us | 1.15 | 0.03 | 7.6222 | - | 3 KB | + | Microsoft | 10 | 14.04 us | 0.2648 us | 0.2211 us | 0.87 | 0.03 | 3.6167 | - | 1.74 KB | + | AdaptedMicrosoft | 10 | 15.80 us | 0.2689 us | 0.2099 us | 0.98 | 0.03 | 5.0049 | - | 2.35 KB | + | **Simple** | **100** | **66.00 us** | **1.2006 us** | **1.0643 us** | **1.00** | **0.00** | **16.6273** | **-** | **4.75 KB** | + | Parameterized | 100 | 84.03 us | 1.6033 us | 1.5746 us | 1.27 | 0.03 | 21.5088 | - | 5.09 KB | + | Original | 100 | 133.08 us | 1.0699 us | 1.0008 us | 2.02 | 0.03 | 43.2617 | - | 14.15 KB | + | Microsoft | 100 | 32.72 us | 0.6511 us | 0.6395 us | 0.50 | 0.01 | 5.3711 | 0.9359 | 1.87 KB | + | AdaptedMicrosoft | 100 | 74.85 us | 1.4805 us | 2.3908 us | 1.13 | 0.04 | 16.5876 | - | 4.66 KB | + | **Simple** | **1000** | **756.57 us** | **4.9338 us** | **4.6151 us** | **1.00** | **0.00** | **128.0599** | **-** | **19.8 KB** | + | Parameterized | 1000 | 499.51 us | 3.4858 us | 2.7215 us | 0.66 | 0.01 | 174.9349 | - | 25.92 KB | + | Original | 1000 | 1,222.56 us | 12.8086 us | 11.9812 us | 1.62 | 0.02 | 337.2396 | 9.3750 | 101.38 KB | + | Microsoft | 1000 | 428.70 us | 8.3805 us | 8.6061 us | 0.57 | 0.01 | 48.0572 | 15.8991 | 4.12 KB | + | AdaptedMicrosoft | 1000 | 824.49 us | 6.4987 us | 6.0789 us | 1.09 | 0.01 | 128.0599 | - | 19.67 KB | ![](http://pomma89.altervista.org/objectpool/perf/RetrieveObjectsConcurrently-barplot.png "Retrieve objects concurrently barplot") @@ -206,19 +215,20 @@ In this benchmark we evaluate how long it takes to extract and return a memory s ``` ini -BenchmarkDotNet=v0.10.3.0, OS=Microsoft Windows NT 6.2.9200.0 +BenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 1 (10.0.14393) Processor=AMD A10 Extreme Edition Radeon R8, 4C+8G, ProcessorCount=4 -Frequency=1949466 Hz, Resolution=512.9610 ns, Timer=TSC - [Host] : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1637.0 - RyuJitX64 : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1637.0 +Frequency=1949467 Hz, Resolution=512.9607 ns, Timer=TSC +.NET Core SDK=2.0.0 + [Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT + RyuJitX64 : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT Job=RyuJitX64 Jit=RyuJit Platform=X64 ``` - | Method | Mean | StdDev | Scaled | Scaled-StdDev | Gen 0 | Allocated | - |------------------------------ |-------------- |----------- |------- |-------------- |------- |---------- | - | MemoryStreamPool | 173.8324 ns | 5.5788 ns | 1.00 | 0.00 | - | 0 B | - | RecyclableMemoryStreamManager | 3,406.0877 ns | 88.6058 ns | 19.61 | 0.76 | 0.7796 | 448 B | + | Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Allocated | + |------------------------------ |-----------:|----------:|----------:|-------:|---------:|-------:|----------:| + | MemoryStreamPool | 360.4 ns | 7.187 ns | 14.68 ns | 1.00 | 0.00 | 0.1216 | 64 B | + | RecyclableMemoryStreamManager | 4,207.3 ns | 85.152 ns | 251.07 ns | 11.69 | 0.84 | 0.8469 | 448 B | ![](http://pomma89.altervista.org/objectpool/perf/MemoryStreamPooling-barplot.png "Memory stream pooling barplot") @@ -227,5 +237,3 @@ Job=RyuJitX64 Jit=RyuJit Platform=X64 Everything done on this repository is freely offered on the terms of the project license. You are free to do everything you want with the code and its related files, as long as you respect the license and use common sense while doing it :-) I maintain this project during my spare time, so I can offer limited assistance and I can offer **no kind of warranty**. - -Development of this project is sponsored by [Finsa SpA](https://www.finsa.it), my current employer. From 7b2fabd737ff0247f64c32df5ac8082a2847720b Mon Sep 17 00:00:00 2001 From: Alessio Parma Date: Sun, 1 Oct 2017 09:16:11 +0200 Subject: [PATCH 14/14] readme --- README.md | 32 ++++++++++++++----- ...jectPool.MicrosoftExtensionsAdapter.csproj | 2 +- .../CodeProject.ObjectPool.Examples.csproj | 1 + .../Program.cs | 20 ++++++++++++ 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f0463af..1a864bb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ *A generic, concurrent, portable and flexible Object Pool for the .NET Framework, completely based on the [Code Project article of Ofir Makmal](http://www.codeproject.com/Articles/535735/Implementing-a-Generic-Object-Pool-in-NET).* -## Summary ## +## Summary * Latest release version: `v3.2.1` * Build status on [Travis CI](https://travis-ci.org): [![Build Status](https://travis-ci.org/pomma89/ObjectPool.svg?branch=master)](https://travis-ci.org/pomma89/ObjectPool) @@ -16,7 +16,7 @@ + [CodeProject.ObjectPool](https://nuget.org/packages/CodeProject.ObjectPool/) + [CodeProject.ObjectPool.MicrosoftExtensionsAdapter](https://nuget.org/packages/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/) -## Introduction ## +## Introduction Library is production ready and it is successfully working in real life systems. @@ -28,7 +28,6 @@ Many thanks to Ofir Makmal for his great work. Quick and dirty example: - ```cs /// /// Example usages of ObjectPool. @@ -79,6 +78,23 @@ internal static class Program Thread.Sleep(TimeSpan.FromSeconds(4)); Console.WriteLine($"Timed pool size after 4 seconds: {timedPool.ObjectsInPoolCount}"); // Should be 0 + // Adapts a timed pool to Microsoft Extensions abstraction. + var mPool = ObjectPoolAdapter.CreateForPooledObject(timedPool); + + // Sample usage of Microsoft pool. + var mResource = mPool.Get(); + Debug.Assert(mResource is ExpensiveResource); + mPool.Return(mResource); + + // Adapts a new pool to Microsoft Extensions abstraction. This example shows how to adapt + // when object type does not extend PooledObject. + var mPool2 = ObjectPoolAdapter.Create(new ObjectPool>(() => PooledObjectWrapper.Create(new MemoryStream()))); + + // Sample usage of second Microsoft pool. + var mResource2 = mPool2.Get(); + Debug.Assert(mResource2 is MemoryStream); + mPool2.Return(mResource2); + Console.Read(); } @@ -128,11 +144,11 @@ internal sealed class ExternalExpensiveResource } ``` -## Benchmarks ## +## Benchmarks All benchmarks were implemented and run using the wonderful [BenchmarkDotNet](/~https://github.com/dotnet/BenchmarkDotNet) library. -### [Retrieve one object](/~https://github.com/pomma89/ObjectPool/blob/master/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs) ### +### [Retrieve one object](/~https://github.com/pomma89/ObjectPool/blob/master/test/CodeProject.ObjectPool.Benchmarks/RetrieveOneObject.cs) In this benchmark we evaluate how long it takes to extract and return an object stored into the pool, using a single thread. We compare four implementations: @@ -164,7 +180,7 @@ Job=RyuJitX64 Jit=RyuJit Platform=X64 ![](http://pomma89.altervista.org/objectpool/perf/RetrieveOneObject-barplot.png "Retrieve one object barplot") -### [Retrieve objects concurrently](/~https://github.com/pomma89/ObjectPool/blob/master/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs) ### +### [Retrieve objects concurrently](/~https://github.com/pomma89/ObjectPool/blob/master/test/CodeProject.ObjectPool.Benchmarks/RetrieveObjectsConcurrently.cs) In this benchmark we evaluate how long it takes to extract and return an object stored into the pool, using `Count` threads. We compare four implementations: @@ -206,7 +222,7 @@ Job=RyuJitX64 Jit=RyuJit Platform=X64 ![](http://pomma89.altervista.org/objectpool/perf/RetrieveObjectsConcurrently-barplot.png "Retrieve objects concurrently barplot") -### [Memory stream pooling](/~https://github.com/pomma89/ObjectPool/blob/master/test/CodeProject.ObjectPool.Benchmarks/MemoryStreamPooling.cs) ### +### [Memory stream pooling](/~https://github.com/pomma89/ObjectPool/blob/master/test/CodeProject.ObjectPool.Benchmarks/MemoryStreamPooling.cs) In this benchmark we evaluate how long it takes to extract and return a memory stream stored into the pool, using a single thread. We compare two implementations: @@ -232,7 +248,7 @@ Job=RyuJitX64 Jit=RyuJit Platform=X64 ![](http://pomma89.altervista.org/objectpool/perf/MemoryStreamPooling-barplot.png "Memory stream pooling barplot") -## About this repository and its maintainer ## +## About this repository and its maintainer Everything done on this repository is freely offered on the terms of the project license. You are free to do everything you want with the code and its related files, as long as you respect the license and use common sense while doing it :-) diff --git a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj index d04d0e4..db7d874 100644 --- a/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj +++ b/src/CodeProject.ObjectPool.MicrosoftExtensionsAdapter/CodeProject.ObjectPool.MicrosoftExtensionsAdapter.csproj @@ -13,7 +13,7 @@ CodeProject.ObjectPool.MicrosoftExtensionsAdapter Generic and concurrent Object Pool - Adapter for Microsoft Extensions A generic, concurrent, portable and flexible Object Pool for the .NET Framework. - $(Summary) It is completely based on the Code Project article of Ofir Makmal (http://goo.gl/4qig6T). Library is production ready and it is successfully working in real life systems. Original source code has been modified, in order to introduce a Parameterized Object Pool, already drafted by Ofir Makmal in the comments of the article. Moreover, a few unit tests have been added, in order to improve code reliability, and a lot of other small changes have also been applied. Of course, all modified source code is freely available at the project URL of this package. Many thanks to Ofir Makmal for his great work. + $(Summary) This package contains an adapter for Microsoft.Extensions.ObjectPool abstraction. codeproject;object;pool;microsoft;extensions;adapter diff --git a/test/CodeProject.ObjectPool.Examples/CodeProject.ObjectPool.Examples.csproj b/test/CodeProject.ObjectPool.Examples/CodeProject.ObjectPool.Examples.csproj index b5bacfe..ad8a973 100644 --- a/test/CodeProject.ObjectPool.Examples/CodeProject.ObjectPool.Examples.csproj +++ b/test/CodeProject.ObjectPool.Examples/CodeProject.ObjectPool.Examples.csproj @@ -6,5 +6,6 @@ + \ No newline at end of file diff --git a/test/CodeProject.ObjectPool.Examples/Program.cs b/test/CodeProject.ObjectPool.Examples/Program.cs index 9f50dc5..ce9aca6 100644 --- a/test/CodeProject.ObjectPool.Examples/Program.cs +++ b/test/CodeProject.ObjectPool.Examples/Program.cs @@ -21,7 +21,10 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT // OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +using CodeProject.ObjectPool.MicrosoftExtensionsAdapter; using System; +using System.Diagnostics; +using System.IO; using System.Threading; namespace CodeProject.ObjectPool.Examples @@ -75,6 +78,23 @@ private static void Main() Thread.Sleep(TimeSpan.FromSeconds(4)); Console.WriteLine($"Timed pool size after 4 seconds: {timedPool.ObjectsInPoolCount}"); // Should be 0 + // Adapts a timed pool to Microsoft Extensions abstraction. + var mPool = ObjectPoolAdapter.CreateForPooledObject(timedPool); + + // Sample usage of Microsoft pool. + var mResource = mPool.Get(); + Debug.Assert(mResource is ExpensiveResource); + mPool.Return(mResource); + + // Adapts a new pool to Microsoft Extensions abstraction. This example shows how to adapt + // when object type does not extend PooledObject. + var mPool2 = ObjectPoolAdapter.Create(new ObjectPool>(() => PooledObjectWrapper.Create(new MemoryStream()))); + + // Sample usage of second Microsoft pool. + var mResource2 = mPool2.Get(); + Debug.Assert(mResource2 is MemoryStream); + mPool2.Return(mResource2); + Console.Read(); }