Skip to content

nano-signal-slot v2.0

Compare
Choose a tag to compare
@NoAvailableAlias NoAvailableAlias released this 23 Nov 18:08
· 21 commits to master since this release

This release features a rewritten Observer class to use a Z ordered std::vector instead of a singly linked list. Moving to this data structure allows for multiple connect / single disconnect for non-unique slots. Additionally, emission performance has increased due to the better cache behaviors of std::vector. Another benefit is fewer heap allocations when reconnecting Observers to long lived Signals as std::vector watermarks memory usage.

Behavior Changes

Disconnect in v1.x disconnected ONLY the first instance of the provided slot.
Disconnect in v2.0 disconnects ALL instances of the provided slot.

Fire in v1.x emitted in the order of connection.
Fire in v2.0 emits in an unknown order.

Completely New

A new policy system based on "only pay for what you use" has been added:

  ST_Policy TS_Policy ST_Policy_Safe TS_Policy_Safe
Single threading only X - X -
Thread safe using mutex - X - X
Reentrant safe* - - X X

This system allows for clients to fine tune nano-signal-slot to their needs in regards to performance vs safety.