It is clear how to subscribe to multicast messages. But is it possible to unsubscribe ? I have a scenario when nodes are coming and going to/from the bus and subscriptions are done during runtime. Of course I can reuse the subscriptions if the same node comes back, but it is not as cool .
Is it somehow possible with the generalsubscriber class?
I think the same question relates to registered services as well…
Do you have a suggestion on how to store the classes in a proper way without using pointers?
As the name suggests, noncopyable objects can’t be copied. The implication is that you can’t use them with containers that implicitly relocate their storage, such as std::vector<>.
You can either find some container that does not move its items around (some form of non-contiguous containers such as linked lists or queues should work; however, I don’t think such containers exist in the STL), or you can add an extra level of indirection to create movable references to immovable (noncopyable) objects, such as std::shared_ptr<> (or some other kind of pointers).
If you’re keen to stick with vectors, use std::vector<std::shared_ptr<MyClass>>.