Live Cells C++
Reactive Programming for C++
Loading...
Searching...
No Matches
live_cells::merged_observable< T, Ts > Class Template Reference

Allows multiple cells to be observed at once. More...

#include <merged_observable.hpp>

Public Member Functions

 merged_observable (T first, Ts... rest)
 Create a merged_observable that adds observers to the cells first and rest... into.
 
void add_observer (observer::ref o) const
 
void remove_observer (observer::ref o) const
 

Detailed Description

template<Cell T, Cell... Ts>
class live_cells::merged_observable< T, Ts >

Allows multiple cells to be observed at once.

This class allows an observer to be added to multiple cells simultaneously via a single call to add_observer() and remove_observer()

Constructor & Destructor Documentation

◆ merged_observable()

template<Cell T, Cell... Ts>
live_cells::merged_observable< T, Ts >::merged_observable ( T first,
Ts... rest )
inline

Create a merged_observable that adds observers to the cells first and rest... into.

When add_observer() and remove_observer() are called, they are applied to first and every cell in rest.

Parameters
firstA cell
restRemaining cells

Member Function Documentation

◆ add_observer()

template<Cell T, Cell... Ts>
void live_cells::merged_observable< T, Ts >::add_observer ( observer::ref o) const
inline

Add an observer to every cell given in constructor.

Parameters
oThe observer to add

◆ remove_observer()

template<Cell T, Cell... Ts>
void live_cells::merged_observable< T, Ts >::remove_observer ( observer::ref o) const
inline

Remove an observer from every cell given in constructor.

Parameters
oThe observer to remove

The documentation for this class was generated from the following file: