Protocols

The following protocols are available globally.

Queue Protocol

  • This was taken straight from the objc.io book “Advanced Swift.” It’s so damn useful, that I have it made into a standard tool.

    The original design was done by Ole Begemann and Chris Eidhof. I have modified it slightly; but not much.

    It is fast as all git-go.

    A type that can efficiently “enqueue” and “dequeue” elements. It works on one element at a time. You cannot dequeue groups of elements.

    See more

    Declaration

    Swift

    public protocol OLEB_Queue

Standardized Sequence Protocol to Let Collectors be Sequences

  • If you conform to this protocol, you get a few basic Sequence attributes for free.

    You’ll need to set up a sequence_contents Array (read/write), and set the Element type, and that’s about all.

    This also gives you a read-only subscript.

    This cannot be applied to enums, as it requires a stored property.

    See more

    Declaration

    Swift

    public protocol RVS_SequenceProtocol : Sequence