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.1.1.Release.7989217834dd2b99155f267b6c8c70f9feacdedd
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