# SafeBitRef

> Pointer to a single bit, and a safety handle.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public readonly struct SafeBitRef
```

## Remarks

Do not store outside of stack

## Constructors

| Constructor                                                                                                                                                        | Description                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| [SafeBitRef(System.UInt64\*,System.Int32,Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle)](/engine/7000.0/script-reference/unity/entities/safebitref/ctor.md) | Build a safe pointer to a bit at address ptr + offsetInBits. |

## Properties

| Property                                                                        | Description                               |
| ------------------------------------------------------------------------------- | ----------------------------------------- |
| [IsValid](/engine/7000.0/script-reference/unity/entities/safebitref/isvalid.md) | Test if this pointer is valid (not null). |

## Static Properties

| Property                                                                  | Description         |
| ------------------------------------------------------------------------- | ------------------- |
| [Null](/engine/7000.0/script-reference/unity/entities/safebitref/null.md) | An invalid pointer. |

## Methods

| Method                                                                        | Description                                                |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [GetBit](/engine/7000.0/script-reference/unity/entities/safebitref/getbit.md) | Get the bool value of the bit pointed at.                  |
| [Offset](/engine/7000.0/script-reference/unity/entities/safebitref/offset.md) | Create a new pointer at a bit offset from this bit pointer |
| [SetBit](/engine/7000.0/script-reference/unity/entities/safebitref/setbit.md) | Set the bool value of the bit pointed at                   |
