Lines Matching defs:ConstructorStats
44 from pybind11_tests import ConstructorStats
45 cstats = ConstructorStats.get(MyClass)
54 from the ConstructorStats instance `.values()` method.
57 need to add a function returning the ConstructorStats for the C++ class; this can be done with:
59 m.def("get_special_cstats", &ConstructorStats::get<SpecialClass>, py::return_value_policy::reference)
73 class ConstructorStats {
154 static ConstructorStats& get(std::type_index type) {
155 static std::unordered_map<std::type_index, ConstructorStats> all_cstats;
160 template <typename T> static ConstructorStats& get() {
168 static ConstructorStats& get(py::object class_) {
184 if (!t1) throw std::runtime_error("Unknown class passed to ConstructorStats::get()");
201 template <class T> void track_copy_created(T *inst) { ConstructorStats::get<T>().copy_created(inst); }
202 template <class T> void track_move_created(T *inst) { ConstructorStats::get<T>().move_created(inst); }
204 auto &cst = ConstructorStats::get<T>();
209 auto &cst = ConstructorStats::get<T>();
214 auto &cst = ConstructorStats::get<T>();
219 auto &cst = ConstructorStats::get<T>();
224 ConstructorStats::get<T>().destroyed(inst);
227 ConstructorStats::get<T>().value(std::forward<Values>(values)...);