#include <ImFusion/Core/Signal.h>
class MySubject
{
public:
};
MySubject subject;
std::cout <<
"Signal2 was emitted with int " << i <<
" and string " << s <<
".";
});
connection->disconnect();
{
public:
void onEvent() { std::cout << "MyObserver has been notified."; }
}
{
MyObserver observer;
subject.signal1.connect(&observer, [&observer]() { observer.onEvent(); });
subject.signal1.connect(&observer, &MyObserver::onEvent);
}
MyObserver observer1, observer2;
auto connection1 =
signal.connect(&observer1, &MyObserver::onEvent);
auto connection2 =
signal.connect(&observer2, &MyObserver::onEvent);
{
}
{
}
{
}
Convenient scope guard class to temporarily block signals/connections so that observers are not notif...
Definition Signal.h:359
Base class for classes that can contain slots (i.e.
Definition Signal.h:28
SignalImpl< true, ArgTypes... > ProtectedSignal
Alias for a protected signal, which is thread-safe.
Definition Signal.h:389
SignalImpl< false, ArgTypes... > Signal
Alias for a non-protected signal, which is reentrant but not thread-safe.
Definition Signal.h:384
Namespace of the ImFusion SDK.
Definition Changelog.dox:1