improve compat with shared_ptr in view of future riddance of local code

This commit is contained in:
Jean-Francois Dockes 2015-05-21 17:59:31 +02:00
parent 44c4b5c82d
commit 4080b4855d

View File

@ -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;}
};