Midge  v3.9.2
Data Processing Framework
test_signal.cc
Go to the documentation of this file.
1 /*
2  * test_signal.cc
3  *
4  * Created on: Dec 19, 2018
5  * Adapted by: N.S. Oblath
6  * Original author: Simon Schneegans
7  * License: public domain
8  * URL: http://simmesimme.github.io/tutorials/2015/09/20/signal-slot
9  */
10 
11 #include "signal_slot.hh"
12 
13 #include <iostream>
14 
15 using namespace midge;
16 
17 int main()
18 {
19  // create new signal
21 
22  // attach a slot
23  signal.connect_function( [](std::string arg1, int arg2) {
24  std::cout << arg1 << " " << arg2 << std::endl;
25  });
26 
27  signal.emit("The answer:", 42);
28 
29  return 0;
30 }
Definition: _buffer.hh:11
unsigned connect_function(T *inst, void(T::*func)(x_args...))
Definition: signal.hh:126
int main()
Definition: test_signal.cc:17
void emit(x_args... args)
Definition: signal.hh:170