Mac Developer Library

Developer

CoreFoundation Framework Reference CFMutableBitVector Reference

Options
Deployment Target:

On This Page
Language:

CFMutableBitVector Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import CoreFoundation

Objective-C

@import CoreFoundation;

CFMutableBitVector objects manage dynamic bit vectors. The basic interface for managing bit vectors is provided by CFBitVector Reference. CFMutableBitVector adds functions to modify the contents of a bit vector.

You create a mutable bit vector object using either the CFBitVectorCreateMutable or CFBitVectorCreateMutableCopy function. You add to and remove from a bit vector by altering the size of the bit vector with the CFBitVectorSetCount function

Functions

  • Creates a mutable bit vector.

    Declaration

    Swift

    func CFBitVectorCreateMutable(_ allocator: CFAllocator!, _ capacity: CFIndex) -> CFMutableBitVector!

    Objective-C

    CFMutableBitVectorRef CFBitVectorCreateMutable ( CFAllocatorRef allocator, CFIndex capacity );

    Parameters

    allocator

    The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    capacity

    The maximum number of values that can be contained by the new bit vector. The bit vector starts empty and can grow to this number of values (and it can have less).

    Pass 0 to specify that the maximum capacity is not limited. The value must not be negative.

    Return Value

    A new bit vector. Ownership follows the Create Rule.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Creates a new mutable bit vector from a pre-existing bit vector.

    Declaration

    Swift

    func CFBitVectorCreateMutableCopy(_ allocator: CFAllocator!, _ capacity: CFIndex, _ bv: CFBitVector!) -> CFMutableBitVector!

    Objective-C

    CFMutableBitVectorRef CFBitVectorCreateMutableCopy ( CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv );

    Parameters

    allocator

    The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    capacity

    The maximum number of values that can be contained by the new bit vector. The bit vector starts with the same number of values as bv and can grow to this number of values (it can have less).

    Pass 0 to specify that the maximum capacity is not limited. If non-0, capacity must be large enough to hold all bit values from bv.

    bv

    The bit vector to copy.

    Return Value

    A new bit vector holding the same bit values as bv. Ownership follows the Create Rule

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Flips a bit value in a bit vector.

    Declaration

    Swift

    func CFBitVectorFlipBitAtIndex(_ bv: CFMutableBitVector!, _ idx: CFIndex)

    Objective-C

    void CFBitVectorFlipBitAtIndex ( CFMutableBitVectorRef bv, CFIndex idx );

    Parameters

    bv

    The bit vector to modify.

    idx

    The index of the bit value to flip. The index must be in the range 0…N-1, where N is the count of the vector.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Flips a range of bit values in a bit vector.

    Declaration

    Swift

    func CFBitVectorFlipBits(_ bv: CFMutableBitVector!, _ range: CFRange)

    Objective-C

    void CFBitVectorFlipBits ( CFMutableBitVectorRef bv, CFRange range );

    Parameters

    bv

    The bit vector to modify.

    range

    The range of bit values in bv to flip. The range must not exceed 0…N-1, where N is the count of the vector.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Sets all bits in a bit vector to a particular value.

    Declaration

    Swift

    func CFBitVectorSetAllBits(_ bv: CFMutableBitVector!, _ value: CFBit)

    Objective-C

    void CFBitVectorSetAllBits ( CFMutableBitVectorRef bv, CFBit value );

    Parameters

    bv

    The bit vector to modify.

    value

    The bit value to which to set all bits in bv.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Sets the value of a particular bit in a bit vector.

    Declaration

    Swift

    func CFBitVectorSetBitAtIndex(_ bv: CFMutableBitVector!, _ idx: CFIndex, _ value: CFBit)

    Objective-C

    void CFBitVectorSetBitAtIndex ( CFMutableBitVectorRef bv, CFIndex idx, CFBit value );

    Parameters

    bv

    The bit vector to modify.

    idx

    The index of the bit value to set. The index must be in the range 0…N-1, where N is the count of the vector.

    value

    The bit value to which to set the bit at index idx.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Sets a range of bits in a bit vector to a particular value.

    Declaration

    Swift

    func CFBitVectorSetBits(_ bv: CFMutableBitVector!, _ range: CFRange, _ value: CFBit)

    Objective-C

    void CFBitVectorSetBits ( CFMutableBitVectorRef bv, CFRange range, CFBit value );

    Parameters

    bv

    The bit vector to modify.

    range

    The range of bits to set. The range must not exceed 0…N-1, where N is the count of the vector.

    value

    The bit value to which to set the range of bits.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

  • Changes the size of a mutable bit vector.

    Declaration

    Swift

    func CFBitVectorSetCount(_ bv: CFMutableBitVector!, _ count: CFIndex)

    Objective-C

    void CFBitVectorSetCount ( CFMutableBitVectorRef bv, CFIndex count );

    Parameters

    bv

    The bit vector to modify.

    count

    The new size for bv. If count is greater than the current size of bv, the additional bit values are set to 0.

    Discussion

    If bv was created with a fixed capacity, you cannot increase its size beyond that capacity.

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.

Data Types

Miscellaneous

  • A reference to a mutable bit vector object.

    Declaration

    Swift

    typealias CFMutableBitVectorRef = CFMutableBitVector

    Objective-C

    typedef struct __CFBitVector *CFMutableBitVectorRef;

    Import Statement

    Objective-C

    @import CoreFoundation;

    Swift

    import CoreFoundation

    Availability

    Available in OS X v10.0 and later.