[#BloombergLP-bsls-ProtocolTestImp]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::ProtocolTestImp
:relfileprefix: ../../
:mrdocs:

Base class for a test implementation of the `BSLS&lowbar;PROTOCOL` protocol&period;

== Synopsis

Declared in `&lt;bsls&lowbar;protocoltest&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class BSLS&lowbar;PROTOCOL&gt;
class ProtocolTestImp
    : public BSLS&lowbar;PROTOCOL
----

== Description

This mechanism class template is a base class for a test implementation of a protocol class defined by the `BSLS&lowbar;PROTOCOL` template parameter&period; Its purpose is to reduce the boilerplate test code required to verify that derived virtual methods are called&period; It provides `markDone` member functions one of which should be called from each method of the protocol class test implementation to indicate that the virtual method is correctly overridden&period; It also overloads `operator&hyphen;&gt;` to serve as a proxy to `BSLS&lowbar;PROTOCOL` and detect when `BSLS&lowbar;PROTOCOL` methods are called&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `BSLS&lowbar;PROTOCOL`
| 
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/ProtocolTestImp/ProtocolType.adoc[`ProtocolType`] 
| Protocol type under test by this implementation&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/ProtocolTestImp/2constructor.adoc[`ProtocolTestImp`]         [.small]#[constructor]#
| Create an object of the `ProtocolTestImp` class&period;
| xref:BloombergLP/bsls/ProtocolTestImp/2destructor.adoc[`&#126;ProtocolTestImp`] [.small]#[destructor]#
| Destroy this object and check the status of the test execution (success or failure)&period; On test failure, report it to `ProtocolTest&lowbar;Status`&period;
| xref:BloombergLP/bsls/ProtocolTestImp/markDone.adoc[`markDone`] 
| Return a proxy object convertible to any value or pointer type&period;
| xref:BloombergLP/bsls/ProtocolTestImp/markDoneRef.adoc[`markDoneRef`] 
| Return a proxy object convertible to any reference type&period;
| xref:BloombergLP/bsls/ProtocolTestImp/markDoneVal.adoc[`markDoneVal`] 
| Return the specified `value` after marking the protocol method done&period;
| xref:BloombergLP/bsls/ProtocolTestImp/markEnter.adoc[`markEnter`] 
| Mark this object as entered for the purpose of calling a protocol method&period;
| xref:BloombergLP/bsls/ProtocolTestImp/operator_ptr-04.adoc[`operator&hyphen;&gt;`] 
| Dereference this object as if it were a pointer to `BSLS&lowbar;PROTOCOL`&period;
| xref:BloombergLP/bsls/ProtocolTestImp/operator_ptr-05.adoc[`operator&hyphen;&gt;`] 
| Dereference this object as if it were a `const BSLS&lowbar;PROTOCOL &ast;`&period;
| xref:BloombergLP/bsls/ProtocolTestImp/setTestStatus.adoc[`setTestStatus`] 
| Connect this protocol test object with the specified `testStatus` object, which will be used for test failure reporting&period;
|===



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