BitsetRef

public struct BitsetRef : BitsetProtocol

A GtkBitset represents a set of unsigned integers.

Another name for this data structure is “bitmap”.

The current implementation is based on roaring bitmaps.

A bitset allows adding a set of integers and provides support for set operations like unions, intersections and checks for equality or if a value is contained in the set. GtkBitset also contains various functions to query metadata about the bitset, such as the minimum or maximum values or its size.

The fastest way to iterate values in a bitset is [structGtk.BitsetIter].

The main use case for GtkBitset is implementing complex selections for [ifaceGtk.SelectionModel].

The BitsetRef type acts as a lightweight Swift reference to an underlying GtkBitset instance. It exposes methods that can operate on this data type through BitsetProtocol conformance. Use BitsetRef only as an unowned reference to an existing GtkBitset instance.

  • ptr
    Untyped pointer to the underlying `GtkBitset` instance.
    

    For type-safe access, use the generated, typed pointer bitset_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Bitset Record

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkBitset>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkBitset>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkBitset>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkBitset>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements BitsetProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : BitsetProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BitsetProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BitsetProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BitsetProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BitsetProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to BitsetProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a bitset with the given range set.

    Declaration

    Swift

    @inlinable
    init(range start: Int, nItems: Int)
  • Creates a new empty bitset.

    Declaration

    Swift

    @inlinable
    static func newEmpty() -> BitsetRef!
  • Creates a bitset with the given range set.

    Declaration

    Swift

    @inlinable
    static func new(range start: Int, nItems: Int) -> BitsetRef!