palacaze / sigslot

A simple C++14 signal-slots implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

signal_view proposition

opened this issue · comments

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:

signal_view methods

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.

Thank you.