Searched refs:UserType (Results 1 - 10 of 10) sorted by relevance
/gem5/ext/pybind11/tests/ |
H A D | pybind11_tests.h | 30 class UserType { class 32 UserType() = default; 33 UserType(int i) : i(i) { } function in class:UserType 42 /// Like UserType, but increments `value` on copy for quick reference vs. copy tests 43 class IncType : public UserType { 45 using UserType::UserType;
|
H A D | pybind11_tests.cpp | 76 py::class_<UserType>(m, "UserType", "A `py::class_` type for testing") 79 .def("get_value", &UserType::value, "Get value using a method") 80 .def("set_value", &UserType::set, "Set value using a method") 81 .def_property("value", &UserType::value, &UserType::set, "Get/set value using a property") 82 .def("__repr__", [](const UserType& u) { return "UserType({})"_s.format(u.value()); }); 84 py::class_<IncType, UserType>(m, "IncType")
|
H A D | test_opaque_types.py | 3 from pybind11_tests import ConstructorStats, UserType 27 living_before = ConstructorStats.get(UserType).alive() 29 assert m.get_void_ptr_value(UserType()) # Should also work for other C++ types 30 assert ConstructorStats.get(UserType).alive() == living_before
|
H A D | test_class.py | 4 from pybind11_tests import UserType, ConstructorStats 9 assert "pybind11_type" in repr(type(UserType)) 10 assert "UserType" in repr(UserType) 27 assert doc(UserType) == "A `py::class_` type for testing" 28 assert UserType.__name__ == "UserType" 29 assert UserType.__module__ == "pybind11_tests" 30 assert UserType.get_value.__name__ == "get_value" 31 assert UserType [all...] |
H A D | test_methods_and_attributes.cpp | 94 UserType v1{1}; 95 UserType v2{1}; 96 static UserType sv1; 97 static UserType sv2; 99 const UserType &get1() const { return v1; } 100 const UserType &get2() const { return v2; } 101 UserType get_rvalue() const { return v2; } 105 UserType TestPropRVP::sv1(1); 106 UserType TestPropRVP::sv2(1); 314 auto static_get1 = [](py::object) -> const UserType [all...] |
H A D | test_stl.cpp | 125 std::vector<std::unique_ptr<UserType>> v; 126 v.emplace_back(new UserType{7}); 127 v.emplace_back(new UserType{42}); 239 m.def("return_vec_of_reference_wrapper", [](std::reference_wrapper<UserType> p4) { 240 static UserType p1{1}, p2{2}, p3{3}; 241 return std::vector<std::reference_wrapper<UserType>> {
|
H A D | test_builtin_casters.py | 5 from pybind11_tests import UserType, IncType 228 assert not m.defer_none_custom(UserType()) 241 assert m.refwrap_usertype(UserType(42)) == 42
|
H A D | test_stl.py | 4 from pybind11_tests import UserType 169 assert str(m.return_vec_of_reference_wrapper(UserType(4))) == \ 170 "[UserType(1), UserType(2), UserType(3), UserType(4)]"
|
H A D | test_builtin_casters.cpp | 112 m.def("defer_none_custom", [](UserType *) { return false; }); 127 m.def("refwrap_usertype", [](std::reference_wrapper<UserType> p) { return p.get().value(); });
|
H A D | test_class.cpp | 181 ConvertibleFromUserType(UserType u) : i(u.value()) { } 185 .def(py::init<UserType>()); 186 py::implicitly_convertible<UserType, ConvertibleFromUserType>(); 190 // `o` is `UserType` and `r` is a reference to a temporary created by implicit
|
Completed in 16 milliseconds