BitsetIterProtocol
public protocol BitsetIterProtocol
An opaque, stack-allocated struct for iterating
over the elements of a GtkBitset
.
Before a GtkBitsetIter
can be used, it needs to be initialized with
[funcGtk.BitsetIter.init_first
], [funcGtk.BitsetIter.init_last
]
or [funcGtk.BitsetIter.init_at
].
The BitsetIterProtocol
protocol exposes the methods and properties of an underlying GtkBitsetIter
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see BitsetIter
.
Alternatively, use BitsetIterRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkBitsetIter
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
_ptr
Default implementationTyped pointer to the underlying
GtkBitsetIter
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkBitsetIter
instance.Declaration
Swift
var _ptr: UnsafeMutablePointer<GtkBitsetIter>! { get }
-
Required Initialiser for types conforming to
BitsetIterProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
getValue()
Extension methodGets the current value that
iter
points to.If
iter
is not valid and [methodGtk.BitsetIter.is_valid
] returnsfalse
, this function returns 0.Declaration
Swift
@inlinable func getValue() -> Int
-
next(value:
Extension method) Moves
iter
to the next value in the set.If it was already pointing to the last value in the set,
false
is returned anditer
is invalidated.Declaration
Swift
@inlinable func next(value: UnsafeMutablePointer<guint>! = nil) -> Bool
-
previous(value:
Extension method) Moves
iter
to the previous value in the set.If it was already pointing to the first value in the set,
false
is returned anditer
is invalidated.Declaration
Swift
@inlinable func previous(value: UnsafeMutablePointer<guint>! = nil) -> Bool
-
initAt(set:
Extension methodtarget: value: ) Initializes
iter
to point totarget
.If
target
is not found, finds the next value after it. If no value >=target
exists inset
, this function returnsfalse
.Declaration
Swift
@inlinable func initAt<BitsetT>(set: BitsetT, target: Int, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetT : BitsetProtocol
-
initFirst(set:
Extension methodvalue: ) Initializes an iterator for
set
and points it to the first value inset
.If
set
is empty,false
is returned andvalue
is set toG_MAXUINT
.Declaration
Swift
@inlinable func initFirst<BitsetT>(set: BitsetT, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetT : BitsetProtocol
-
initLast(set:
Extension methodvalue: ) Initializes an iterator for
set
and points it to the last value inset
.If
set
is empty,false
is returned.Declaration
Swift
@inlinable func initLast<BitsetT>(set: BitsetT, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetT : BitsetProtocol
-
bitsetIterInitAt(set:
Extension methodtarget: value: ) Initializes
iter
to point totarget
.If
target
is not found, finds the next value after it. If no value >=target
exists inset
, this function returnsfalse
.Declaration
Swift
@inlinable func bitsetIterInitAt<BitsetT>(set: BitsetT, target: Int, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetT : BitsetProtocol
-
bitsetIterInitFirst(set:
Extension methodvalue: ) Initializes an iterator for
set
and points it to the first value inset
.If
set
is empty,false
is returned andvalue
is set toG_MAXUINT
.Declaration
Swift
@inlinable func bitsetIterInitFirst<BitsetT>(set: BitsetT, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetT : BitsetProtocol
-
bitsetIterInitLast(set:
Extension methodvalue: ) Initializes an iterator for
set
and points it to the last value inset
.If
set
is empty,false
is returned.Declaration
Swift
@inlinable func bitsetIterInitLast<BitsetT>(set: BitsetT, value: UnsafeMutablePointer<guint>! = nil) -> Bool where BitsetT : BitsetProtocol
-
isValid
Extension methodChecks if
iter
points to a valid value.Declaration
Swift
@inlinable var isValid: Bool { get }
-
value
Extension methodGets the current value that
iter
points to.If
iter
is not valid and [methodGtk.BitsetIter.is_valid
] returnsfalse
, this function returns 0.Declaration
Swift
@inlinable var value: Int { get }