Signals, Slots and Callbacks

Signals

vs Callbacks

Thread agnostic

aka "program level"

Flexible Executions

aka "connection types"

Generic

aka "multi-purpose"

Observer
Pattern

Reactor Pattern

Quick &
Dirty

Let's try creating a very simple implementation of signal slots inside of C++

// plan

my_signal ssig1<int, float, int>; // it's signature is (int x, float y, int z)
ssig1.connect(this, FunctionName);

// somewhere else in the code
ssig1.emit(10, 20.0, 5); // sends (10, 20.0, 5)
ssig1.emit(10, 23.5, 14); // sends (10, 23.5, 5)

Signals, Slots and Callbacks

By Swarnim Arun

Signals, Slots and Callbacks

  • 502