File: sl08.cpp

package info (click to toggle)
btanks 0.9.8083-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 43,616 kB
  • sloc: cpp: 46,425; ansic: 12,005; xml: 4,262; python: 313; sh: 13; makefile: 13
file content (23 lines) | stat: -rw-r--r-- 386 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "sl08.h"
#include <string>
#include <stdio.h>

sl08::signal1<const bool, int> signal;

class Foo {
	sl08::slot1<const bool, int, Foo> test_slot;
public: 
	Foo() : test_slot(this, &Foo::test) {
		test_slot.connect(signal);
	}
	const bool test(int x) {
		printf("test(%d)\n", x);
		return true;
	}
};


int main(const int argc, const char *argv[]) {
	Foo foo;
	signal.emit(1);
}