A slot is a member function that is defined by a component and can be called directly or indirectly using a signal-slot connection. This connection allows an arbitrary class to trigger a private slot in a related class when it emits a signal. The definition of a slot can vary according to the context.
Relative cost of signal calls
Signal and slot take parameters by address. Signal libraries generally allow you to assign a new connection to an existing instance. Some libraries have several different methods to aggregate results, and a few allow you to return a value. The following are examples of signal libraries and their implementations. Listed below are some common examples of signal and slot usage.
Function pointer overhead
Often misused and misunderstood, function pointers have a bad rap. In fact, some companies have even banned their use, but the fact is that function pointers can be an extremely useful tool for developers. This post explores how function pointers work, what types of applications they have, and how to use them safely.
The first problem with function pointers is that they may cause your code to run slowly, especially on modern processors. This is because the branch predictor may not be able to determine the destination of the branch when the function pointer is used. In some cases, the overhead associated with function pointers is overstated, however, because the resulting slower code is offset by reduced non-indexed table lookups.