Struct NativeStream
A deterministic data streaming supporting parallel reading and parallel writing. Allows you to write different types or arrays into a single stream.
Syntax
public struct NativeStream : IDisposable
Constructors
NativeStream(Int32, Allocator)
Declaration
public NativeStream(int foreachCount, Allocator allocator)
Parameters
Type |
Name |
Description |
System.Int32 |
foreachCount |
|
Allocator |
allocator |
|
Properties
ForEachCount
Declaration
public int ForEachCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
IsCreated
Declaration
public bool IsCreated { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
AsReader()
Declaration
public NativeStream.Reader AsReader()
Returns
AsWriter()
Declaration
public NativeStream.Writer AsWriter()
Returns
ComputeItemCount()
Declaration
public int ComputeItemCount()
Returns
Type |
Description |
System.Int32 |
|
Dispose()
Disposes of this stream and deallocates its memory immediately.
Declaration
Dispose(JobHandle)
Safely disposes of this container and deallocates its memory when the jobs that use it have completed.
Declaration
public JobHandle Dispose(JobHandle inputDeps)
Parameters
Type |
Name |
Description |
JobHandle |
inputDeps |
|
Returns
Type |
Description |
JobHandle |
A new job handle containing the prior handles as well as the handle for the job that deletes
the container.
|
Remarks
ScheduleConstruct(out NativeStream, NativeArray<Int32>, JobHandle, Allocator)
Declaration
public static JobHandle ScheduleConstruct(out NativeStream stream, NativeArray<int> lengthFromIndex0, JobHandle dependency, Allocator allocator = null)
Parameters
Type |
Name |
Description |
NativeStream |
stream |
|
NativeArray<System.Int32> |
lengthFromIndex0 |
|
JobHandle |
dependency |
|
Allocator |
allocator |
|
Returns
Type |
Description |
JobHandle |
|
ScheduleConstruct<T>(out NativeStream, NativeList<T>, JobHandle, Allocator)
Declaration
public static JobHandle ScheduleConstruct<T>(out NativeStream stream, NativeList<T> forEachCountFromList, JobHandle dependency, Allocator allocator = null)
where T : struct
Parameters
Type |
Name |
Description |
NativeStream |
stream |
|
NativeList<T> |
forEachCountFromList |
|
JobHandle |
dependency |
|
Allocator |
allocator |
|
Returns
Type |
Description |
JobHandle |
|
Type Parameters
ToNativeArray<T>(Allocator)
Declaration
public NativeArray<T> ToNativeArray<T>(Allocator allocator)
where T : struct
Parameters
Type |
Name |
Description |
Allocator |
allocator |
|
Returns
Type |
Description |
NativeArray<T> |
|
Type Parameters
Extension Methods