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.

600 lines
32 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.59.3.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">Search Results for <span></span></div>
  59. <div class="sr-items">
  60. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  61. </div>
  62. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></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. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.Async.html">IPA.Utilities.Async</a></h6>
  86. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  87. <h5 id="IPA_Utilities_Async_SingleCreationValueCache_2_syntax">Syntax</h5>
  88. <div class="codewrapper">
  89. <pre><code class="lang-csharp hljs">public class SingleCreationValueCache&lt;TKey, TValue&gt; : object</code></pre>
  90. </div>
  91. <h5 class="typeParameters">Type Parameters</h5>
  92. <table class="table table-bordered table-striped table-condensed">
  93. <thead>
  94. <tr>
  95. <th>Name</th>
  96. <th>Description</th>
  97. </tr>
  98. </thead>
  99. <tbody>
  100. <tr>
  101. <td><span class="parametername">TKey</span></td>
  102. <td><p>the key type of the cache</p>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td><span class="parametername">TValue</span></td>
  107. <td><p>the value type of the cache</p>
  108. </td>
  109. </tr>
  110. </tbody>
  111. </table>
  112. <h5 id="IPA_Utilities_Async_SingleCreationValueCache_2_remarks"><strong>Remarks</strong></h5>
  113. <div class="markdown level0 remarks"><p>This object basically wraps a <see cref="!:ConcurrentDictionary&lt;TKey, TValue>"></see> with some special handling
  114. to ensure that values are only created once ever, without having multiple parallel constructions.</p>
  115. </div>
  116. <h3 id="constructors">Constructors
  117. </h3>
  118. <span class="small pull-right mobile-hide">
  119. <span class="divider">|</span>
  120. <a href="https://github.com/nike4613/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>
  121. </span>
  122. <span class="small pull-right mobile-hide">
  123. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L38">View Source</a>
  124. </span>
  125. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  126. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor">SingleCreationValueCache()</h4>
  127. <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>
  128. class that is empty, has the default concurrency level, has the default initial
  129. capacity, and uses the default comparer for the key type.</p>
  130. </div>
  131. <div class="markdown level1 conceptual"></div>
  132. <h5 class="decalaration">Declaration</h5>
  133. <div class="codewrapper">
  134. <pre><code class="lang-csharp hljs">public SingleCreationValueCache()</code></pre>
  135. </div>
  136. <span class="small pull-right mobile-hide">
  137. <span class="divider">|</span>
  138. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor_IEnumerable_KeyValuePair__0__1___.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor(IEnumerable%7BKeyValuePair%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>
  139. </span>
  140. <span class="small pull-right mobile-hide">
  141. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L49">View Source</a>
  142. </span>
  143. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  144. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_IEnumerable_KeyValuePair__0__1___" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor(IEnumerable{KeyValuePair{`0,`1}})">SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;)</h4>
  145. <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>
  146. class that contains elements copied from the specified <see cref="!:IEnumerable&lt;T>"></see>,
  147. has the default concurrency level, has the default initial capacity, and uses
  148. the default comparer for the key type.</p>
  149. </div>
  150. <div class="markdown level1 conceptual"></div>
  151. <h5 class="decalaration">Declaration</h5>
  152. <div class="codewrapper">
  153. <pre><code class="lang-csharp hljs">public SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt; collection)</code></pre>
  154. </div>
  155. <h5 class="parameters">Parameters</h5>
  156. <table class="table table-bordered table-striped table-condensed">
  157. <thead>
  158. <tr>
  159. <th>Type</th>
  160. <th>Name</th>
  161. <th>Description</th>
  162. </tr>
  163. </thead>
  164. <tbody>
  165. <tr>
  166. <td><span class="xref">IEnumerable</span>&lt;<span class="xref">KeyValuePair</span>&lt;TKey, TValue&gt;&gt;</td>
  167. <td><span class="parametername">collection</span></td>
  168. <td><p>the <see cref="!:IEnumerable&lt;T>"></see> whose element are to be used for the new cache</p>
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. <span class="small pull-right mobile-hide">
  174. <span class="divider">|</span>
  175. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor_IEnumerable_KeyValuePair__0__1___IEqualityComparer__0__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor(IEnumerable%7BKeyValuePair%7B%600%2C%601%7D%7D%2CIEqualityComparer%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>
  176. </span>
  177. <span class="small pull-right mobile-hide">
  178. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L69">View Source</a>
  179. </span>
  180. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  181. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_IEnumerable_KeyValuePair__0__1___IEqualityComparer__0__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor(IEnumerable{KeyValuePair{`0,`1}},IEqualityComparer{`0})">SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEqualityComparer&lt;TKey&gt;)</h4>
  182. <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>
  183. class that contains elements copied from the specified <see cref="!:IEnumerable&lt;T>"></see>
  184. has the default concurrency level, has the default initial capacity, and uses
  185. the specified <see cref="!:IEqualityComparer&lt;T>"></see>.</p>
  186. </div>
  187. <div class="markdown level1 conceptual"></div>
  188. <h5 class="decalaration">Declaration</h5>
  189. <div class="codewrapper">
  190. <pre><code class="lang-csharp hljs">public SingleCreationValueCache(IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt; collection, IEqualityComparer&lt;TKey&gt; comparer)</code></pre>
  191. </div>
  192. <h5 class="parameters">Parameters</h5>
  193. <table class="table table-bordered table-striped table-condensed">
  194. <thead>
  195. <tr>
  196. <th>Type</th>
  197. <th>Name</th>
  198. <th>Description</th>
  199. </tr>
  200. </thead>
  201. <tbody>
  202. <tr>
  203. <td><span class="xref">IEnumerable</span>&lt;<span class="xref">KeyValuePair</span>&lt;TKey, TValue&gt;&gt;</td>
  204. <td><span class="parametername">collection</span></td>
  205. <td><p>the <see cref="!:IEnumerable&lt;T>"></see> whose elements are to be used for the new cache</p>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td><span class="xref">IEqualityComparer</span>&lt;TKey&gt;</td>
  210. <td><span class="parametername">comparer</span></td>
  211. <td><p>the equality comparer to use when comparing keys</p>
  212. </td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. <span class="small pull-right mobile-hide">
  217. <span class="divider">|</span>
  218. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2__ctor_IEqualityComparer__0__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.%23ctor(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>
  219. </span>
  220. <span class="small pull-right mobile-hide">
  221. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L58">View Source</a>
  222. </span>
  223. <a id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor*"></a>
  224. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2__ctor_IEqualityComparer__0__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.#ctor(IEqualityComparer{`0})">SingleCreationValueCache(IEqualityComparer&lt;TKey&gt;)</h4>
  225. <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>
  226. class that is empty, has the default concurrency level and capacity, and uses
  227. the specified <see cref="!:IEqualityComparer&lt;T>"></see>.</p>
  228. </div>
  229. <div class="markdown level1 conceptual"></div>
  230. <h5 class="decalaration">Declaration</h5>
  231. <div class="codewrapper">
  232. <pre><code class="lang-csharp hljs">public SingleCreationValueCache(IEqualityComparer&lt;TKey&gt; comparer)</code></pre>
  233. </div>
  234. <h5 class="parameters">Parameters</h5>
  235. <table class="table table-bordered table-striped table-condensed">
  236. <thead>
  237. <tr>
  238. <th>Type</th>
  239. <th>Name</th>
  240. <th>Description</th>
  241. </tr>
  242. </thead>
  243. <tbody>
  244. <tr>
  245. <td><span class="xref">IEqualityComparer</span>&lt;TKey&gt;</td>
  246. <td><span class="parametername">comparer</span></td>
  247. <td><p>the equality comparer to use when comparing keys</p>
  248. </td>
  249. </tr>
  250. </tbody>
  251. </table>
  252. <h3 id="properties">Properties
  253. </h3>
  254. <span class="small pull-right mobile-hide">
  255. <span class="divider">|</span>
  256. <a href="https://github.com/nike4613/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>
  257. </span>
  258. <span class="small pull-right mobile-hide">
  259. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L80">View Source</a>
  260. </span>
  261. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_Count_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Count*"></a>
  262. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_Count" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Count">Count</h4>
  263. <div class="markdown level1 summary"><p>Gets the number of elements that this cache contains.</p>
  264. </div>
  265. <div class="markdown level1 conceptual"></div>
  266. <h5 class="decalaration">Declaration</h5>
  267. <div class="codewrapper">
  268. <pre><code class="lang-csharp hljs">public int Count { get; }</code></pre>
  269. </div>
  270. <h5 class="propertyValue">Property Value</h5>
  271. <table class="table table-bordered table-striped table-condensed">
  272. <thead>
  273. <tr>
  274. <th>Type</th>
  275. <th>Description</th>
  276. </tr>
  277. </thead>
  278. <tbody>
  279. <tr>
  280. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int32">Int32</a></td>
  281. <td></td>
  282. </tr>
  283. </tbody>
  284. </table>
  285. <span class="small pull-right mobile-hide">
  286. <span class="divider">|</span>
  287. <a href="https://github.com/nike4613/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>
  288. </span>
  289. <span class="small pull-right mobile-hide">
  290. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L76">View Source</a>
  291. </span>
  292. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_IsEmpty_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.IsEmpty*"></a>
  293. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_IsEmpty" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.IsEmpty">IsEmpty</h4>
  294. <div class="markdown level1 summary"><p>Gets a value that indicates whether this cache is empty. </p>
  295. </div>
  296. <div class="markdown level1 conceptual"></div>
  297. <h5 class="decalaration">Declaration</h5>
  298. <div class="codewrapper">
  299. <pre><code class="lang-csharp hljs">public bool IsEmpty { get; }</code></pre>
  300. </div>
  301. <h5 class="propertyValue">Property Value</h5>
  302. <table class="table table-bordered table-striped table-condensed">
  303. <thead>
  304. <tr>
  305. <th>Type</th>
  306. <th>Description</th>
  307. </tr>
  308. </thead>
  309. <tbody>
  310. <tr>
  311. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  312. <td></td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. <h3 id="methods">Methods
  317. </h3>
  318. <span class="small pull-right mobile-hide">
  319. <span class="divider">|</span>
  320. <a href="https://github.com/nike4613/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>
  321. </span>
  322. <span class="small pull-right mobile-hide">
  323. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L85">View Source</a>
  324. </span>
  325. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_Clear_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Clear*"></a>
  326. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_Clear" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.Clear">Clear()</h4>
  327. <div class="markdown level1 summary"><p>Clears the cache.</p>
  328. </div>
  329. <div class="markdown level1 conceptual"></div>
  330. <h5 class="decalaration">Declaration</h5>
  331. <div class="codewrapper">
  332. <pre><code class="lang-csharp hljs">public void Clear()</code></pre>
  333. </div>
  334. <span class="small pull-right mobile-hide">
  335. <span class="divider">|</span>
  336. <a href="https://github.com/nike4613/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>
  337. </span>
  338. <span class="small pull-right mobile-hide">
  339. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L91">View Source</a>
  340. </span>
  341. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_ContainsKey_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ContainsKey*"></a>
  342. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_ContainsKey__0_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ContainsKey(`0)">ContainsKey(TKey)</h4>
  343. <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>
  344. </div>
  345. <div class="markdown level1 conceptual"></div>
  346. <h5 class="decalaration">Declaration</h5>
  347. <div class="codewrapper">
  348. <pre><code class="lang-csharp hljs">public bool ContainsKey(TKey key)</code></pre>
  349. </div>
  350. <h5 class="parameters">Parameters</h5>
  351. <table class="table table-bordered table-striped table-condensed">
  352. <thead>
  353. <tr>
  354. <th>Type</th>
  355. <th>Name</th>
  356. <th>Description</th>
  357. </tr>
  358. </thead>
  359. <tbody>
  360. <tr>
  361. <td><span class="xref">TKey</span></td>
  362. <td><span class="parametername">key</span></td>
  363. <td><p>the key to search for</p>
  364. </td>
  365. </tr>
  366. </tbody>
  367. </table>
  368. <h5 class="returns">Returns</h5>
  369. <table class="table table-bordered table-striped table-condensed">
  370. <thead>
  371. <tr>
  372. <th>Type</th>
  373. <th>Description</th>
  374. </tr>
  375. </thead>
  376. <tbody>
  377. <tr>
  378. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  379. <td><p><span class="xref">true</span> if the cache contains the key, <span class="xref">false</span> otherwise</p>
  380. </td>
  381. </tr>
  382. </tbody>
  383. </table>
  384. <span class="small pull-right mobile-hide">
  385. <span class="divider">|</span>
  386. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_Async_SingleCreationValueCache_2_GetOrAdd__0_Func__0__1__.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.SingleCreationValueCache%602.GetOrAdd(%600%2CFunc%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>
  387. </span>
  388. <span class="small pull-right mobile-hide">
  389. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L126">View Source</a>
  390. </span>
  391. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_GetOrAdd_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.GetOrAdd*"></a>
  392. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_GetOrAdd__0_Func__0__1__" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.GetOrAdd(`0,Func{`0,`1})">GetOrAdd(TKey, Func&lt;TKey, TValue&gt;)</h4>
  393. <div class="markdown level1 summary"><p>Gets the value associated with the specified key from the cache. If it does not exist, and
  394. no creators are currently running for this key, then the creator is called to create the value
  395. and the value is added to the cache. If there is a creator currently running for the key, then
  396. this waits for the creator to finish and retrieves the value.</p>
  397. </div>
  398. <div class="markdown level1 conceptual"></div>
  399. <h5 class="decalaration">Declaration</h5>
  400. <div class="codewrapper">
  401. <pre><code class="lang-csharp hljs">public TValue GetOrAdd(TKey key, Func&lt;TKey, TValue&gt; creator)</code></pre>
  402. </div>
  403. <h5 class="parameters">Parameters</h5>
  404. <table class="table table-bordered table-striped table-condensed">
  405. <thead>
  406. <tr>
  407. <th>Type</th>
  408. <th>Name</th>
  409. <th>Description</th>
  410. </tr>
  411. </thead>
  412. <tbody>
  413. <tr>
  414. <td><span class="xref">TKey</span></td>
  415. <td><span class="parametername">key</span></td>
  416. <td><p>the key to search for</p>
  417. </td>
  418. </tr>
  419. <tr>
  420. <td><span class="xref">Func</span>&lt;TKey, TValue&gt;</td>
  421. <td><span class="parametername">creator</span></td>
  422. <td><p>the delegate to use to create the value if it does not exist</p>
  423. </td>
  424. </tr>
  425. </tbody>
  426. </table>
  427. <h5 class="returns">Returns</h5>
  428. <table class="table table-bordered table-striped table-condensed">
  429. <thead>
  430. <tr>
  431. <th>Type</th>
  432. <th>Description</th>
  433. </tr>
  434. </thead>
  435. <tbody>
  436. <tr>
  437. <td><span class="xref">TValue</span></td>
  438. <td><p>the value that was found, or the result of <code data-dev-comment-type="paramref" class="paramref">creator</code></p>
  439. </td>
  440. </tr>
  441. </tbody>
  442. </table>
  443. <span class="small pull-right mobile-hide">
  444. <span class="divider">|</span>
  445. <a href="https://github.com/nike4613/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>
  446. </span>
  447. <span class="small pull-right mobile-hide">
  448. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L97">View Source</a>
  449. </span>
  450. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_ToArray_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ToArray*"></a>
  451. <h4 id="IPA_Utilities_Async_SingleCreationValueCache_2_ToArray" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.ToArray">ToArray()</h4>
  452. <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
  453. created.</p>
  454. </div>
  455. <div class="markdown level1 conceptual"></div>
  456. <h5 class="decalaration">Declaration</h5>
  457. <div class="codewrapper">
  458. <pre><code class="lang-csharp hljs">public KeyValuePair&lt;TKey, TValue&gt;[] ToArray()</code></pre>
  459. </div>
  460. <h5 class="returns">Returns</h5>
  461. <table class="table table-bordered table-striped table-condensed">
  462. <thead>
  463. <tr>
  464. <th>Type</th>
  465. <th>Description</th>
  466. </tr>
  467. </thead>
  468. <tbody>
  469. <tr>
  470. <td><span class="xref">KeyValuePair</span>&lt;TKey, TValue&gt;[]</td>
  471. <td><p>an array containing a snapshot of the key-value pairs contained in this cache</p>
  472. </td>
  473. </tr>
  474. </tbody>
  475. </table>
  476. <span class="small pull-right mobile-hide">
  477. <span class="divider">|</span>
  478. <a href="https://github.com/nike4613/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>
  479. </span>
  480. <span class="small pull-right mobile-hide">
  481. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L106">View Source</a>
  482. </span>
  483. <a id="IPA_Utilities_Async_SingleCreationValueCache_2_TryGetValue_" data-uid="IPA.Utilities.Async.SingleCreationValueCache`2.TryGetValue*"></a>
  484. <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>
  485. <div class="markdown level1 summary"><p>Attempts to get the value associated with the specified key from the cache.</p>
  486. </div>
  487. <div class="markdown level1 conceptual"></div>
  488. <h5 class="decalaration">Declaration</h5>
  489. <div class="codewrapper">
  490. <pre><code class="lang-csharp hljs">public bool TryGetValue(TKey key, out TValue value)</code></pre>
  491. </div>
  492. <h5 class="parameters">Parameters</h5>
  493. <table class="table table-bordered table-striped table-condensed">
  494. <thead>
  495. <tr>
  496. <th>Type</th>
  497. <th>Name</th>
  498. <th>Description</th>
  499. </tr>
  500. </thead>
  501. <tbody>
  502. <tr>
  503. <td><span class="xref">TKey</span></td>
  504. <td><span class="parametername">key</span></td>
  505. <td><p>the key to search for</p>
  506. </td>
  507. </tr>
  508. <tr>
  509. <td><span class="xref">TValue</span></td>
  510. <td><span class="parametername">value</span></td>
  511. <td><p>the value retrieved, if any</p>
  512. </td>
  513. </tr>
  514. </tbody>
  515. </table>
  516. <h5 class="returns">Returns</h5>
  517. <table class="table table-bordered table-striped table-condensed">
  518. <thead>
  519. <tr>
  520. <th>Type</th>
  521. <th>Description</th>
  522. </tr>
  523. </thead>
  524. <tbody>
  525. <tr>
  526. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  527. <td><p><span class="xref">true</span> if the value was found, <span class="xref">false</span> otherwise</p>
  528. </td>
  529. </tr>
  530. </tbody>
  531. </table>
  532. <h3 id="extensionmethods">Extension Methods</h3>
  533. <div>
  534. <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>
  535. </div>
  536. <div>
  537. <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>
  538. </div>
  539. <div>
  540. <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>
  541. </div>
  542. <div>
  543. <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>
  544. </div>
  545. <div>
  546. <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>
  547. </div>
  548. </article>
  549. </div>
  550. <div class="hidden-sm col-md-2" role="complementary">
  551. <div class="sideaffix">
  552. <div class="contribution">
  553. <ul class="nav">
  554. <li>
  555. <a href="https://github.com/nike4613/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>
  556. </li>
  557. <li>
  558. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/c326c0dc0fbb51050db23b7b892a9528f5ef3ef0/IPA.Loader/Utilities/Async/SingleCreationValueCache.cs/#L23" class="contribution-link">View Source</a>
  559. </li>
  560. </ul>
  561. </div>
  562. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  563. <h5>In This Article</h5>
  564. <div></div>
  565. </nav>
  566. </div>
  567. </div>
  568. </div>
  569. </div>
  570. <footer>
  571. <div class="grad-bottom"></div>
  572. <div class="footer">
  573. <div class="container">
  574. <span class="pull-right">
  575. <a href="#top">Back to top</a>
  576. </span>
  577. <span>Generated by <strong>DocFX</strong></span>
  578. </div>
  579. </div>
  580. </footer>
  581. </div>
  582. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  583. <script type="text/javascript" src="../styles/docfx.js"></script>
  584. <script type="text/javascript" src="../styles/main.js"></script>
  585. </body>
  586. </html>