carb::input::SubscriptionOrder
Defined in carb/input/InputTypes.h
-
using carb::input::SubscriptionOrder = int32_t
Subscription order.
[0..N-1] requires to insert before the position from the beginning and shift tail on the right. [-1..-N] requires to insert after the position relative from the end and shift head on the left.
Please look at the examples below:
Assume we initially have a queue of N subscribers a b c .. y z: +—+—+—+— —+—+—+ | a | b | c | | y | z | –—events—flow—> +—+—+—+— —+—+—+ | 0 | 1 | 2 | |N-2|N-1| —positive-order—> +—+—+—+— —+—+—+ | -N| | | | -2| -1| <—negative-order— +—+—+—+— —+—+—+ first last
After inserting subscriber e with the order 1: +—+—+—+—+— —+—+—+ | a | e | b | c | | y | z | +—+—+—+—+— —+—+—+ | 0 | 1 | 2 | 3 | |N-1| N | +—+—+—+—+— —+—+—+ first last
After inserting subscriber f with the order -1: +—+—+—+—+— —+—+—+—+ | a | e | b | c | | y | z | f | +—+—+—+—+— —+—+—+—+ | 0 | 1 | 2 | 3 | |N-1| N |N+1| +—+—+—+—+— —+—+—+—+ | 0 | 1 | 2 | 3 | |M-3|M-2|M-1| +—+—+—+—+— —+—+—+—+ first last