Commit Graph

625 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
c9cb661fe3 Converting test_unique_ptr_member to using classh: fully working, ASAN, MSAN, UBSAN clean. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
c30cc404c9 Removing rtti_held from smart_holder. See updated comment. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
0f82a0b014 Adding smart_holder_type_caster_load::loaded_as_shared_ptr, currently bypassing smart_holder shared_ptr tracking completely, but the tests pass and are sanitizer clean. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
11690b0b91 Moving const after type name, for functions that cover a systematic scheme. NO functional changes. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
de945f854a Adopting systematic naming scheme from test_classh_wip. NO functional changes. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
235fa288b8 Pure renaming of function and variable names, for better generalization when convoluting with inheritance. NO functional changes. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
54fa191f20 Pure renaming of function names in test_classh_inheritance, similar to the systematic approach used in test_class_wip. NO functional changes. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
cbebb6da1f Tests for classh py::module_local() feature. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
c362b91a80 Minimal test covering classh_type_casters load_impl Case 2b. 2021-02-09 06:47:07 -08:00
Ralf W. Grosse-Kunstleve
82f619bdb2 Changes and tests covering classh_type_casters try_implicit_casts. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
4c7bb2612b Adding test_classh_inheritance, currently failing (passes with class_). 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
d7efc9b8b1 Adding & using PYBIND11_CLASSH_TYPE_CASTERS define. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
1ef19a1e04 Using pybind11/detail/classh_type_casters.h from test_classh_wip.cpp. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
2a7d41c193 Moving factored-out make_constructor to test_classh_wip.cpp, restoring previous version of cast.h. This is currently the most practical approach. See PR #2798 for background. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
bad7199a02 Factoring out find_existing_python_instance(). 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
2f8e01748b Adding minor comment (change to internals needed to distinguish uninitialized/disowned in error message). 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
a72e5f0c8f Inserting additional assert to ensure a returned unique_ptr is always a new Python instance. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
ec86f10038 Using factored-out make_constructor (PR #2798), removing duplicate code. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
8d18c1e121 Fixing clang-format oversight. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
f4c27c34e8 Using type_caster_base<mpty>::src_and_type directly, removing copy. Also renaming one cast to cast_const_raw_ptr, for clarity. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
45df6826e6 Cosmetical change around helper functions. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
b41a0db1b1 Calling deregister_instance after disowning via unique_ptr. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
b85cc69714 Making test_type_caster_bare_interface_demo.cpp slightly more realistic, ASAN, MSAN, UBSAN clean. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
e4d6d860b6 Fixing bugs discovered by ASAN. The code is now ASAN, MSAN, UBSAN clean. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
4ddd65de00 static handle cast implementations for rtrn_uqmp, rtrn_uqcp. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
68bee938de Adding MISSING comments in operator std::unique_ptr<mpty[ const]>. 2021-02-09 06:47:06 -08:00
Ralf W. Grosse-Kunstleve
6601ec4ea7 static handle cast implementations for rtrn_shmp, rtrn_shcp. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
6294eb26e5 Pure clang-format change (applied to original type_caster_generic::cast). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
ee6d15647d Copying type_caster_generic::cast into type_caster<mpty> as-is (preparation for handling smart pointers). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
4359422d99 static cast handle for rtrn_valu works by simply dropping in code from type_caster_base (marked with comments). rtrn_rref raises a RuntimeError, to be investigated. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
6dea65fe64 static cast handle for rtrn_cref works by simply dropping in code from type_caster_base (marked with comments). rtrn_mref and rtrn_mptr work via const_cast (to add const). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
e70a882718 static cast handle for rtrn_cptr works by simply dropping in code from type_caster_base (marked with comments). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
d88be00a7a Systematically setting mtxt for all rtrn_mpty_* functions (preparation, the values are not actually used yet). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
db529c805c flake8 cleanup 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
d3833d2cbf Fixing oversight (discovered by flake8). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
ec8ebb766a Pure clang-format --style=file -i change, with two clang-format off directives. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
e7aea026bb Pure clang-format --style=file -i change. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
cfc848a137 Retrieving smart_holder pointer in type_caster<std::unique_ptr<mpty[ const]>>::load, and using it cast_op operators. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
6277910abd Improved error messaging: Cannot disown nullptr (as_unique_ptr). 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
4a879cfdcb Retrieving smart_holder pointer in type_caster<std::shared_ptr<mpty[ const]>>::load, and using it cast_op operators. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
3f7a1a1b30 Factoring out smart_holder_type_caster_load. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
4b35955a12 Retrieving smart_holder pointer in type_caster<mpty>::load, and using it cast_op operators. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
fe5427fc23 Adding rvalue_ref, renaming const_value_ref to lvalue_ref & removing const. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
6bdd58a115 Adding isinstance<mpty> in type_caster::load functions. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
1ce4256921 Adding mpty::mtxt string member. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
03f304e419 classh.h: renaming of class_ to classh + namespace; forking test_classh_wip from test_type_caster_bare_interface_demo. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
b3ad3ac43f Adding unique_ptr<mpty>, unique_ptr<mpty const> casters. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
d36a7488ae Adding shared_ptr<mpty>, shared_ptr<mpty const> casters. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
de10541b12 Adding type_caster_bare_interface_demo. 2021-02-09 06:47:05 -08:00
Ralf W. Grosse-Kunstleve
2cb68ab051 Removing stray file. 2021-02-09 06:47:04 -08:00