Re: [sigc] is possible make the emission of a signal private for a particular class?
- From: Vinícius dos Santos Oliveira <vini ipsmaker gmail com>
- To: "Libsigc++" <libsigc-list gnome org>
- Subject: Re: [sigc] is possible make the emission of a signal private for a particular class?
- Date: Sun, 12 Sep 2010 14:48:54 -0300
Recently I had an idea to help with this.
The connect and disconnect methods should look like:
ret method(...) const;
and the emit method should looks like:
ret method(...);
The PushButton widget should looks like:
class PushButton: public Widget
{
public:
const sigc::signal<void> &get_on_clicked() const
{
return sigc::on_clicked;
}
private: // or protected
sigc::signal<void> on_clicked;
}
Then the class members could emit the signal and non-members could connect and disconnect the signal. It's a simple and efficient way to resolve the problem. I care if there are problems with this approach.
2010/5/6 VinIPSmaker
<vini ipsmaker gmail com>
I can develop the weak_signal class, and integrate with libSigC++ Extras maybe, or I can develop it and use only for me, closed to the rest of the world.
Is anyone wanting help me?
private:
sigc::signal<void> signal;
public:
sigc::weak_signal<void> on_clicked(signal, SIGNAL_IS_CONNECTABLE);
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]