public NativeList(RNA rna, IntPtr first, Entity entity) { this.rna = rna; this.first = first; rnaDelegate = RNA <T> .GetDelegate(rna, entity); }
public static NativePointer <N> Create <N>(RNA rna, string ctype, IntPtr ptr) where N : struct { Console.WriteLine($"Create NativePointer<{typeof(N)}>, ptr={ptr}, ctype={ctype}"); var entity = rna.FindEntityForCType(ctype); return(new NativePointer <N>(rna, entity, ptr)); }
/// <summary> /// Convert a native DNA type in memory to a managed C# type <typeparamref name="T"/> /// </summary> /// <typeparam name="T"></typeparam> /// <param name="ptr"></param> /// <returns></returns> public T Transcribe <T>(IntPtr ptr) { var entity = FindEntityForType(typeof(T)); if (entity == null) { throw new Exception($"Missing [DNA] attribute for type {typeof(T)}"); } // Run custom IL to generate T and return it. return(RNA <T> .Transcribe(this, entity, ptr)); }
public NativeArray(RNA rna, Entity entity, IntPtr ptr, int count) { this.rna = rna; Ptr = ptr; Count = count; if (entity != null) { rnaDelegate = RNA <T> .GetDelegate(rna, entity); ElementSize = entity.Size; } else { rnaDelegate = RNA <T> .GetCopyDelegate(); ElementSize = Marshal.SizeOf(typeof(T)); } }
public NativePointer(RNA rna, Entity entity, IntPtr ptr) { this.rna = rna; Ptr = ptr; rnaDelegate = RNA <T> .GetDelegate(rna, entity); }
public static NativeArray <N> Create <N>(RNA rna, string ctype, int count, IntPtr ptr) where N : struct { var entity = rna.FindEntityForCType(ctype); return(new NativeArray <N>(rna, entity, ptr, count)); }
public NativeListEnumerator(RNA rna, IntPtr current, RNA <T> .Delegate rnaDelegate) { this.rna = rna; this.current = current; this.rnaDelegate = rnaDelegate; }