X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingRefCountObject.hxx;h=7fdf91f538d0a2dad02af990070961f805d80e71;hb=ac1df6b0ba8b337555fb39610c89f678d889580d;hp=31a23be0a8f87c6fe6112c9b39882bb6e7e47f01;hpb=41ac0fa9ff58c37d28adb9331e0083a3b2677c52;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index 31a23be0a..7fdf91f53 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -24,11 +24,12 @@ #include "MEDCoupling.hxx" #include +#include #include #include #include -namespace ParaMEDMEM +namespace MEDCoupling { typedef enum { @@ -36,6 +37,7 @@ namespace ParaMEDMEM CPP_DEALLOC = 3 } DeallocType; + //! The various spatial discretization of a field typedef enum { ON_CELLS = 0, @@ -45,6 +47,7 @@ namespace ParaMEDMEM ON_NODES_KR = 4 } TypeOfField; + //! The various temporal discretization of a field typedef enum { NO_TIME = 4, @@ -67,11 +70,12 @@ namespace ParaMEDMEM public: MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const; MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const; + MEDCOUPLING_EXPORT std::vector getDirectChildren() const; MEDCOUPLING_EXPORT std::vector getAllTheProgeny() const; MEDCOUPLING_EXPORT bool isObjectInTheProgeny(const BigMemoryObject *obj) 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 std::vector getDirectChildrenWithNull() const = 0; MEDCOUPLING_EXPORT virtual ~BigMemoryObject(); private: static std::size_t GetHeapMemoryOfSet(std::set& s1, std::set& s2); @@ -100,6 +104,26 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT RefCountObject(const RefCountObject& other); MEDCOUPLING_EXPORT virtual ~RefCountObject(); }; + + class GlobalDict + { + public: + MEDCOUPLING_EXPORT static GlobalDict *GetInstance(); + MEDCOUPLING_EXPORT bool hasKey(const std::string& key) const; + MEDCOUPLING_EXPORT std::string value(const std::string& key) const; + MEDCOUPLING_EXPORT std::vector keys() const; + MEDCOUPLING_EXPORT void erase(const std::string& key); + MEDCOUPLING_EXPORT void clear(); + MEDCOUPLING_EXPORT void setKeyValue(const std::string& key, const std::string& val); + MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& val); + MEDCOUPLING_EXPORT std::string printSelf() const; + private: + GlobalDict() { } + private: + static GlobalDict *UNIQUE_INSTANCE; + private: + std::map _my_map; + }; } #endif