]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Useful nullify method
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 26 Jul 2016 07:43:09 +0000 (09:43 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 26 Jul 2016 07:43:09 +0000 (09:43 +0200)
src/MEDCoupling/MCAuto.hxx

index 810f4d3799fdd50fc209c729e34f09bfbcf1c7e6..6241b3c3f4e6f414706cde219086e4e0f5ad6283 100644 (file)
@@ -35,6 +35,7 @@ namespace MEDCoupling
     ~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; }