boost signals allows temporarily blocking a connection via a connection member function. However, I have a single signal with many connections. The connections are stored and maintained by their respective listeners. Now the broadcaster decides that it wants to stop sending signals for a while. There does not seem to be a way to iterate all connections of a signal or disable the whole signal temporarily. This seems strange to me as surely such a mechanism must exist internally in order for the signal to reach all of its subscribers when signalled...
Am I missing something? How can I temporarily disable a signal?
block all connections connected to a boost signal
1.6k Views Asked by BuschnicK At
1
I don't know of any way to do that directly. If you are willing to permanently disconnect all slots, you can use the
disconnect_all_slots()
method. For example:If you need to temporarily block them, the best workaround I can come up with is to use a custom combiner that emulates that behaviour.