Click or drag to resize
SbNativeArrayTDataPointer Property
Pointer to the underlying native array.

Namespace: OIV.Inventor.Generic
Assembly: OIV.Inventor.SbLinear (in OIV.Inventor.SbLinear.dll) Version: 2024.2.2.Release.778f4cc64de03c89c1282c66aa1f73c0e9a1408b
Syntax
public IntPtr DataPointer { get; }

Property Value

Type: IntPtr
Exceptions
ExceptionCondition
ObjectDisposedExceptionStream is closed.
Remarks

The returned pointer can be used in an unsafe code block to iterate thought the elements.

The property will return a valid result even if the stream has been build with a managed array as input parameter. The following code should initialize the stream build over a managed array.

float[] floatArray = new float[100];
SbNativeArray<float> floatBuffer = new SbNativeArray<float>(floatArray, true);
unsafe
{
  float* floatPtr = (float*) floatBuffer.DataPointer;
  for (int i = 0; i < floatArray.Length; i++ )
  {
    *floatPtr++ = 10.2f;
  }
}

As read/write operation may occur in an unsafe block, no check will be performed to know if the buffer supports read/write access.

See Also