I was in need of a way to limit user access to the signal class and I've wrapped it in a class I named signal_view.
Basically, it calls the signal's correspondent methods, but only some of them are available:
By making sigslot::signal_view public, users can call the methods above, but only by the private sigslot::signal it can emit, block, disconnect_all, etc.
class Class
{
private:
sigslot::signal<> _updated;
public:
sigslot::signal_view<> updated{&_updated};
};
The wrapper is enough for me, but I bring it here as a proposition to maybe implement inside sigslot.
Hello @palacaze
I was in need of a way to limit user access to the signal class and I've wrapped it in a class I named
signal_view
. Basically, it calls the signal's correspondent methods, but only some of them are available:By making
sigslot::signal_view
public, users can call the methods above, but only by the privatesigslot::signal
it can emit, block, disconnect_all, etc.The wrapper is enough for me, but I bring it here as a proposition to maybe implement inside sigslot.
Thank you.