22 #ifndef TETRAEDGE_TE_TE_INTRUSIVE_PTR_H 23 #define TETRAEDGE_TE_TE_INTRUSIVE_PTR_H 37 typedef void(*Tdestructor)(T *obj);
44 _p->incrementCounter();
47 TeIntrusivePtr(T *obj) : _deleteFn(
nullptr) {
50 _p->incrementCounter();
53 virtual ~TeIntrusivePtr() {
62 _p->incrementCounter();
71 _deleteFn = other._deleteFn;
73 _p->incrementCounter();
80 if (_p->decrementCounter()) {
91 return (
this == &other || _p == other._p);
98 const T *
get()
const {
106 const T &operator*()
const {
110 operator bool()
const {
111 return _p !=
nullptr;
118 const T *operator->()
const {
122 void setDeleteFn(Tdestructor destructor) {
123 _deleteFn = destructor;
128 Tdestructor _deleteFn;
133 #endif // TETRAEDGE_TE_TE_INTRUSIVE_PTR_H Definition: detection.h:27
Definition: te_intrusive_ptr.h:31