public SortJob(NativeStringList source, NativeStringList result, Allocator alloc) { this.source = source; this.target_pattern = source[0]; // dummy value this.result = result; WithFiltering = false; TgtWords = new NativeList <WordBlock>(alloc); tmpWords = new NativeList <WordBlock>(alloc); SrcWordsList = new NativeJaggedArray <WordBlock>(alloc); paths = new NativeList <DecodedPath>(alloc); tmp_list = new NativeList <DecodedPath>(alloc); }
public SortJob(NativeStringList source, ReadOnlyStringEntity target_pattern, NativeStringList result, Allocator alloc) { this.source = source; this.target_pattern = target_pattern; this.result = result; WithFiltering = true; TgtWords = new NativeList <WordBlock>(alloc); tmpWords = new NativeList <WordBlock>(alloc); SrcWordsList = new NativeJaggedArray <WordBlock>(alloc); paths = new NativeList <DecodedPath>(alloc); tmp_list = new NativeList <DecodedPath>(alloc); }
/// <summary> /// Get the index of slice. /// </summary> /// <returns>index or -1 (not found)</returns> public static unsafe int IndexOf <T>(this NativeJaggedArray <T> jarr, T *ptr, int Length) where T : unmanaged, IEquatable <T> { if (jarr.Length < 1) { return(-1); } for (int i = 0; i < jarr.Length; i++) { var slice = jarr[i]; if (slice.Equals(ptr, Length)) { return(i); } } return(-1); }
public unsafe NativeStringList(Allocator alloc) { _jarr = new NativeJaggedArray <Char16>(alloc); }
/// <summary> /// Get the index of the slice. /// </summary> /// <param name="key">slice</param> /// <returns>index or -1 (not found)</returns> public static unsafe int IndexOf <T, Tslice>(this NativeJaggedArray <T> jarr, Tslice key) where Tslice : IJaggedArraySliceBase <T> where T : unmanaged, IEquatable <T> { return(jarr.IndexOf((T *)key.GetUnsafePtr(), key.Length)); }
/// <summary> /// Get the index of slice. /// </summary> /// <param name="key">list</param> /// <returns>index or -1 (not found)</returns> public static unsafe int IndexOf <T>(this NativeJaggedArray <T> jarr, NativeArray <T> key) where T : unmanaged, IEquatable <T> { return(jarr.IndexOf((T *)key.GetUnsafePtr(), key.Length)); }