-// 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
#include "MEDCoupling.hxx"
#include <set>
+#include <map>
#include <vector>
#include <string>
#include <cstddef>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
typedef enum
{
CPP_DEALLOC = 3
} DeallocType;
+ //! The various spatial discretization of a field
typedef enum
{
ON_CELLS = 0,
ON_NODES_KR = 4
} TypeOfField;
+ //! The various temporal discretization of a field
typedef enum
{
NO_TIME = 4,
public:
MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const;
+ MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getAllTheProgeny() const;
+ MEDCOUPLING_EXPORT bool isObjectInTheProgeny(const BigMemoryObject *obj) const;
MEDCOUPLING_EXPORT static std::size_t GetHeapMemorySizeOfObjs(const std::vector<const BigMemoryObject *>& objs);
MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0;
- MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildren() const = 0;
+ MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const = 0;
MEDCOUPLING_EXPORT virtual ~BigMemoryObject();
private:
static std::size_t GetHeapMemoryOfSet(std::set<const BigMemoryObject *>& s1, std::set<const BigMemoryObject *>& s2);
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<std::string> 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& value);
+ MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& value);
+ MEDCOUPLING_EXPORT std::string printSelf() const;
+ private:
+ GlobalDict() { }
+ private:
+ static GlobalDict *UNIQUE_INSTANCE;
+ private:
+ std::map<std::string, std::string> _my_map;
+ };
}
#endif