X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMCAuto.hxx;h=6241b3c3f4e6f414706cde219086e4e0f5ad6283;hb=6b29741613e4edeb511ea88701218f90044bc078;hp=641c4f9096794b058cfa713eac59e9d57c52b713;hpb=5da72d398d0eb1820c3ce6dd90b8579b6b14edf5;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MCAuto.hxx b/src/MEDCoupling/MCAuto.hxx index 641c4f909..6241b3c3f 100644 --- a/src/MEDCoupling/MCAuto.hxx +++ b/src/MEDCoupling/MCAuto.hxx @@ -33,6 +33,9 @@ namespace MEDCoupling MCAuto(const MCAuto& other):_ptr(0) { referPtr(other._ptr); } MCAuto(T *ptr=0):_ptr(ptr) { } ~MCAuto() { destroyPtr(); } + bool isNull() const { return _ptr==0; } + bool isNotNull() const { return !isNull(); } + void nullify() { destroyPtr(); _ptr=0; } bool operator==(const MCAuto& other) const { return _ptr==other._ptr; } bool operator==(const T *other) const { return _ptr==other; } MCAuto &operator=(const MCAuto& other) { if(_ptr!=other._ptr) { destroyPtr(); referPtr(other._ptr); } return *this; }