# RefRW

> Stores a safe reference a pointer to T

## Definition

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

## RefRW(byte\*, AtomicSafetyHandle)

Stores a safe reference a pointer to T

```csharp
public RefRW(byte* ptr, AtomicSafetyHandle safety)
```

### Parameters

**** (\[byte\*]\(https\://learn.microsoft.com/dotnet/api/system.byte)): Pointer pointing to an instance of T**** (\[AtomicSafetyHandle]\(/engine/7000.0/script-reference/unity/collections/lowlevel/unsafe/atomicsafetyhandle)): AtomicSafetyHandle protecting access to 'ptr'

## RefRW(NativeArray\<T>, int)

Stores a safe reference to a component from an array of components at the index.

```csharp
public RefRW(NativeArray<T> componentDataNativeArray, int index)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): The array of components.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the array.
