This function mimics the 'SAFEARRAY(aType)' IDL idiom. It returns a subtype of SAFEARRAY, instances will be built with a typecode VT_... corresponding to the aType, which must be one of the supported ctypes.
(itemtype: "type[_CT]")
| 59 | ################################################################ |
| 60 | # This is THE PUBLIC function: the gateway to the SAFEARRAY functionality. |
| 61 | def _midlSAFEARRAY(itemtype: "type[_CT]") -> "type[hints.LP_SAFEARRAY[_CT]]": |
| 62 | """This function mimics the 'SAFEARRAY(aType)' IDL idiom. It |
| 63 | returns a subtype of SAFEARRAY, instances will be built with a |
| 64 | typecode VT_... corresponding to the aType, which must be one of |
| 65 | the supported ctypes. |
| 66 | """ |
| 67 | try: |
| 68 | return POINTER(_safearray_type_cache[itemtype]) # type: ignore |
| 69 | except KeyError: |
| 70 | sa_type = _make_safearray_type(itemtype) |
| 71 | _safearray_type_cache[itemtype] = sa_type |
| 72 | return POINTER(sa_type) # type: ignore |
| 73 | |
| 74 | |
| 75 | def _make_safearray_type(itemtype): |
searching dependent graphs…