SoCpuBufferObjectCreateInstanceT Method (T) |
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
)
where T : struct, new()
<SecurityCriticalAttribute>
Public Shared Function CreateInstance(Of T As {Structure, New}) (
buffer As T()
) As SoCpuBufferObject
public:
[SecurityCriticalAttribute]
generic<typename T>
where T : value class, gcnew()
static SoCpuBufferObject^ CreateInstance(
array<T>^ buffer
)
[<SecurityCriticalAttribute>]
static member CreateInstance :
buffer : 'T[] -> SoCpuBufferObject when 'T : struct, new()
Parameters
- buffer
- Type: T
buffer that would be shared by the SoCpuBufferObject instance.
Type Parameters
- T
- a value type.
Return Value
Type:
SoCpuBufferObjectExceptions Exception | Condition |
---|
ArgumentException |
Thrown when the specified buffer is or empty.
|
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