Salome HOME
Code factorization in DataArrays
[tools/medcoupling.git] / src / MEDCoupling / MCAuto.hxx
index 641c4f9096794b058cfa713eac59e9d57c52b713..6241b3c3f4e6f414706cde219086e4e0f5ad6283 100644 (file)
@@ -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; }