You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
488 B
31 lines
488 B
11 years ago
|
// Taken from https://developer.gnome.org/libsigc++-tutorial/stable/ch02.html
|
||
|
|
||
|
|
||
|
#include <sigc++/sigc++.h>
|
||
|
#include <iostream>
|
||
|
|
||
|
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;
|
||
|
}
|