Struct BitField64 | Collections | 0.3.0-preview.0
docs.unity3d.com
    Show / Hide Table of Contents

    Struct BitField64

    Fixed size 64-bit array of bits.

    Namespace: Unity.Collections
    Syntax
    public struct BitField64

    Constructors

    BitField64(UInt64)

    Constructor.

    Declaration
    public BitField64(ulong initialValue = 0UL)
    Parameters
    Type Name Description
    UInt64 initialValue

    Initial value of bit field. Default is 0.

    Fields

    Value

    Declaration
    public ulong Value
    Field Value
    Type Description
    UInt64

    Methods

    Clear()

    Clear all bits to 0.

    Declaration
    public void Clear()

    CountBits()

    Calculate number of set bits.

    Declaration
    public int CountBits()
    Returns
    Type Description
    Int32

    Number of set bits.

    CountLeadingZeros()

    Calculate number of leading zeros.

    Declaration
    public int CountLeadingZeros()
    Returns
    Type Description
    Int32

    Number of leading zeros

    CountTrailingZeros()

    Calculate number of trailing zeros.

    Declaration
    public int CountTrailingZeros()
    Returns
    Type Description
    Int32

    Number of trailing zeros

    GetBits(Int32, Int32)

    Returns all bits in range as uint.

    Declaration
    public ulong GetBits(int pos, int numBits = 1)
    Parameters
    Type Name Description
    Int32 pos

    Position in bitfield (must be 0-63).

    Int32 numBits

    Number of bits to set (must be 1-64).

    Returns
    Type Description
    UInt64

    IsSet(Int32)

    Returns true is bit at position is set.

    Declaration
    public bool IsSet(int pos)
    Parameters
    Type Name Description
    Int32 pos

    Position in bitfield (must be 0-31).

    Returns
    Type Description
    Boolean

    SetBits(Int32, Boolean, Int32)

    Set bits to desired boolean value.

    Declaration
    public void SetBits(int pos, bool value, int numBits = 1)
    Parameters
    Type Name Description
    Int32 pos

    Position in bitfield (must be 0-63).

    Boolean value

    Value of bits to set.

    Int32 numBits

    Number of bits to set (must be 1-64).

    TestAll(Int32, Int32)

    Returns true if all of bits in range are set.

    Declaration
    public bool TestAll(int pos, int numBits = 1)
    Parameters
    Type Name Description
    Int32 pos

    Position in bitfield (must be 0-63).

    Int32 numBits

    Number of bits to set (must be 1-64).

    Returns
    Type Description
    Boolean

    TestAny(Int32, Int32)

    Returns true if any of bits in range are set.

    Declaration
    public bool TestAny(int pos, int numBits = 1)
    Parameters
    Type Name Description
    Int32 pos

    Position in bitfield (must be 0-63).

    Int32 numBits

    Number of bits to set (must be 1-64).

    Returns
    Type Description
    Boolean

    TestNone(Int32, Int32)

    Returns true if none of bits in range are set.

    Declaration
    public bool TestNone(int pos, int numBits = 1)
    Parameters
    Type Name Description
    Int32 pos

    Position in bitfield (must be 0-63).

    Int32 numBits

    Number of bits to set (must be 1-64).

    Returns
    Type Description
    Boolean

    Extension Methods

    JobNativeMultiHashMapVisitKeyValue.Schedule<TJob, TKey, TValue>(TJob, NativeMultiHashMap<TKey, TValue>, Int32, JobHandle)
    JobNativeMultiHashMapVisitKeyMutableValue.Schedule<TJob, TKey, TValue>(TJob, NativeMultiHashMap<TKey, TValue>, Int32, JobHandle)
    JobUnsafeMultiHashMapVisitKeyValue.Schedule<TJob, TKey, TValue>(TJob, UnsafeMultiHashMap<TKey, TValue>, Int32, JobHandle)
    JobUnsafeMultiHashMapVisitKeyMutableValue.Schedule<TJob, TKey, TValue>(TJob, UnsafeMultiHashMap<TKey, TValue>, Int32, JobHandle)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023