SoCpuBufferObjectCreateInstanceT Method (T, Int32) |
Factory method to create an instance of SoCpuBufferObject from
an arbitrary managed array of value type.
Namespace: OIV.Inventor.DevicesAssembly: OIV.Inventor.Base (in OIV.Inventor.Base.dll) Version: 2024.2.0.0 (2024.2.0)
Syntax [SecurityCriticalAttribute]
public static SoCpuBufferObject CreateInstance<T>(
T[] buffer,
int offsetIndex
)
where T : struct, new()
<SecurityCriticalAttribute>
Public Shared Function CreateInstance(Of T As {Structure, New}) (
buffer As T(),
offsetIndex As Integer
) As SoCpuBufferObject
public:
[SecurityCriticalAttribute]
generic<typename T>
where T : value class, gcnew()
static SoCpuBufferObject^ CreateInstance(
array<T>^ buffer,
int offsetIndex
)
[<SecurityCriticalAttribute>]
static member CreateInstance :
buffer : 'T[] *
offsetIndex : int -> SoCpuBufferObject when 'T : struct, new()
Parameters
- buffer
- Type: T
buffer that would be shared by the SoCpuBufferObject instance. - offsetIndex
- Type: SystemInt32
specify an offset index within the buffer.
Type Parameters
- T
- a value type.
Return Value
Type:
SoCpuBufferObjectExceptions Exception | Condition |
---|
ArgumentException |
Thrown when the specified buffer is or empty.
|
ArgumentException |
Thrown when the specified offsetIndex is negative
- or -
when is greater than or equals the buffer length.
|
Remarks
This method is provided to address the lack of generic constructor
in .NET framework.
The data owned by buffer is not duplicated. The
SoCpuBufferObject created instance share the same buffer.
See Also