All pastes #633124 Raw Edit

Someone

public text v1 · immutable
#633124 ·published 2007-07-25 14:19 UTC
rendered paste body
#include <iostream>
#include <boost/signal.hpp>
#include <boost/bind.hpp>

using namespace std;

class A 
{
public:
	A() {}
	~A() {}
	void testForReady (void) { readySignal('a'); }
	boost::signal<void (char)> readySignal;
};

class B 
{
public:
	B() {this->setupSlot(); }
	~B() {}
	void onReady (char c) { cout << "The char is " << c << endl; }
	void setupSlot (void) {
		this->a.readySignal.connect (boost::bind(&B::onReady, this));
	}
	A getA (void) { return this->a; }
private:
	A a;
};

int main()
{
	B b;
	b.getA().testForReady();
	return 0;
}