Register the specified observer under observerName.

Synopsis

Declared in <ball_broadcastobserver.h>

int
registerObserver(
    bsl::shared_ptr<Observer> const& observer,
    std::string_view const& observerName);

Description

Add the specified observer with the specified observerName to the registry of this broadcast observer. Return 0 if observer was successfully registered, and a non‐zero value (with no effect) otherwise. Henceforth, this observer will forward each record it receives through its publish method, including the record's context, to the publish method of observer, until observer is deregistered. The behavior is undefined if a cyclic reference is created among registered observers. Note that this method will fail if an observer having observerName is already registered.

Return Value

0 on success, or a non‐zero value otherwise

Parameters

Name

Description

observer

observer to register

observerName

name under which to register the observer

Created with MrDocs