-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 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 <atomic>
#include <vector>
#include <string>
#include <cstddef>
-namespace ParaMEDMEM
+namespace MEDCoupling
{
- typedef enum
+ enum class DeallocType
{
C_DEALLOC = 2,
- CPP_DEALLOC = 3
- } DeallocType;
+ CPP_DEALLOC = 3,
+ C_DEALLOC_WITH_OFFSET = 4
+ };
//! The various spatial discretization of a field
typedef enum
MEDCOUPLING_EXPORT int MEDCouplingVersion();
MEDCOUPLING_EXPORT void MEDCouplingVersionMajMinRel(int& maj, int& minor, int& releas);
MEDCOUPLING_EXPORT int MEDCouplingSizeOfVoidStar();
+ MEDCOUPLING_EXPORT std::size_t MEDCouplingSizeOfIDs();
MEDCOUPLING_EXPORT bool MEDCouplingByteOrder();
MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr();
-
+ MEDCOUPLING_EXPORT bool IsCXX11Compiled();
+
class BigMemoryObject
{
public:
protected:
virtual ~RefCountObjectOnly();
private:
- mutable int _cnt;
+ mutable std::atomic<int> _cnt;
};
class RefCountObject : public RefCountObjectOnly, public BigMemoryObject
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& 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<std::string, std::string> _my_map;
+ };
}
#endif