diff options
Diffstat (limited to 'sources/shiboken6/tests/smartbinding/typesystem_smart.xml')
-rw-r--r-- | sources/shiboken6/tests/smartbinding/typesystem_smart.xml | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/sources/shiboken6/tests/smartbinding/typesystem_smart.xml b/sources/shiboken6/tests/smartbinding/typesystem_smart.xml index f651161c5..261d5f15d 100644 --- a/sources/shiboken6/tests/smartbinding/typesystem_smart.xml +++ b/sources/shiboken6/tests/smartbinding/typesystem_smart.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <typesystem package="smart"> + <rejection class="*" argument-type="^std::nullptr_t&?$"/> <template name="cpplist_to_pylist_convertion"> PyObject *%out = PyList_New(int(%in.size())); @@ -16,21 +17,6 @@ %out.push_back(cppItem); } </template> - <container-type name="std::vector" type="list"> - <include file-name="list" location="global"/> - <conversion-rule> - <native-to-target> - <insert-template name="cpplist_to_pylist_convertion"/> - </native-to-target> - <target-to-native> - <add-conversion type="PySequence"> - <insert-template name="pyseq_to_cpplist_convertion"/> - </add-conversion> - </target-to-native> - </conversion-rule> - </container-type> - - <custom-type name="std::shared_ptr" /> <!-- Used in tests to check what C++ objects are allocated. --> <object-type name="Registry" /> @@ -41,7 +27,8 @@ won't work. --> <smart-pointer-type name="SharedPtr" type="shared" getter="data" ref-count-method="useCount" - instantiations="Integer,Smart::Integer2,Obj"/> + null-check-method="isNull" + instantiations="Integer,Smart::Integer2=Test::SmartInteger2Ptr,Obj"/> <object-type name="Obj" /> <value-type name="Integer" /> @@ -50,4 +37,45 @@ </namespace-type> <!-- Just used to silence the warnings that shiboken doens't know what to do with this type --> <custom-type name="RefData" /> + + <value-type name="StdOptionalTestBench"/> + + <system-include file-name="memory"/> + + <namespace-type name="std"> + <include file-name="memory" location="global"/> + <modify-function signature="^.*$" remove="all"/> + <enum-type name="pointer_safety"/> + <smart-pointer-type name="shared_ptr" type="shared" getter="get" + value-check-method="operator bool" + ref-count-method="use_count" + reset-method="reset" + instantiations="Integer,int"> + <include file-name="memory" location="global"/> + </smart-pointer-type> + + <smart-pointer-type name="unique_ptr" type="unique" getter="get" + value-check-method="operator bool" + reset-method="reset" + instantiations="Integer,Smart::Integer2,int"> + <include file-name="memory" location="global"/> + </smart-pointer-type> + + <smart-pointer-type name="optional" type="value-handle" getter="value" + value-check-method="has_value" + instantiations="Integer,int"> + <include file-name="optional" location="global"/> + </smart-pointer-type> + + </namespace-type> + <object-type name="StdSharedPtrTestBench"/> + <object-type name="StdSharedPtrVirtualMethodTester"/> + + <object-type name="StdUniquePtrTestBench"/> + <object-type name="StdUniquePtrVirtualMethodTester"/> + + <namespace-type name="Test"> + <enum-type name="DummyEnum"/> + </namespace-type> + </typesystem> |