This class provides an instrumented implementation of the Observer protocol suitable for testing systems that use Observer. Each instance receives a unique (per process) integer identifier at construction, and keeps count of the number of records that it has published, as well as the contents of the most recently published record and context.
Synopsis
Declared in <ball_testobserver.h>
class TestObserver
: public Observer
Description
By default, the publish method prints no diagnostic information to the bsl::ostream supplied at construction. This diagnostic information can be enabled by a call to setVerbose with a non‐zero argument. A subsequent call to setVerbose with a zero argument will restore the default behavior of publish.
Base Classes
Name |
Description |
This class provides a protocol for receiving and processing log record output. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this test observer. |
Return the unique (per process) integer identifier of this test observer. |
|
Return a reference to the context most recently published by this test observer. The behavior is undefined unless |
|
Return a reference to the record most recently published by this test observer. The behavior is undefined unless |
|
Return the total number of records that this test observer has published. |
|
Return the total number of times that |
|
Store the most recently published log |
|
|
Discard any shared reference to a |
Set the internal verbose mode of this test observer to the specified (boolean) |
|
|
Declare that this type uses a |
Static Member Functions
Name |
Description |
Return the total number of instances of this class that have been created since this process has begun. |
Created with MrDocs