| 74 | } |
| 75 | |
| 76 | void bindRefCounted() |
| 77 | { |
| 78 | class_<RefCounted, boost::noncopyable, Detail::GILReleasePtr<RefCounted> >( "RefCounted", "A simple class to count references." ) |
| 79 | .def( "__eq__", equal ) |
| 80 | .def( "__ne__", notEqual ) |
| 81 | .def( "__hash__", hash ) |
| 82 | .def( "isSame", &is ) |
| 83 | .def( "refCount", &RefCounted::refCount ) |
| 84 | .def( "numWrappedInstances", &WrapperGarbageCollector::numWrappedInstances ).staticmethod( "numWrappedInstances" ) |
| 85 | .add_static_property( "garbageCollectionThreshold", &WrapperGarbageCollector::getCollectThreshold, &WrapperGarbageCollector::setCollectThreshold ) |
| 86 | .def( "collectGarbage", &WrapperGarbageCollector::collect ).staticmethod( "collectGarbage" ) |
| 87 | ; |
| 88 | |
| 89 | Detail::IntrusivePtrToPython<RefCounted>(); |
| 90 | Detail::IntrusivePtrFromPython<RefCounted>(); |
| 91 | |
| 92 | implicitly_convertible<RefCountedPtr, ConstRefCountedPtr>(); |
| 93 | } |
| 94 | |
| 95 | } |
| 96 |
no outgoing calls
no test coverage detected