[#BloombergLP-bdlcc-Cache_TestUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::Cache&lowbar;TestUtil
:relfileprefix: ../../
:mrdocs:

This class implements a test utility that gives the test driver access to the lock &sol; unlock method of the RW mutex&period; Its purpose is to allow testing that the locking actually happens as planned&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;cache&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class VALUE,
    class HASH = xref:bsl/hash-06.adoc[bsl::hash&lt;KEY&gt;],
    class EQUAL = xref:bsl/equal_to-0d.adoc[bsl::equal&lowbar;to&lt;KEY&gt;]&gt;
class Cache&lowbar;TestUtil;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/Cache_TestUtil/2constructor.adoc[`Cache&lowbar;TestUtil`]         [.small]#[constructor]#
| Create a `Cache&lowbar;TestUtil` object to test locking in the specified `cache`&period;
| xref:BloombergLP/bdlcc/Cache_TestUtil/lockRead.adoc[`lockRead`] 
| Call the `lockRead` method of `bdlcc&colon;&colon;Cache` `d&lowbar;rwlock` lock&period;
| xref:BloombergLP/bdlcc/Cache_TestUtil/lockWrite.adoc[`lockWrite`] 
| Call the `lockWrite` method of `bdlcc&colon;&colon;Cache` `d&lowbar;rwlock` lock&period;
| xref:BloombergLP/bdlcc/Cache_TestUtil/unlock.adoc[`unlock`] 
| Call the `unlock` method of `bdlcc&colon;&colon;Cache` `d&lowbar;rwlock` lock&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
