MCPcopy
hub / github.com/pixijs/pixijs / genericPointerToWireType

Function genericPointerToWireType

transcoders/basis/basis_transcoder.js:558–590  ·  view source on GitHub ↗
(destructors, handle)

Source from the content-addressed store, hash-verified

556
557 return ptr;
558 } function genericPointerToWireType(destructors, handle)
559 {
560 let ptr;
561
562 if (handle === null)
563 {
564 if (this.isReference) { throwBindingError(`null is not a valid ${this.name}`); } if (this.isSmartPointer)
565 {
566 ptr = this.rawConstructor(); if (destructors !== null) { destructors.push(this.rawDestructor, ptr); }
567
568 return ptr;
569 }
570
571 return 0;
572 } if (!handle.$$) { throwBindingError(`Cannot pass "${_embind_repr(handle)}" as a ${this.name}`); } if (!handle.$$.ptr) { throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`); } if (!this.isConst && handle.$$.ptrType.isConst) { throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name} to parameter type ${this.name}`); } const handleClass = handle.$$.ptrType.registeredClass;
573
574 ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); if (this.isSmartPointer)
575 {
576 if (undefined === handle.$$.smartPtr) { throwBindingError('Passing raw pointer to smart pointer is illegal'); } switch (this.sharingPolicy)
577 {
578 case 0:if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; }
579 else { throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name} to parameter type ${this.name}`); } break; case 1:ptr = handle.$$.smartPtr; break; case 2:if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; }
580 else
581 {
582 const clonedHandle = handle.clone();
583
584 ptr = this.rawShare(ptr, __emval_register(function () { clonedHandle.delete(); })); if (destructors !== null) { destructors.push(this.rawDestructor, ptr); }
585 } break; default:throwBindingError('Unsupporting sharing policy');
586 }
587 }
588
589 return ptr;
590 } function nonConstNoSmartPtrRawPointerToWireType(destructors, handle)
591 {
592 if (handle === null)
593 {

Callers

nothing calls this directly

Calls 6

throwBindingErrorFunction · 0.70
_embind_reprFunction · 0.70
upcastPointerFunction · 0.70
__emval_registerFunction · 0.70
cloneMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected