Salome HOME
CMake: using newly created macros SALOME_UPDATE_FLAG_AND_LOG_PACKAGE() and SALOME_PAC...
[modules/med.git] / src / MEDCoupling / MEDCouplingRefCountObject.hxx
index 3d987d706e4825f11b83c4dbd412efc3df22a628..41c340d59abaf748146c60b00add219032b93ac1 100644 (file)
@@ -61,25 +61,39 @@ namespace ParaMEDMEM
   MEDCOUPLING_EXPORT bool MEDCouplingByteOrder();
   MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr();
 
-  class RefCountObject
+  class BigMemoryObject
   {
-  protected:
-    RefCountObject();
-    RefCountObject(const RefCountObject& other);
   public:
-    MEDCOUPLING_EXPORT bool decrRef() const;
-    MEDCOUPLING_EXPORT void incrRef() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
     MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const;
     MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0;
-    MEDCOUPLING_EXPORT virtual std::vector<RefCountObject *> getDirectChildren() const = 0;
+    MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildren() const = 0;
+    MEDCOUPLING_EXPORT virtual ~BigMemoryObject();
+  };
+  
+  class RefCountObjectOnly
+  {
+  protected:
+    MEDCOUPLING_EXPORT RefCountObjectOnly();
+    MEDCOUPLING_EXPORT RefCountObjectOnly(const RefCountObjectOnly& other);
+  public:
+    MEDCOUPLING_EXPORT bool decrRef() const;
+    MEDCOUPLING_EXPORT void incrRef() const;
     MEDCOUPLING_EXPORT int getRCValue() const;
-    MEDCOUPLING_EXPORT RefCountObject& operator=(const RefCountObject& other);
+    MEDCOUPLING_EXPORT RefCountObjectOnly& operator=(const RefCountObjectOnly& other);
   protected:
-    virtual ~RefCountObject();
+    virtual ~RefCountObjectOnly();
   private:
     mutable int _cnt;
   };
+
+  class RefCountObject : public RefCountObjectOnly, public BigMemoryObject
+  {
+  protected:
+    MEDCOUPLING_EXPORT RefCountObject();
+    MEDCOUPLING_EXPORT RefCountObject(const RefCountObject& other);
+    MEDCOUPLING_EXPORT virtual ~RefCountObject();
+  };
 }
 
 #endif