X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingRefCountObject.hxx;h=e0bf7950f5b8241bf1092fbcdbdb3cea90683ceb;hb=0c9d48870957c4a9f6f82fc8e2c569780a5f886b;hp=c52e0aff0bc35f702b8ca7fd752dfcd716f0f1c8;hpb=fabe2f209416d2fdfae9bc18b65f9166255df2ce;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index c52e0aff0..e0bf7950f 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -23,6 +23,9 @@ #include "MEDCoupling.hxx" +#include +#include +#include #include namespace ParaMEDMEM @@ -56,23 +59,45 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT int MEDCouplingVersion(); MEDCOUPLING_EXPORT void MEDCouplingVersionMajMinRel(int& maj, int& minor, int& releas); MEDCOUPLING_EXPORT int MEDCouplingSizeOfVoidStar(); + MEDCOUPLING_EXPORT bool MEDCouplingByteOrder(); + MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr(); - class MEDCOUPLING_EXPORT RefCountObject + class BigMemoryObject + { + public: + MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const; + MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const; + MEDCOUPLING_EXPORT static std::size_t GetHeapMemorySizeOfObjs(const std::vector& objs); + MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0; + MEDCOUPLING_EXPORT virtual std::vector getDirectChildren() const = 0; + MEDCOUPLING_EXPORT virtual ~BigMemoryObject(); + private: + static std::size_t GetHeapMemoryOfSet(std::set& s1, std::set& s2); + }; + + class RefCountObjectOnly { protected: - RefCountObject(); - RefCountObject(const RefCountObject& other); + MEDCOUPLING_EXPORT RefCountObjectOnly(); + MEDCOUPLING_EXPORT RefCountObjectOnly(const RefCountObjectOnly& other); public: - bool decrRef() const; - void incrRef() const; - virtual std::size_t getHeapMemorySize() const = 0; - int getRCValue() const; - RefCountObject& operator=(const RefCountObject& other); + MEDCOUPLING_EXPORT bool decrRef() const; + MEDCOUPLING_EXPORT void incrRef() const; + MEDCOUPLING_EXPORT int getRCValue() const; + 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