From 029c366142416ed7fcd76d76a3f564261a0bc1dc Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 20 Nov 2014 09:08:23 +0100 Subject: [PATCH] Reverting to previous impl. of ICoCoField for compatibility with Cathare. --- src/ParaMEDMEM/ICoCoField.cxx | 23 ++++++++++------------- src/ParaMEDMEM/ICoCoField.hxx | 15 +++++++-------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/ParaMEDMEM/ICoCoField.cxx b/src/ParaMEDMEM/ICoCoField.cxx index 3db974ef6..38d58e7f6 100644 --- a/src/ParaMEDMEM/ICoCoField.cxx +++ b/src/ParaMEDMEM/ICoCoField.cxx @@ -27,25 +27,22 @@ using namespace ICoCo; using std::string; -Field::Field() -{ +Field::Field() { + _name=new string; } -Field::~Field() -{ +Field::~Field() { + delete _name; } -void Field::setName(const string& name) -{ - _name=name; +void Field::setName(const string& name) { + *_name=name; } -const string& Field::getName() const -{ - return _name; +const string& Field::getName() const { + return *_name; } -const char *Field::getCharName() const -{ - return _name.c_str(); +const char* Field::getCharName() const { + return _name->c_str(); } diff --git a/src/ParaMEDMEM/ICoCoField.hxx b/src/ParaMEDMEM/ICoCoField.hxx index ce8e24ade..25427b3eb 100644 --- a/src/ParaMEDMEM/ICoCoField.hxx +++ b/src/ParaMEDMEM/ICoCoField.hxx @@ -23,22 +23,21 @@ #ifndef _ICoCoField_included_ #define _ICoCoField_included_ - #include -namespace ICoCo -{ - class Field - { + +namespace ICoCo { + + class Field { public: Field(); virtual ~Field(); void setName(const std::string& name); const std::string& getName() const; - const char *getCharName() const; + const char* getCharName() const; + private: - std::string _name; + std::string* _name; }; } - #endif -- 2.39.2