Lines Matching refs:TestFactory7

94 class TestFactory7 {
99 TestFactory7(int i) : value{i} { print_created(this, i); }
100 TestFactory7(TestFactory7 &&f) { print_move_created(this); value = f.value; alias = f.alias; }
101 TestFactory7(const TestFactory7 &f) { print_copy_created(this); value = f.value; alias = f.alias; }
102 virtual ~TestFactory7() { print_destroyed(this); }
106 class PyTF7 : public TestFactory7 {
108 PyTF7(int i) : TestFactory7(i) { alias = true; print_created(this, i); }
109 PyTF7(PyTF7 &&f) : TestFactory7(std::move(f)) { print_move_created(this); }
110 PyTF7(const PyTF7 &f) : TestFactory7(f) { print_copy_created(this); }
112 int get() override { PYBIND11_OVERLOAD(int, TestFactory7, get, /*no args*/); }
228 py::class_<TestFactory7, PyTF7, std::shared_ptr<TestFactory7>>(m, "TestFactory7")
230 [](int i) { return TestFactory7(i); },
233 [](pointer_tag, int i) { return new TestFactory7(i); },
236 [](mixed_tag, int i) { return new TestFactory7(i); },
239 [](mixed_tag, std::string s) { return TestFactory7((int) s.size()); },
242 [](base_tag, pointer_tag, int i) { return new TestFactory7(i); },
243 [](base_tag, pointer_tag, int i) { return (TestFactory7 *) new PyTF7(i); }))
248 [](shared_ptr_tag, base_tag, int i) { return std::make_shared<TestFactory7>(i); },
249 [](shared_ptr_tag, base_tag, int i) { auto *p = new PyTF7(i); return std::shared_ptr<TestFactory7>(p); }))
251 [](shared_ptr_tag, invalid_base_tag, int i) { return std::make_shared<TestFactory7>(i); },
252 [](shared_ptr_tag, invalid_base_tag, int i) { return std::make_shared<TestFactory7>(i); })) // <-- invalid alias factory
254 .def("get", &TestFactory7::get)
255 .def("has_alias", &TestFactory7::has_alias)
257 .def_static("get_cstats", &ConstructorStats::get<TestFactory7>, py::return_value_policy::reference)