You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

676 lines
37 KiB

  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class SingleCreationValueCache&lt;TKey, TValue&gt;
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class SingleCreationValueCache&lt;TKey, TValue&gt;
  11. ">
  12. <meta name="generator" content="docfx 2.48.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <link rel="stylesheet" href="../styles/fix.css">
  18. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  19. <meta property="docfx:navrel" content="../toc.html">
  20. <meta property="docfx:tocrel" content="toc.html">
  21. <meta property="docfx:rel" content="../">
  22. <meta property="docfx:newtab" content="true">
  23. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  24. <div id="wrapper">
  25. <header>
  26. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  27. <div class="container">
  28. <div class="navbar-header">
  29. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  30. <span class="sr-only">Toggle navigation</span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. <span class="icon-bar"></span>
  34. </button>
  35. <a class="navbar-brand" href="../index.html">
  36. <img id="logo" class="svg" src="../logo.svg" alt="">
  37. </a>
  38. </div>
  39. <div class="collapse navbar-collapse" id="navbar">
  40. <form class="navbar-form navbar-right" role="search" id="search">
  41. <div class="form-group">
  42. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  43. </div>
  44. </form>
  45. </div>
  46. </div>
  47. </nav>
  48. <div class="subnav navbar navbar-default">
  49. <div class="container hide-when-search" id="breadcrumb">
  50. <ul class="breadcrumb">
  51. <li></li>
  52. </ul>
  53. </div>
  54. </div>
  55. </header>
  56. <div class="container body-content">
  57. <div id="search-results">
  58. <div class="search-list"></div>
  59. <div class="sr-items">
  60. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  61. </div>
  62. <ul id="pagination"></ul>
  63. </div>
  64. </div>
  65. <div role="main" class="container body-content hide-when-search">
  66. <div class="sidenav hide-when-search">
  67. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  68. <div class="sidetoggle collapse" id="sidetoggle">
  69. <div id="sidetoc"></div>
  70. </div>
  71. </div>
  72. <div class="article row grid-right">
  73. <div class="col-md-10">
  74. <article class="content wrap" id="_content" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2">
  75. <h1 id="IPA_Utilities_Async_SingleCreationValueCache_2" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2" class="text-break">Class SingleCreationValueCache&lt;TKey, TValue&gt;
  76. </h1>
  77. <div class="markdown level0 summary"><p>A dictionary-like type intended for thread-safe value caches whose values are created only once ever.</p>
  78. </div>
  79. <div class="markdown level0 conceptual"></div>
  80. <div class="inheritance">
  81. <h5>Inheritance</h5>
  82. <div class="level0"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></div>
  83. <div class="level1"><span class="xref">SingleCreationValueCache&lt;TKey, TValue&gt;</span></div>
  84. </div>
  85. <div class="inheritedMembers">
  86. <h5>Inherited Members</h5>
  87. <div>
  88. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
  89. </div>
  90. <div>
  91. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_">Object.Equals(Object)</a>
  92. </div>
  93. <div>
  94. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_System_Object_">Object.Equals(Object, Object)</a>
  95. </div>
  96. <div>
  97. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.referenceequals#System_Object_ReferenceEquals_System_Object_System_Object_">Object.ReferenceEquals(Object, Object)</a>
  98. </div>
  99. <div>
  100. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#System_Object_GetHashCode">Object.GetHashCode()</a>
  101. </div>
  102. <div>
  103. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#System_Object_GetType">Object.GetType()</a>
  104. </div>
  105. <div>
  106. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#System_Object_MemberwiseClone">Object.MemberwiseClone()</a>
  107. </div>
  108. </div>
  109. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.Async.html">IPA.Utilities.Async</a></h6>
  110. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  111. <h5 id="IPA_Utilities_Async_SingleCreationValueCache_2_syntax">Syntax</h5>
  112. <div class="codewrapper">
  113. <pre><code class="lang-csharp hljs">public class SingleCreationValueCache&lt;TKey, TValue&gt;</code></pre>
  114. </div>
  115. <h5 class="typeParameters">Type Parameters</h5>
  116. <table class="table table-bordered table-striped table-condensed">
  117. <thead>
  118. <tr>
  119. <th>Name</th>
  120. <th>Description</th>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. <tr>
  125. <td><span class="parametername">TKey</span></td>
  126. <td><p>the key type of the cache</p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td><span class="parametername">TValue</span></td>
  131. <td><p>the value type of the cache</p>
  132. </td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. <h5 id="IPA_Utilities_Async_SingleCreationValueCache_2_remarks"><strong>Remarks</strong></h5>
  137. <div class="markdown level0 remarks"><p>This object basically wraps a <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.concurrent.concurrentdictionary-2">ConcurrentDictionary&lt;TKey,TValue&gt;</a> with some special handling
  138. to ensure that values are only created once ever, without having multiple parallel constructions.</p>
  139. </div>
  140. <h3 id="constructors">Constructors
  141. </h3>
  142. <span class="small pull-right mobile-hide">
  143. <span class="divider">|</span>
  144. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  145. </span>
  146. <span class="small pull-right mobile-hide">
  147. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L38">View Source</a>
  148. </span>
  149. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  150. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor">SingleCreationValueCache()</h4>
  151. <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="IPA.Utilities.Async.SingleCreationValueCache-2.html">SingleCreationValueCache&lt;TKey, TValue&gt;</a>
  152. class that is empty, has the default concurrency level, has the default initial
  153. capacity, and uses the default comparer for the key type.</p>
  154. </div>
  155. <div class="markdown level1 conceptual"></div>
  156. <h5 class="decalaration">Declaration</h5>
  157. <div class="codewrapper">
  158. <pre><code class="lang-csharp hljs">public SingleCreationValueCache()</code></pre>
  159. </div>
  160. <span class="small pull-right mobile-hide">
  161. <span class="divider">|</span>
  162. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair__0__1___.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor(System.Collections.Generic.IEnumerable%7BSystem.Collections.Generic.KeyValuePair%7B%600%2C%601%7D%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  163. </span>
  164. <span class="small pull-right mobile-hide">
  165. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L49">View Source</a>
  166. </span>
  167. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  168. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair__0__1___" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{`0,`1}})">SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;)</h4>
  169. <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="IPA.Utilities.Async.SingleCreationValueCache-2.html">SingleCreationValueCache&lt;TKey, TValue&gt;</a>
  170. class that contains elements copied from the specified <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a>,
  171. has the default concurrency level, has the default initial capacity, and uses
  172. the default comparer for the key type.</p>
  173. </div>
  174. <div class="markdown level1 conceptual"></div>
  175. <h5 class="decalaration">Declaration</h5>
  176. <div class="codewrapper">
  177. <pre><code class="lang-csharp hljs">public SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt; collection)</code></pre>
  178. </div>
  179. <h5 class="parameters">Parameters</h5>
  180. <table class="table table-bordered table-striped table-condensed">
  181. <thead>
  182. <tr>
  183. <th>Type</th>
  184. <th>Name</th>
  185. <th>Description</th>
  186. </tr>
  187. </thead>
  188. <tbody>
  189. <tr>
  190. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, TValue&gt;&gt;</td>
  191. <td><span class="parametername">collection</span></td>
  192. <td><p>the <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> whose element are to be used for the new cache</p>
  193. </td>
  194. </tr>
  195. </tbody>
  196. </table>
  197. <h5 class="exceptions">Exceptions</h5>
  198. <table class="table table-bordered table-striped table-condensed">
  199. <thead>
  200. <tr>
  201. <th>Type</th>
  202. <th>Condition</th>
  203. </tr>
  204. </thead>
  205. <tbody>
  206. <tr>
  207. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
  208. <td><p>when any arguments are null</p>
  209. </td>
  210. </tr>
  211. <tr>
  212. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  213. <td><p><code data-dev-comment-type="paramref" class="paramref">collection</code> contains duplicate keys</p>
  214. </td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. <span class="small pull-right mobile-hide">
  219. <span class="divider">|</span>
  220. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair__0__1___System_Collections_Generic_IEqualityComparer__0__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor(System.Collections.Generic.IEnumerable%7BSystem.Collections.Generic.KeyValuePair%7B%600%2C%601%7D%7D%2CSystem.Collections.Generic.IEqualityComparer%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  221. </span>
  222. <span class="small pull-right mobile-hide">
  223. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L69">View Source</a>
  224. </span>
  225. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  226. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_System_Collections_Generic_IEnumerable_System_Collections_Generic_KeyValuePair__0__1___System_Collections_Generic_IEqualityComparer__0__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{`0,`1}},System.Collections.Generic.IEqualityComparer{`0})">SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEqualityComparer&lt;TKey&gt;)</h4>
  227. <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="IPA.Utilities.Async.SingleCreationValueCache-2.html">SingleCreationValueCache&lt;TKey, TValue&gt;</a>
  228. class that contains elements copied from the specified <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a>
  229. has the default concurrency level, has the default initial capacity, and uses
  230. the specified <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1">IEqualityComparer&lt;T&gt;</a>.</p>
  231. </div>
  232. <div class="markdown level1 conceptual"></div>
  233. <h5 class="decalaration">Declaration</h5>
  234. <div class="codewrapper">
  235. <pre><code class="lang-csharp hljs">public SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt; collection, IEqualityComparer&lt;TKey&gt; comparer)</code></pre>
  236. </div>
  237. <h5 class="parameters">Parameters</h5>
  238. <table class="table table-bordered table-striped table-condensed">
  239. <thead>
  240. <tr>
  241. <th>Type</th>
  242. <th>Name</th>
  243. <th>Description</th>
  244. </tr>
  245. </thead>
  246. <tbody>
  247. <tr>
  248. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, TValue&gt;&gt;</td>
  249. <td><span class="parametername">collection</span></td>
  250. <td><p>the <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> whose elements are to be used for the new cache</p>
  251. </td>
  252. </tr>
  253. <tr>
  254. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1">IEqualityComparer</a>&lt;TKey&gt;</td>
  255. <td><span class="parametername">comparer</span></td>
  256. <td><p>the equality comparer to use when comparing keys</p>
  257. </td>
  258. </tr>
  259. </tbody>
  260. </table>
  261. <h5 class="exceptions">Exceptions</h5>
  262. <table class="table table-bordered table-striped table-condensed">
  263. <thead>
  264. <tr>
  265. <th>Type</th>
  266. <th>Condition</th>
  267. </tr>
  268. </thead>
  269. <tbody>
  270. <tr>
  271. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
  272. <td><p><code data-dev-comment-type="paramref" class="paramref">collection</code> or <code data-dev-comment-type="paramref" class="paramref">comparer</code> is null</p>
  273. </td>
  274. </tr>
  275. </tbody>
  276. </table>
  277. <span class="small pull-right mobile-hide">
  278. <span class="divider">|</span>
  279. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor_System_Collections_Generic_IEqualityComparer__0__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor(System.Collections.Generic.IEqualityComparer%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  280. </span>
  281. <span class="small pull-right mobile-hide">
  282. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L58">View Source</a>
  283. </span>
  284. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  285. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_System_Collections_Generic_IEqualityComparer__0__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor(System.Collections.Generic.IEqualityComparer{`0})">SingleCreationValueCache(IEqualityComparer&lt;TKey&gt;)</h4>
  286. <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="IPA.Utilities.Async.SingleCreationValueCache-2.html">SingleCreationValueCache&lt;TKey, TValue&gt;</a>
  287. class that is empty, has the default concurrency level and capacity, and uses
  288. the specified <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1">IEqualityComparer&lt;T&gt;</a>.</p>
  289. </div>
  290. <div class="markdown level1 conceptual"></div>
  291. <h5 class="decalaration">Declaration</h5>
  292. <div class="codewrapper">
  293. <pre><code class="lang-csharp hljs">public SingleCreationValueCache(IEqualityComparer&lt;TKey&gt; comparer)</code></pre>
  294. </div>
  295. <h5 class="parameters">Parameters</h5>
  296. <table class="table table-bordered table-striped table-condensed">
  297. <thead>
  298. <tr>
  299. <th>Type</th>
  300. <th>Name</th>
  301. <th>Description</th>
  302. </tr>
  303. </thead>
  304. <tbody>
  305. <tr>
  306. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1">IEqualityComparer</a>&lt;TKey&gt;</td>
  307. <td><span class="parametername">comparer</span></td>
  308. <td><p>the equality comparer to use when comparing keys</p>
  309. </td>
  310. </tr>
  311. </tbody>
  312. </table>
  313. <h5 class="exceptions">Exceptions</h5>
  314. <table class="table table-bordered table-striped table-condensed">
  315. <thead>
  316. <tr>
  317. <th>Type</th>
  318. <th>Condition</th>
  319. </tr>
  320. </thead>
  321. <tbody>
  322. <tr>
  323. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
  324. <td><p><code data-dev-comment-type="paramref" class="paramref">comparer</code> is null</p>
  325. </td>
  326. </tr>
  327. </tbody>
  328. </table>
  329. <h3 id="properties">Properties
  330. </h3>
  331. <span class="small pull-right mobile-hide">
  332. <span class="divider">|</span>
  333. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_Count.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.Count%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  334. </span>
  335. <span class="small pull-right mobile-hide">
  336. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L80">View Source</a>
  337. </span>
  338. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_Count_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Count*"></a>
  339. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_Count" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Count">Count</h4>
  340. <div class="markdown level1 summary"><p>Gets the number of elements that this cache contains.</p>
  341. </div>
  342. <div class="markdown level1 conceptual"></div>
  343. <h5 class="decalaration">Declaration</h5>
  344. <div class="codewrapper">
  345. <pre><code class="lang-csharp hljs">public int Count { get; }</code></pre>
  346. </div>
  347. <h5 class="propertyValue">Property Value</h5>
  348. <table class="table table-bordered table-striped table-condensed">
  349. <thead>
  350. <tr>
  351. <th>Type</th>
  352. <th>Description</th>
  353. </tr>
  354. </thead>
  355. <tbody>
  356. <tr>
  357. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int32">Int32</a></td>
  358. <td></td>
  359. </tr>
  360. </tbody>
  361. </table>
  362. <span class="small pull-right mobile-hide">
  363. <span class="divider">|</span>
  364. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_IsEmpty.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.IsEmpty%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  365. </span>
  366. <span class="small pull-right mobile-hide">
  367. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L76">View Source</a>
  368. </span>
  369. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_IsEmpty_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.IsEmpty*"></a>
  370. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_IsEmpty" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.IsEmpty">IsEmpty</h4>
  371. <div class="markdown level1 summary"><p>Gets a value that indicates whether this cache is empty. </p>
  372. </div>
  373. <div class="markdown level1 conceptual"></div>
  374. <h5 class="decalaration">Declaration</h5>
  375. <div class="codewrapper">
  376. <pre><code class="lang-csharp hljs">public bool IsEmpty { get; }</code></pre>
  377. </div>
  378. <h5 class="propertyValue">Property Value</h5>
  379. <table class="table table-bordered table-striped table-condensed">
  380. <thead>
  381. <tr>
  382. <th>Type</th>
  383. <th>Description</th>
  384. </tr>
  385. </thead>
  386. <tbody>
  387. <tr>
  388. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  389. <td></td>
  390. </tr>
  391. </tbody>
  392. </table>
  393. <h3 id="methods">Methods
  394. </h3>
  395. <span class="small pull-right mobile-hide">
  396. <span class="divider">|</span>
  397. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_Clear.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.Clear%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  398. </span>
  399. <span class="small pull-right mobile-hide">
  400. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L85">View Source</a>
  401. </span>
  402. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_Clear_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Clear*"></a>
  403. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_Clear" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Clear">Clear()</h4>
  404. <div class="markdown level1 summary"><p>Clears the cache.</p>
  405. </div>
  406. <div class="markdown level1 conceptual"></div>
  407. <h5 class="decalaration">Declaration</h5>
  408. <div class="codewrapper">
  409. <pre><code class="lang-csharp hljs">public void Clear()</code></pre>
  410. </div>
  411. <span class="small pull-right mobile-hide">
  412. <span class="divider">|</span>
  413. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_ContainsKey__0_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.ContainsKey(%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  414. </span>
  415. <span class="small pull-right mobile-hide">
  416. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L91">View Source</a>
  417. </span>
  418. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_ContainsKey_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ContainsKey*"></a>
  419. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_ContainsKey__0_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ContainsKey(`0)">ContainsKey(TKey)</h4>
  420. <div class="markdown level1 summary"><p>Gets a value indicating whether or not this cache contains <code data-dev-comment-type="paramref" class="paramref">key</code>.</p>
  421. </div>
  422. <div class="markdown level1 conceptual"></div>
  423. <h5 class="decalaration">Declaration</h5>
  424. <div class="codewrapper">
  425. <pre><code class="lang-csharp hljs">public bool ContainsKey(TKey key)</code></pre>
  426. </div>
  427. <h5 class="parameters">Parameters</h5>
  428. <table class="table table-bordered table-striped table-condensed">
  429. <thead>
  430. <tr>
  431. <th>Type</th>
  432. <th>Name</th>
  433. <th>Description</th>
  434. </tr>
  435. </thead>
  436. <tbody>
  437. <tr>
  438. <td><span class="xref">TKey</span></td>
  439. <td><span class="parametername">key</span></td>
  440. <td><p>the key to search for</p>
  441. </td>
  442. </tr>
  443. </tbody>
  444. </table>
  445. <h5 class="returns">Returns</h5>
  446. <table class="table table-bordered table-striped table-condensed">
  447. <thead>
  448. <tr>
  449. <th>Type</th>
  450. <th>Description</th>
  451. </tr>
  452. </thead>
  453. <tbody>
  454. <tr>
  455. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  456. <td><p><span class="xref">true</span> if the cache contains the key, <span class="xref">false</span> otherwise</p>
  457. </td>
  458. </tr>
  459. </tbody>
  460. </table>
  461. <span class="small pull-right mobile-hide">
  462. <span class="divider">|</span>
  463. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_GetOrAdd__0_System_Func__0__1__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.GetOrAdd(%600%2CSystem.Func%7B%600%2C%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  464. </span>
  465. <span class="small pull-right mobile-hide">
  466. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L126">View Source</a>
  467. </span>
  468. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_GetOrAdd_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.GetOrAdd*"></a>
  469. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_GetOrAdd__0_System_Func__0__1__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.GetOrAdd(`0,System.Func{`0,`1})">GetOrAdd(TKey, Func&lt;TKey, TValue&gt;)</h4>
  470. <div class="markdown level1 summary"><p>Gets the value associated with the specified key from the cache. If it does not exist, and
  471. no creators are currently running for this key, then the creator is called to create the value
  472. and the value is added to the cache. If there is a creator currently running for the key, then
  473. this waits for the creator to finish and retrieves the value.</p>
  474. </div>
  475. <div class="markdown level1 conceptual"></div>
  476. <h5 class="decalaration">Declaration</h5>
  477. <div class="codewrapper">
  478. <pre><code class="lang-csharp hljs">public TValue GetOrAdd(TKey key, Func&lt;TKey, TValue&gt; creator)</code></pre>
  479. </div>
  480. <h5 class="parameters">Parameters</h5>
  481. <table class="table table-bordered table-striped table-condensed">
  482. <thead>
  483. <tr>
  484. <th>Type</th>
  485. <th>Name</th>
  486. <th>Description</th>
  487. </tr>
  488. </thead>
  489. <tbody>
  490. <tr>
  491. <td><span class="xref">TKey</span></td>
  492. <td><span class="parametername">key</span></td>
  493. <td><p>the key to search for</p>
  494. </td>
  495. </tr>
  496. <tr>
  497. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;TKey, TValue&gt;</td>
  498. <td><span class="parametername">creator</span></td>
  499. <td><p>the delegate to use to create the value if it does not exist</p>
  500. </td>
  501. </tr>
  502. </tbody>
  503. </table>
  504. <h5 class="returns">Returns</h5>
  505. <table class="table table-bordered table-striped table-condensed">
  506. <thead>
  507. <tr>
  508. <th>Type</th>
  509. <th>Description</th>
  510. </tr>
  511. </thead>
  512. <tbody>
  513. <tr>
  514. <td><span class="xref">TValue</span></td>
  515. <td><p>the value that was found, or the result of <code data-dev-comment-type="paramref" class="paramref">creator</code></p>
  516. </td>
  517. </tr>
  518. </tbody>
  519. </table>
  520. <span class="small pull-right mobile-hide">
  521. <span class="divider">|</span>
  522. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_ToArray.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.ToArray%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  523. </span>
  524. <span class="small pull-right mobile-hide">
  525. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L97">View Source</a>
  526. </span>
  527. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_ToArray_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ToArray*"></a>
  528. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_ToArray" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ToArray">ToArray()</h4>
  529. <div class="markdown level1 summary"><p>Copies the key-value pairs stored by the cache to a new array, filtering all elements that are currently being
  530. created.</p>
  531. </div>
  532. <div class="markdown level1 conceptual"></div>
  533. <h5 class="decalaration">Declaration</h5>
  534. <div class="codewrapper">
  535. <pre><code class="lang-csharp hljs">public KeyValuePair&lt;TKey, TValue&gt;[] ToArray()</code></pre>
  536. </div>
  537. <h5 class="returns">Returns</h5>
  538. <table class="table table-bordered table-striped table-condensed">
  539. <thead>
  540. <tr>
  541. <th>Type</th>
  542. <th>Description</th>
  543. </tr>
  544. </thead>
  545. <tbody>
  546. <tr>
  547. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, TValue&gt;[]</td>
  548. <td><p>an array containing a snapshot of the key-value pairs contained in this cache</p>
  549. </td>
  550. </tr>
  551. </tbody>
  552. </table>
  553. <span class="small pull-right mobile-hide">
  554. <span class="divider">|</span>
  555. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_TryGetValue__0__1__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.TryGetValue(%600%2C%601%40)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  556. </span>
  557. <span class="small pull-right mobile-hide">
  558. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L106">View Source</a>
  559. </span>
  560. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_TryGetValue_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.TryGetValue*"></a>
  561. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_TryGetValue__0__1__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.TryGetValue(`0,`1@)">TryGetValue(TKey, out TValue)</h4>
  562. <div class="markdown level1 summary"><p>Attempts to get the value associated with the specified key from the cache.</p>
  563. </div>
  564. <div class="markdown level1 conceptual"></div>
  565. <h5 class="decalaration">Declaration</h5>
  566. <div class="codewrapper">
  567. <pre><code class="lang-csharp hljs">public bool TryGetValue(TKey key, out TValue value)</code></pre>
  568. </div>
  569. <h5 class="parameters">Parameters</h5>
  570. <table class="table table-bordered table-striped table-condensed">
  571. <thead>
  572. <tr>
  573. <th>Type</th>
  574. <th>Name</th>
  575. <th>Description</th>
  576. </tr>
  577. </thead>
  578. <tbody>
  579. <tr>
  580. <td><span class="xref">TKey</span></td>
  581. <td><span class="parametername">key</span></td>
  582. <td><p>the key to search for</p>
  583. </td>
  584. </tr>
  585. <tr>
  586. <td><span class="xref">TValue</span></td>
  587. <td><span class="parametername">value</span></td>
  588. <td><p>the value retrieved, if any</p>
  589. </td>
  590. </tr>
  591. </tbody>
  592. </table>
  593. <h5 class="returns">Returns</h5>
  594. <table class="table table-bordered table-striped table-condensed">
  595. <thead>
  596. <tr>
  597. <th>Type</th>
  598. <th>Description</th>
  599. </tr>
  600. </thead>
  601. <tbody>
  602. <tr>
  603. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  604. <td><p><span class="xref">true</span> if the value was found, <span class="xref">false</span> otherwise</p>
  605. </td>
  606. </tr>
  607. </tbody>
  608. </table>
  609. <h3 id="extensionmethods">Extension Methods</h3>
  610. <div>
  611. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetField__2___0_System_String___1_">ReflectionUtil.SetField&lt;T, U&gt;(T, String, U)</a>
  612. </div>
  613. <div>
  614. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_">ReflectionUtil.GetField&lt;U, T&gt;(T, String)</a>
  615. </div>
  616. <div>
  617. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetProperty__2___0_System_String___1_">ReflectionUtil.SetProperty&lt;T, U&gt;(T, String, U)</a>
  618. </div>
  619. <div>
  620. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetProperty__2___1_System_String_">ReflectionUtil.GetProperty&lt;U, T&gt;(T, String)</a>
  621. </div>
  622. <div>
  623. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object___">ReflectionUtil.InvokeMethod&lt;U, T&gt;(T, String, Object[])</a>
  624. </div>
  625. </article>
  626. </div>
  627. <div class="hidden-sm col-md-2" role="complementary">
  628. <div class="sideaffix">
  629. <div class="contribution">
  630. <ul class="nav">
  631. <li>
  632. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
  633. </li>
  634. <li>
  635. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L23" class="contribution-link">View Source</a>
  636. </li>
  637. </ul>
  638. </div>
  639. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  640. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  641. </nav>
  642. </div>
  643. </div>
  644. </div>
  645. </div>
  646. <footer>
  647. <div class="grad-bottom"></div>
  648. <div class="footer">
  649. <div class="container">
  650. <span class="pull-right">
  651. <a href="#top">Back to top</a>
  652. </span>
  653. <span>Generated by <strong>DocFX</strong></span>
  654. </div>
  655. </div>
  656. </footer>
  657. </div>
  658. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  659. <script type="text/javascript" src="../styles/docfx.js"></script>
  660. <script type="text/javascript" src="../styles/main.js"></script>
  661. </body>
  662. </html>