Live Cells C++
Reactive Programming for C++
Loading...
Searching...
No Matches
live_cells::watcher Class Reference

Handle for a cell watch function. More...

#include <watcher.hpp>

Inheritance diagram for live_cells::watcher:
Collaboration diagram for live_cells::watcher:

Public Member Functions

template<typename F >
 watcher (F callback)
 Register the cell watch function callback.
 
 watcher (const watcher &)=delete
 
 ~watcher ()
 Remove the registered cell watch function.
 
watcheroperator= (const watcher &)=delete
 
void stop ()
 Remove the watch function.
 

Detailed Description

Handle for a cell watch function.

This class registers a cell watch function on construction and automatically removes it on destruction. The watch function can also be removed prior to destruction with the stop() method.

Constructor & Destructor Documentation

◆ watcher()

template<typename F >
live_cells::watcher::watcher ( F callback)
inline

Register the cell watch function callback.

callback is called whenever the values of the Cell's referenced with it, using the function call operator, change. It is called once immediately, before the constructor returns, to determine which cells are referenced.

Parameters
callbackA function of no arguments.

Member Function Documentation

◆ stop()

void live_cells::watcher::stop ( )
inline

Remove the watch function.

The watch function will no longer be called after calling this method.


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