[#BloombergLP-ball-MultiplexObserver]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::MultiplexObserver
:relfileprefix: ../../
:mrdocs:

This class provides a multiplexing implementation of the `Observer` protocol&period;

== Synopsis

Declared in `&lt;ball&lowbar;multiplexobserver&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class MultiplexObserver
    : public xref:BloombergLP/ball/Observer.adoc[Observer]
----

== Description

Other concrete observers may be registered with a multiplexing observer (`registerObserver` method) and later unregistered (`deregisterObserver` method)&period; The `publish` method of this class forwards the log records that it receives to the `publish` method of each registered observer&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/ball/Observer.adoc[Observer]`
| This class provides a protocol for receiving and processing log record output&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/MultiplexObserver/2constructor.adoc[`MultiplexObserver`]         [.small]#[constructor]#
| Create a multiplexing observer having no registered observers&period;
| xref:BloombergLP/ball/MultiplexObserver/2destructor.adoc[`&#126;MultiplexObserver`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this multiplexing observer&period; Note that this method has no effect on the lifetime of observers registered with this observer, if any&period;
| xref:BloombergLP/ball/MultiplexObserver/deregisterObserver.adoc[`deregisterObserver`] 
| Remove the specified `observer` from the registry of this multiplexing observer&period;
| xref:BloombergLP/ball/MultiplexObserver/numRegisteredObservers.adoc[`numRegisteredObservers`] 
| Return the number of observers registered with this multiplexing observer&period;
| xref:BloombergLP/ball/MultiplexObserver/publish-0e.adoc[`publish`] 
| Process the specified log `record` having the specified publishing `context`&period;
| xref:BloombergLP/ball/MultiplexObserver/registerObserver.adoc[`registerObserver`] 
| Add the specified `observer` to the registry of this multiplexing observer&period;
| xref:BloombergLP/ball/MultiplexObserver/releaseRecords.adoc[`releaseRecords`]  [.small]#[virtual]#
| Discard any shared reference to a `Record` object held by this observer&period;
|===



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