MCPcopy Create free account
hub / github.com/AlexInLog/ReactivePlusPlus / set_upstream

Method set_upstream

src/rpp/rpp/observers/observer.hpp:49–66  ·  view source on GitHub ↗

* @brief Observable calls this method to pass disposable. Observer disposes this disposable WHEN observer wants to unsubscribe. * @note This method can be called multiple times. */

Source from the content-addressed store, hash-verified

47 * @note This method can be called multiple times.
48 */
49 void set_upstream(const disposable_wrapper& d) noexcept
50 {
51 if (is_disposed())
52 {
53 d.dispose();
54 return;
55 }
56
57 try
58 {
59 m_disposable.add(d);
60 m_strategy.set_upstream(d);
61 }
62 catch (...)
63 {
64 on_error(std::current_exception());
65 }
66 }
67
68 /**
69 * @brief Observable calls this method to check if observer interested or not in emissions

Callers

nothing calls this directly

Calls 2

disposeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected