From 4080b4855d9b443849abef28eed831cd775736db Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 21 May 2015 17:59:31 +0200 Subject: [PATCH] improve compat with shared_ptr in view of future riddance of local code --- src/utils/refcntr.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/refcntr.h b/src/utils/refcntr.h index fbc6d8ac..003fcab1 100644 --- a/src/utils/refcntr.h +++ b/src/utils/refcntr.h @@ -41,16 +41,21 @@ public: rep = 0; pcount = 0; } + void reset() { + release(); + } ~RefCntr() { release(); } X *operator->() {return rep;} X *getptr() const {return rep;} + X *get() const {return rep;} const X *getconstptr() const {return rep;} int getcnt() const {return pcount ? *pcount : 0;} bool isNull() const {return rep == 0;} bool isNotNull() const {return rep != 0;} + operator bool() const {return rep != 0;} };