(p: Parameter)
| 903 | const_opaque_type = 'const_' + opaque_type |
| 904 | |
| 905 | def handle_wrap(p: Parameter): |
| 906 | t = Type(opaque_type) |
| 907 | if p.type.is_const(): |
| 908 | t = Type('const_' + opaque_type) |
| 909 | # p.read = 'object_cast<${ctype}>(&(${name}))' |
| 910 | if p.virtual: |
| 911 | p.add_param(t) |
| 912 | elif p.returns: |
| 913 | p.add_param(t.add_pointer()) |
| 914 | else: |
| 915 | p.add_param(t) |
| 916 | p.bad_param('${name} == nullptr', 'Null pointer') |
| 917 | if p.type.is_reference(): |
| 918 | p.virtual_read = ['object_cast<${ctype}>(&(${name}))'] |
| 919 | p.cpp_write = '${cpptype}(${name}, false)' |
| 920 | p.write = ['*${name} = object_cast<${ctype}>(&(${result}))'] |
| 921 | elif p.type.is_pointer(): |
| 922 | p.virtual_read = ['object_cast<${ctype}>(${result})'] |
| 923 | p.cpp_write = '${cpptype}(${name}, false)' |
| 924 | p.write = ['*${name} = object_cast<${ctype}>(${result})'] |
| 925 | else: |
| 926 | p.virtual_read = ['object_cast<${ctype}>(&(${name}))'] |
| 927 | p.cpp_write = '${cpptype}(${name})' |
| 928 | p.write = ['*${name} = allocate<${ctype}>(${result})'] |
| 929 | if skip_def: |
| 930 | p.read = '*${name}' |
| 931 | else: |
| 932 | p.read = '${name}->object' |
| 933 | p.cpp_read = '${name}.get_handle_ptr()' |
| 934 | |
| 935 | type_map[cpptype] = handle_wrap |
| 936 | if not ref: |
nothing calls this directly
no test coverage detected