From 77a738d517e53680d582ddc854b4d811598ed323 Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 26 May 2005 11:22:51 +0000 Subject: [PATCH] BugID: PAL8917: Added a support for store/restore operations on ExternalFileDef and FileType attributes. --- .../SALOMEDS_AttributeExternalFileDef_i.cxx | 12 ++++++++++++ .../SALOMEDS_AttributeExternalFileDef_i.hxx | 3 +++ src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx | 14 ++++++++++++++ src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx | 3 +++ src/SALOMEDS/SALOMEDS_StudyManager_i.cxx | 2 -- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx index 1dd93ea10..ecf0cad06 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx @@ -52,3 +52,15 @@ void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value) // Handle(SALOMEDS_ExternalFileDef)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); } + +char* SALOMEDS_AttributeExternalFileDef_i::Store() { + SALOMEDS::Locker lock; + return Value(); +} + +void SALOMEDS_AttributeExternalFileDef_i::Restore(const char* value) { + SALOMEDS::Locker lock; + SetValue(value); +} + + diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx index 12b203356..592a614bf 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx @@ -46,6 +46,9 @@ class SALOMEDS_AttributeExternalFileDef_i: public: char* Value(); void SetValue(const char* value); + + char* Store(); + void Restore(const char*); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx index c41320e90..7c69bc9ba 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx @@ -52,3 +52,17 @@ void SALOMEDS_AttributeFileType_i::SetValue(const char* value) // Handle(SALOMEDS_FileType)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str)); } + +char* SALOMEDS_AttributeFileType_i::Store() { + SALOMEDS::Locker lock; + + return Value(); +} + +void SALOMEDS_AttributeFileType_i::Restore(const char* value) { + SALOMEDS::Locker lock; + + SetValue(value); +} + + diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx index e31e23b2e..61a57db71 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx @@ -46,6 +46,9 @@ class SALOMEDS_AttributeFileType_i: public: char* Value(); void SetValue(const char* value); + + char* Store(); + void Restore(const char*); }; diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index 3c2ae551b..4a95593e3 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -597,8 +597,6 @@ static void SaveAttributes(SALOMEDS::SObject_ptr SO, HDFgroup *hdf_group_sobject SALOMEDS::ListOfAttributes_var anAttrList = SO->GetAllAttributes(); for(a = anAttrList->length() - 1; a >= 0; a--) { if (strcmp(anAttrList[a]->Type(), "AttributeIOR") == 0) continue; // never write AttributeIOR to file - if (strcmp(anAttrList[a]->Type(), "AttributeExternalFileDef") == 0) continue; // never write ExternalFileDef to file - if (strcmp(anAttrList[a]->Type(), "AttributeFileType") == 0) continue; // never write FileType to file CORBA::String_var aSaveStr(anAttrList[a]->Store()); size[0] = (hdf_int32) strlen(aSaveStr.in()) + 1; HDFdataset *hdf_dataset = new HDFdataset(anAttrList[a]->Type(),hdf_group_sobject,HDF_STRING,size,1); -- 2.39.2