blob: ccf415e4813433b648fc0a96c7b9a2d4cc1fdf3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Taken from https://developer.gnome.org/libsigc++-tutorial/stable/ch02.html
#include <iostream>
#include <sigc++/sigc++.h>
class AlienDetector
{
public:
AlienDetector() {}
void run() {}
sigc::signal<void> signal_detected;
};
void warn_people()
{
std::cout << "There are aliens in the carpark!" << std::endl;
}
int main()
{
AlienDetector mydetector;
mydetector.signal_detected.connect( sigc::ptr_fun(warn_people) );
mydetector.run();
return 0;
}
|