]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Modified attributes to comply with modifications in the method's names in SALOMEDSImpl
authorsrn <srn@opencascade.com>
Mon, 4 Apr 2005 07:03:27 +0000 (07:03 +0000)
committersrn <srn@opencascade.com>
Mon, 4 Apr 2005 07:03:27 +0000 (07:03 +0000)
27 files changed:
src/SALOMEDS/Makefile.in
src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx
src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx
src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx
src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx
src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx
src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx
src/SALOMEDS/SALOMEDS_AttributeName_i.cxx
src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx
src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx
src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx
src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx
src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx
src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx
src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx
src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx
src/SALOMEDS/SALOMEDS_SObject_i.cxx
src/SALOMEDS/SALOMEDS_SObject_i.hxx
src/SALOMEDS/SALOMEDS_StudyManager_i.cxx
src/SALOMEDS/SALOMEDS_StudyManager_i.hxx
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMEDS/SALOMEDS_Study_i.hxx

index e066eec2a06546914876c1737b3f2d93dc2c4eb8..9381217cece3ec06906a8067ae61543c4e6c1f4c 100644 (file)
@@ -13,7 +13,12 @@ VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_srcdir)/idl
 
 EXPORT_HEADERS= \
        SALOMEDS_StudyManager_i.hxx \
-       SALOMEDS_Driver_i.hxx
+       SALOMEDS_Driver_i.hxx \
+       SALOMEDS_StudyManager.hxx \
+       SALOMEDS_Study.hxx \
+       SALOMEDS_SObject.hxx \
+       SALOMEDS_SComponent.hxx \
+       SALOMEDS_GenericAttribute.hxx
 
 # Libraries targets
 
@@ -58,7 +63,46 @@ LIB_SRC =    \
                  SALOMEDS_AttributeTableOfReal_i.cxx \
                  SALOMEDS_AttributeTableOfString_i.cxx \
                  SALOMEDS_AttributeStudyProperties_i.cxx \
-                 SALOMEDS_AttributePythonObject_i.cxx
+                 SALOMEDS_AttributePythonObject_i.cxx \
+                 SALOMEDS_SObject.cxx \
+                 SALOMEDS_SComponent.cxx \
+                 SALOMEDS_GenericAttribute.cxx \
+                 SALOMEDS_ChildIterator.cxx \
+                 SALOMEDS_SComponentIterator.cxx \
+                 SALOMEDS_UseCaseIterator.cxx \
+                 SALOMEDS_UseCaseBuilder.cxx \
+                 SALOMEDS_StudyBuilder.cxx \
+                 SALOMEDS_Study.cxx \
+                 SALOMEDS_StudyManager.cxx \
+                 SALOMEDS_AttributeStudyProperties.cxx \
+                 SALOMEDS_AttributeComment.cxx \
+                 SALOMEDS_AttributeDrawable.cxx \
+                 SALOMEDS_AttributeExpandable.cxx \
+                 SALOMEDS_AttributeExternalFileDef.cxx \
+                 SALOMEDS_AttributeFileType.cxx \
+                 SALOMEDS_AttributeFlags.cxx \
+                 SALOMEDS_AttributeGraphic.cxx \
+                 SALOMEDS_AttributeIOR.cxx \
+                 SALOMEDS_AttributeInteger.cxx \
+                 SALOMEDS_AttributeLocalID.cxx \
+                 SALOMEDS_AttributeName.cxx \
+                 SALOMEDS_AttributeOpened.cxx \
+                 SALOMEDS_AttributePythonObject.cxx \
+                 SALOMEDS_AttributeReal.cxx \
+                 SALOMEDS_AttributeSelectable.cxx \
+                 SALOMEDS_AttributeSequenceOfInteger.cxx \
+                 SALOMEDS_AttributePersistentRef.cxx \
+                 SALOMEDS_AttributePixMap.cxx \
+                 SALOMEDS_AttributeSequenceOfReal.cxx \
+                 SALOMEDS_AttributeTableOfInteger.cxx \
+                 SALOMEDS_AttributeTableOfReal.cxx \
+                 SALOMEDS_AttributeTableOfString.cxx \
+                 SALOMEDS_AttributeTarget.cxx \
+                 SALOMEDS_AttributeTextColor.cxx \
+                 SALOMEDS_AttributeTextHighlightColor.cxx \
+                 SALOMEDS_AttributeTreeNode.cxx \
+                 SALOMEDS_AttributeUserID.cxx
+                 
 
 # Executables targets
 BIN = SALOMEDS_Server SALOMEDS_Client
index e1565166a0d78a0661764c6bcc713cbc1ab816da..737ee2bf2b2c0a07a916fa381e2c0fe33ae36736 100644 (file)
@@ -14,7 +14,7 @@ char* SALOMEDS_AttributeComment_i::Value()
   SALOMEDS::Locker lock;
   
   CORBA::String_var c_s =
-    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeComment)::DownCast(_impl)->Get()).ToCString());
+    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeComment)::DownCast(_impl)->Value()).ToCString());
   return c_s._retn();
 }
 
@@ -24,5 +24,5 @@ void SALOMEDS_AttributeComment_i::SetValue(const char* value)
 
   CheckLocked();
   TCollection_AsciiString aStr((char*)value);
-  Handle(SALOMEDSImpl_AttributeComment)::DownCast(_impl)->Set(TCollection_ExtendedString(aStr));
+  Handle(SALOMEDSImpl_AttributeComment)::DownCast(_impl)->SetValue(TCollection_ExtendedString(aStr));
 }
index f39a1d19390fe77f032a83bac6171affbafbe348..675361f98cf9e9d9528830dea047788ac3150d71 100644 (file)
@@ -10,13 +10,13 @@ using namespace std;
 CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable() 
 {
   SALOMEDS::Locker lock;
-  return (Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_impl)->Get() == 1);
+  return (Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_impl)->IsDrawable() == 1);
 }
                                                            
 void SALOMEDS_AttributeDrawable_i::SetDrawable(CORBA::Boolean value) 
 {
   SALOMEDS::Locker lock;
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_impl)->Set(value);
+  Handle(SALOMEDSImpl_AttributeDrawable)::DownCast(_impl)->SetDrawable(value);
 }
 
index 11fe92a7e1eb944784c9fb709d30e16e25838722..192a9ba8d10b1a710bc7ca352934ade68f6d3d01 100644 (file)
@@ -9,13 +9,13 @@ using namespace std;
 CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable() 
 {
   SALOMEDS::Locker lock;
-  return (Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_impl)->Get() == 1);
+  return (Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_impl)->IsExpandable() == 1);
 }
                                                            
 void SALOMEDS_AttributeExpandable_i::SetExpandable(CORBA::Boolean value) 
 {
   SALOMEDS::Locker lock;
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_impl)->Set(value);
+  Handle(SALOMEDSImpl_AttributeExpandable)::DownCast(_impl)->SetExpandable(value);
 }
 
index cb9fd59380bf3c22f3381636f4728e75c61d860a..9795c3342d8b4d1656c04c77ca2303b8f4cdfd73 100644 (file)
@@ -11,7 +11,7 @@ char* SALOMEDS_AttributeExternalFileDef_i::Value()
 {  
   SALOMEDS::Locker lock; 
   CORBA::String_var c_s = 
-    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_impl)->Get()).ToCString());
+    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_impl)->Value()).ToCString());
   return c_s._retn();
 }
 
@@ -20,5 +20,5 @@ void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value)
   SALOMEDS::Locker lock; 
   CheckLocked();
   CORBA::String_var Str = CORBA::string_dup(value);
-  Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_impl)->Set(TCollection_ExtendedString(Str));
+  Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(_impl)->SetValue(TCollection_ExtendedString(Str));
 }
index 525e51f040b32c784cbbd43049fcab038a62da98..84bdab1e9d86180261e5764785fda85522f05c63 100644 (file)
@@ -11,7 +11,7 @@ char* SALOMEDS_AttributeFileType_i::Value()
 {
   SALOMEDS::Locker lock;
   CORBA::String_var c_s = 
-    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_impl)->Get()).ToCString());
+    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_impl)->Value()).ToCString());
   return c_s._retn();
 }
 
@@ -20,5 +20,5 @@ void SALOMEDS_AttributeFileType_i::SetValue(const char* value)
   SALOMEDS::Locker lock;
   CheckLocked();
   CORBA::String_var Str = CORBA::string_dup(value);
-  Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_impl)->Set(TCollection_ExtendedString(Str));
+  Handle(SALOMEDSImpl_AttributeFileType)::DownCast(_impl)->SetValue(TCollection_ExtendedString(Str));
 }
index 2a08dddfd83d6d8f64f3a27bc06331a726a2574c..601956099a2c8d5f45ed01e6cf517a7dba29fbe0 100644 (file)
@@ -9,14 +9,14 @@ using namespace std;
 CORBA::Long SALOMEDS_AttributeInteger_i::Value() 
 {
   SALOMEDS::Locker lock; 
-  return Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_impl)->Get();
+  return Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_impl)->Value();
 }
 
 void SALOMEDS_AttributeInteger_i::SetValue(CORBA::Long value) 
 {
   SALOMEDS::Locker lock; 
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_impl)->Set(value);
+  Handle(SALOMEDSImpl_AttributeInteger)::DownCast(_impl)->SetValue(value);
 }
 
 
index 14a4d423ec65049c5d747479eab32c3a2603d79d..5bb4cf13f3a68aeb356e5428cfae0c47c3b27623 100644 (file)
@@ -11,7 +11,7 @@ char* SALOMEDS_AttributeName_i::Value()
 {
   SALOMEDS::Locker lock; 
   CORBA::String_var c_s = 
-    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeName)::DownCast(_impl)->Get()).ToCString());
+    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributeName)::DownCast(_impl)->Value()).ToCString());
   return c_s._retn();
 }
 
@@ -19,5 +19,5 @@ void SALOMEDS_AttributeName_i::SetValue(const char* value)
 {
   SALOMEDS::Locker lock; 
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeName)::DownCast(_impl)->Set(TCollection_ExtendedString((char*)value));
+  Handle(SALOMEDSImpl_AttributeName)::DownCast(_impl)->SetValue(TCollection_ExtendedString((char*)value));
 }
index 5c1fb65227df469d6885e07bc0ee9210fc52e8e3..a1e77dc16838fd05d7109695c6094ccc85daeed0 100644 (file)
@@ -9,7 +9,7 @@ using namespace std;
 CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened() 
 {
   SALOMEDS::Locker lock; 
-  return (Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_impl)->Get() == 1);
+  return (Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_impl)->IsOpened() == 1);
 }
                                                            
 void SALOMEDS_AttributeOpened_i::SetOpened(CORBA::Boolean value) 
@@ -18,5 +18,5 @@ void SALOMEDS_AttributeOpened_i::SetOpened(CORBA::Boolean value)
   
   Standard_Integer val = 0;
   if (value != 0) val = 1;
-  Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_impl)->Set(val);
+  Handle(SALOMEDSImpl_AttributeOpened)::DownCast(_impl)->SetOpened(val);
 }
index 02fca55170511d6677cdcfa244011658e422f62e..cabd447acd428f2a1be00807f6c5df2e72a305cc 100644 (file)
@@ -11,7 +11,7 @@ char* SALOMEDS_AttributePersistentRef_i::Value()
 {
   SALOMEDS::Locker lock;
   CORBA::String_var c_s = 
-    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_impl)->Get()).ToCString());
+    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_impl)->Value()).ToCString());
   return c_s._retn();
 }
 
@@ -20,5 +20,5 @@ void SALOMEDS_AttributePersistentRef_i::SetValue(const char* value)
   SALOMEDS::Locker lock;
   CheckLocked();
   CORBA::String_var Str = CORBA::string_dup(value);
-  Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_impl)->Set(TCollection_ExtendedString(Str));
+  Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast(_impl)->SetValue(TCollection_ExtendedString(Str));
 }
index 56532dba39f37b4149b7cb005a2285bdd6b9c46b..df6f837fdd869d36d222ff0075f7a15a11b109e5 100644 (file)
@@ -9,16 +9,14 @@ using namespace std;
 
 CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap() 
 {
-  TCollection_ExtendedString S = Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->Get();
-  if (strcmp(TCollection_AsciiString(S).ToCString(), "None") == 0) return Standard_False;
-  return Standard_True;
+  return Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->HasPixMap();
 }
 
 char* SALOMEDS_AttributePixMap_i::GetPixMap() 
 {
   SALOMEDS::Locker lock;
   CORBA::String_var S = 
-    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->Get()).ToCString());
+    CORBA::string_dup(TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->GetPixMap()).ToCString());
   return S._retn();
 }
 
@@ -27,6 +25,6 @@ void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value)
   SALOMEDS::Locker lock;
   CheckLocked();
   CORBA::String_var Str = CORBA::string_dup(value);
-  Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->Set(TCollection_ExtendedString(Str));
+  Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_impl)->SetPixMap(TCollection_ExtendedString(Str));
 }
 
index 7278f0af3ad50b5750df3df8c6b77d414954d84d..aaeae7ee19c98c844aff49e9b40e3904a043fe98 100644 (file)
@@ -12,13 +12,13 @@ using namespace std;
 CORBA::Double SALOMEDS_AttributeReal_i::Value() 
 {
   SALOMEDS::Locker lock;
-  return Handle(SALOMEDSImpl_AttributeReal)::DownCast(_impl)->Get();
+  return Handle(SALOMEDSImpl_AttributeReal)::DownCast(_impl)->Value();
 }
 
 void SALOMEDS_AttributeReal_i::SetValue(CORBA::Double value) 
 {
   SALOMEDS::Locker lock;
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeReal)::DownCast(_impl)->Set(value);
+  Handle(SALOMEDSImpl_AttributeReal)::DownCast(_impl)->SetValue(value);
 }
 
index 53b53becca7a638184821a0e01a978f57eed0f02..eb89f24dc3b0a58d9da8f3ce82a9f7188a09e070 100644 (file)
@@ -9,7 +9,7 @@ using namespace std;
 CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable() 
 {
   SALOMEDS::Locker lock;
-  return (Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_impl)->Get() == 1);
+  return (Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_impl)->IsSelectable() == 1);
 }
                                                            
 void SALOMEDS_AttributeSelectable_i::SetSelectable(CORBA::Boolean value) 
@@ -17,6 +17,6 @@ void SALOMEDS_AttributeSelectable_i::SetSelectable(CORBA::Boolean value)
   SALOMEDS::Locker lock;
   Standard_Integer val = 0;
   if (value != 0) val = 1;
-  Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_impl)->Set(val);
+  Handle(SALOMEDSImpl_AttributeSelectable)::DownCast(_impl)->SetSelectable(val);
 }
 
index a740a184be1bec190e8aa9fcfbafd0ffd4e4d6ec..d8adf45ba8db7cbfd843400b3aa03d70981e3f13 100644 (file)
@@ -15,31 +15,9 @@ using namespace std;
 #include <strstream>
 #include <string>
 
-#define SEPARATOR '\1'
-
 UNEXPECT_CATCH(ATI_IncorrectIndex, SALOMEDS::AttributeTableOfInteger::IncorrectIndex);
 UNEXPECT_CATCH(ATI_IncorrectArgumentLength, SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength);
 
-static TCollection_ExtendedString getUnit(TCollection_ExtendedString theString)
-{
-  TCollection_ExtendedString aString(theString);
-  int aPos = aString.Search(SEPARATOR);
-  if(aPos <= 0 || aPos == aString.Length() ) return TCollection_ExtendedString();
-  return aString.Split(aPos);
-}
-
-static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString)
-{
-  TCollection_ExtendedString aString(theString);
-  int aPos = aString.Search(SEPARATOR);
-  if(aPos < 1) return aString;
-  if(aPos == 1) return TCollection_ExtendedString();
-  aString.Split(aPos-1);
-  return aString;
-}
-
-
-
 void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle) 
 {
   SALOMEDS::Locker lock;
@@ -64,15 +42,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theTitle);
-  TCollection_ExtendedString aTitle(aStr);
-  TCollection_ExtendedString aUnit = getUnit(aTable->GetRowTitle(theIndex));
-  if(aUnit.Length() > 0) {
-    aTitle += SEPARATOR;
-    aTitle += aUnit;
-  }
-
-  aTable->SetRowTitle(theIndex, aTitle);
+  aTable->SetRowTitle(theIndex, TCollection_ExtendedString((char*)theTitle));
 }
 
 void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
@@ -95,7 +65,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles()
   SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
   aTitles->length(aTable->GetNbRows());
   for(int i = 0; i < aTitles->length(); i++)
-    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(getTitle(aTable->GetRowTitle(i + 1))).ToCString());
+    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowTitle(i + 1)).ToCString());
   return aTitles._retn();
 }
 
@@ -120,7 +90,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringS
   Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
   if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
-    SetColumnTitle(i + 1, theTitles[i]);
+    aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
   }
 }
 
@@ -144,12 +114,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theUnit);
-  TCollection_ExtendedString aTitle = getTitle(aTable->GetRowTitle(theIndex));
-  TCollection_ExtendedString aUnit(aStr);
-  aTitle += SEPARATOR;
-  aTitle += aUnit;
-  aTable->SetRowTitle(theIndex, aTitle);
+  aTable->SetRowUnit(theIndex, TCollection_ExtendedString((char*)theUnit));
 }
 
 void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
@@ -161,7 +126,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq&
   Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
   if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   for (int i = 0; i < theUnits.length(); i++) {
-    SetRowUnit(i + 1, theUnits[i]);
+    aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
   }
 }
 
@@ -172,7 +137,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits()
   SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
   aUnits->length(aTable->GetNbRows());
   for(int i = 0; i < aUnits->length(); i++)
-    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(getUnit(aTable->GetRowTitle(i + 1))).ToCString());
+    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowUnit(i + 1)).ToCString());
   return aUnits._retn();
 }
 
index a6c0d7504c9db0c1a7f06e8a8c1af4728551a66b..d32a1399aa38861df061819d4fd860dbdbc3a983 100644 (file)
@@ -17,28 +17,6 @@ using namespace std;
 UNEXPECT_CATCH(ATR_IncorrectIndex, SALOMEDS::AttributeTableOfReal::IncorrectIndex);
 UNEXPECT_CATCH(ATR_IncorrectArgumentLength, SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength);
 
-#define SEPARATOR '\1'
-
-static TCollection_ExtendedString getUnit(TCollection_ExtendedString theString)
-{
-  TCollection_ExtendedString aString(theString);
-  int aPos = aString.Search(SEPARATOR);
-  if(aPos <= 0 || aPos == aString.Length() ) return TCollection_ExtendedString();
-  return aString.Split(aPos);
-}
-
-static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString)
-{
-  TCollection_ExtendedString aString(theString);
-  int aPos = aString.Search(SEPARATOR);
-  if(aPos < 1) return aString;
-  if(aPos == 1) return TCollection_ExtendedString();
-  aString.Split(aPos-1);
-  return aString;
-}
-
-
-
 void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle) 
 {
   SALOMEDS::Locker lock;     
@@ -64,15 +42,7 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const ch
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfReal) aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theTitle);
-  TCollection_ExtendedString aTitle(aStr);
-  TCollection_ExtendedString aUnit = getUnit(aTable->GetRowTitle(theIndex));
-  if(aUnit.Length() > 0) {
-    aTitle += SEPARATOR;
-    aTitle += aUnit;
-  }
-
-  aTable->SetRowTitle(theIndex, aTitle);
+  aTable->SetRowTitle(theIndex, TCollection_ExtendedString((char*)theTitle));
 }
 
 void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
@@ -84,7 +54,7 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& th
   Handle(SALOMEDSImpl_AttributeTableOfReal) aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_impl);
   if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
-    SetRowTitle(i + 1, theTitles[i]);
+    aTable->SetRowTitle(i + 1, (char*)theTitles[i].in());
   }
 }
 
@@ -95,7 +65,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowTitles()
   SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
   aTitles->length(aTable->GetNbRows());
   for(int i = 0; i < aTitles->length(); i++)
-    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(getTitle(aTable->GetRowTitle(i + 1))).ToCString());
+    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowTitle(i + 1)).ToCString());
   return aTitles._retn();
 }
 
@@ -120,7 +90,7 @@ void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq&
   Handle(SALOMEDSImpl_AttributeTableOfReal) aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_impl);
   if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
-    SetColumnTitle(i + 1, theTitles[i]);
+    aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
   }
 }
 
@@ -144,12 +114,7 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const cha
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfReal) aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theUnit);
-  TCollection_ExtendedString aTitle = getTitle(aTable->GetRowTitle(theIndex));
-  TCollection_ExtendedString aUnit(aStr);
-  aTitle += SEPARATOR;
-  aTitle += aUnit;
-  aTable->SetRowTitle(theIndex, aTitle);
+  aTable->SetRowUnit(theIndex, TCollection_ExtendedString((char*)theUnit));
 }
 
 void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
@@ -161,7 +126,7 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& the
   Handle(SALOMEDSImpl_AttributeTableOfReal) aTable = Handle(SALOMEDSImpl_AttributeTableOfReal)::DownCast(_impl);
   if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfReal::IncorrectArgumentLength();
   for (int i = 0; i < theUnits.length(); i++) {
-    SetRowUnit(i + 1, theUnits[i]);
+    aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
   }
 }
 
@@ -172,7 +137,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowUnits()
   SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
   aUnits->length(aTable->GetNbRows());
   for(int i = 0; i < aUnits->length(); i++)
-    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(getUnit(aTable->GetRowTitle(i + 1))).ToCString());
+    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowTitle(i + 1)).ToCString());
   return aUnits._retn();
 }
 
index 84432237259456de0b533e2fd97d89269d168131..414424781cab9d701e680013557dd6b6fe0e7267 100644 (file)
@@ -20,28 +20,6 @@ using namespace std;
 UNEXPECT_CATCH(ATS_IncorrectIndex, SALOMEDS::AttributeTableOfString::IncorrectIndex);
 UNEXPECT_CATCH(ATS_IncorrectArgumentLength, SALOMEDS::AttributeTableOfString::IncorrectArgumentLength);
 
-#define SEPARATOR '\1'
-
-static TCollection_ExtendedString getUnit(TCollection_ExtendedString theString)
-{
-  TCollection_ExtendedString aString(theString);
-  int aPos = aString.Search(SEPARATOR);
-  if(aPos <= 0 || aPos == aString.Length() ) return TCollection_ExtendedString();
-  return aString.Split(aPos);
-}
-
-static TCollection_ExtendedString getTitle(TCollection_ExtendedString theString)
-{
-  TCollection_ExtendedString aString(theString);
-  int aPos = aString.Search(SEPARATOR);
-  if(aPos < 1) return aString;
-  if(aPos == 1) return TCollection_ExtendedString();
-  aString.Split(aPos-1);
-  return aString;
-}
-
-
-
 void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle) 
 {
   SALOMEDS::Locker lock;
@@ -67,15 +45,8 @@ void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfString) aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theTitle);
-  TCollection_ExtendedString aTitle(aStr);
-  TCollection_ExtendedString aUnit = getUnit(aTable->GetRowTitle(theIndex));
-  if(aUnit.Length() > 0) {
-    aTitle += SEPARATOR;
-    aTitle += aUnit;
-  }
 
-  aTable->SetRowTitle(theIndex, aTitle);
+  aTable->SetRowTitle(theIndex, TCollection_ExtendedString((char*)theTitle));
 }
 
 void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
@@ -87,7 +58,7 @@ void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq&
   Handle(SALOMEDSImpl_AttributeTableOfString) aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_impl);
   if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
-    SetRowTitle(i + 1, CORBA::string_dup(theTitles[i]));
+    aTable->SetRowTitle(i + 1, TCollection_ExtendedString((char*)theTitles[i].in()));
   }
 }
 
@@ -98,7 +69,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowTitles()
   SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
   aTitles->length(aTable->GetNbRows());
   for(int i = 0; i < aTitles->length(); i++)
-    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(getTitle(aTable->GetRowTitle(i + 1))).ToCString());
+    aTitles[i] =CORBA::string_dup(TCollection_AsciiString(aTable->GetRowTitle(i + 1)).ToCString());
   return aTitles._retn();
 }
 
@@ -110,8 +81,7 @@ void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, con
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfString) aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theTitle);
-  aTable->SetColumnTitle(theIndex, TCollection_ExtendedString(aStr));
+  aTable->SetColumnTitle(theIndex, TCollection_ExtendedString((char*)theTitle));
 }
 
 void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
@@ -123,7 +93,7 @@ void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSe
   Handle(SALOMEDSImpl_AttributeTableOfString) aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_impl);
   if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
-    SetColumnTitle(i + 1, CORBA::string_dup(theTitles[i]));
+    aTable->SetColumnTitle(i + 1, TCollection_ExtendedString((char*)theTitles[i].in()));
   }
 }
 
@@ -147,12 +117,7 @@ void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const c
   CheckLocked();
   Handle(SALOMEDSImpl_AttributeTableOfString) aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectIndex();
-  CORBA::String_var aStr = CORBA::string_dup(theUnit);
-  TCollection_ExtendedString aTitle = getTitle(aTable->GetRowTitle(theIndex));
-  TCollection_ExtendedString aUnit(aStr);
-  aTitle += SEPARATOR;
-  aTitle += aUnit;
-  aTable->SetRowTitle(theIndex, aTitle);
+  aTable->SetRowUnit(theIndex, TCollection_ExtendedString((char*)theUnit));
 }
 
 void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
@@ -164,7 +129,7 @@ void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& t
   Handle(SALOMEDSImpl_AttributeTableOfString) aTable = Handle(SALOMEDSImpl_AttributeTableOfString)::DownCast(_impl);
   if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfString::IncorrectArgumentLength();
   for (int i = 0; i < theUnits.length(); i++) {
-    SetRowUnit(i + 1, CORBA::string_dup(theUnits[i]));
+    aTable->SetRowUnit(i + 1, TCollection_ExtendedString((char*)theUnits[i].in()));
   }
 }
 
@@ -175,7 +140,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowUnits()
   SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
   aUnits->length(aTable->GetNbRows());
   for(int i = 0; i < aUnits->length(); i++)
-    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(getUnit(aTable->GetRowTitle(i + 1))).ToCString());
+    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowTitle(i + 1)).ToCString());
   return aUnits._retn();
 }
 
index 13ac6002e4729e69a7cee57a9951e34ef7cf4432..07929e3fefb386d4113437a3e3c9538fba1162a1 100644 (file)
@@ -9,31 +9,27 @@ using namespace std;
 #include "SALOMEDSImpl_Study.hxx"
 #include "SALOMEDS.hxx"
 
-#include <TDF_LabelList.hxx>
-#include <TDF_ListIteratorOfLabelList.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
 
 void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject) 
 {
   SALOMEDS::Locker lock; 
   TDF_Label aLabel;
   TDF_Tool::Label(_impl->Label().Data(),anObject->GetID(),aLabel,1);
-  (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Append(aLabel);
+  (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Add(SALOMEDSImpl_Study::SObject(aLabel));
 }
 
 SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get() 
 {
   SALOMEDS::Locker lock; 
-  TDF_LabelList aLList;
+  Handle(TColStd_HSequenceOfTransient) aSeq = (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Get();
   SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject;
-  (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Get(aLList);
-  if (aLList.Extent() == 0) 
-    return aSList._retn();
-  aSList->length(aLList.Extent());
-  TDF_ListIteratorOfLabelList anIter(aLList);
-  int index;
-  for(index=0;anIter.More();anIter.Next(),index++) {
-    SALOMEDS::SObject_var anSO = SALOMEDS_SObject_i::New(SALOMEDSImpl_Study::GetStudy(anIter.Value())->GetSObject(anIter.Value()), _orb);
-    aSList[index] = anSO;
+  int aLength = aSeq->Length(), i;
+  if (aLength == 0) return aSList._retn();
+  aSList->length(aLength);
+  for(i=1; i <=aLength; i++) {
+    SALOMEDS::SObject_var anSO = SALOMEDS_SObject_i::New(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)), _orb);
+    aSList[i-1] = anSO;
   }
   return aSList._retn();
 }
@@ -43,5 +39,5 @@ void SALOMEDS_AttributeTarget_i::Remove(SALOMEDS::SObject_ptr anObject)
   SALOMEDS::Locker lock; 
   TDF_Label aLabel;
   TDF_Tool::Label(_impl->Label().Data(),anObject->GetID(),aLabel,1);
-  (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Remove(aLabel);
+  (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Remove(SALOMEDSImpl_Study::SObject(aLabel));
 }
index 7ce8f766640d97fb0f19ad7eeffb127a7965f0c6..eafff6072024335d612060751642632ad67c0ed9 100644 (file)
@@ -11,7 +11,7 @@ SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor()
 {
   SALOMEDS::Locker lock;
   SALOMEDS::Color TextColor;
-  Handle(TColStd_HArray1OfReal) anArray = Handle(SALOMEDSImpl_AttributeTextColor)::DownCast(_impl)->GetTextColor();
+  Handle(TColStd_HArray1OfReal) anArray = Handle(SALOMEDSImpl_AttributeTextColor)::DownCast(_impl)->TextColor();
   if (anArray.IsNull() || anArray->Length()!=3) { 
     TextColor.R = 0;
     TextColor.G = 0;
index 152438f323637cb27ee1eb699752a326ea08139a..edc95c0704b4236e2c59027a1c2ea00e982ad7da 100644 (file)
@@ -11,7 +11,7 @@ SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor()
 {
   SALOMEDS::Locker lock;
   SALOMEDS::Color TextHighlightColor;
-  Handle(TColStd_HArray1OfReal) anArray=Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast(_impl)->GetTextColor();
+  Handle(TColStd_HArray1OfReal) anArray=Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast(_impl)->TextHighlightColor();
   if (anArray.IsNull() || anArray->Length()!=3) { 
     TextHighlightColor.R = 0;
     TextHighlightColor.G = 0;
index 99d6bfc8c3f2635fe7ccd0890c16a2ef60fc6388..899f81cea2629fbbe97de36aacc3656fca908bea 100644 (file)
@@ -13,6 +13,15 @@ using namespace std;
 #include <TCollection_AsciiString.hxx>
 #include <map>
 
+#ifdef WNT
+#include <process.h>
+#else
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
+#include "OpUtil.hxx"
+
 UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection);
 
 SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(const Handle(TDF_Attribute)& theImpl, CORBA::ORB_ptr theOrb)
@@ -40,7 +49,7 @@ SALOMEDS::SObject_ptr SALOMEDS_GenericAttribute_i::GetSObject()
 {
   SALOMEDS::Locker lock;
   if (_impl.IsNull() || _impl->Label().IsNull()) return SALOMEDS::SObject::_nil();
-  Handle(SALOMEDSImpl_SObject) so_impl = SALOMEDSImpl_Study::GetStudy(_impl->Label())->GetSObject(_impl->Label());
+  Handle(SALOMEDSImpl_SObject) so_impl = SALOMEDSImpl_Study::SObject(_impl->Label());
   SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (so_impl, _orb);
   return so._retn();
 }
@@ -56,6 +65,16 @@ char* SALOMEDS_GenericAttribute_i::Type()
   return "";
 }
 
+char* SALOMEDS_GenericAttribute_i::GetClassType()
+{
+  SALOMEDS::Locker lock;
+  if (!_impl.IsNull()) {
+    return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl));
+  }
+         
+  return "";
+}  
+
 
 SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute(const Handle(TDF_Attribute)& theAttr,
                                                                            CORBA::ORB_ptr theOrb) 
@@ -78,3 +97,18 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute(cons
 
   return anAttribute._retn(); 
 }                                                                                                                    
+
+//===========================================================================
+//   PRIVATE FUNCTIONS
+//===========================================================================
+long SALOMEDS_GenericAttribute_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
+{
+#ifdef WNT
+  long pid = (long)_getpid();
+#else
+  long pid = (long)getpid();
+#endif  
+  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
+  TDF_Attribute* local_impl = _impl.operator->();
+  return ((long)local_impl);
+}
index 4bd8461b1141ebfaf738b2190afdf94b98589612..1710831aeac429a4007d0c76975a632b0dfc9d94 100644 (file)
@@ -26,13 +26,17 @@ public:
 
   void CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection);
   
-  char* Type();
+  virtual char* Type();
+
+  char* GetClassType();
 
   SALOMEDS::SObject_ptr GetSObject();
   
   virtual Handle(TDF_Attribute) GetImpl() { return _impl; }
 
   static SALOMEDS::GenericAttribute_ptr CreateAttribute(const Handle(TDF_Attribute)& theAttr, CORBA::ORB_ptr theOrb);  
+
+  virtual long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
 };
 
 #endif
index ce60bace51c629774536f14e925300099c562dc4..e70da136b32237ba19886314ee1dccdad1621d64 100644 (file)
@@ -20,6 +20,15 @@ using namespace std;
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <map>
 
+#ifdef WNT
+#include <process.h>
+#else
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
+#include "OpUtil.hxx"
+
 SALOMEDS::SObject_ptr SALOMEDS_SObject_i::New(const Handle(SALOMEDSImpl_SObject)& theImpl, CORBA::ORB_ptr theORB)
 {
   static std::map<SALOMEDSImpl_SObject*, SALOMEDS_SObject_i*> _mapOfSO;
@@ -293,3 +302,18 @@ char* SALOMEDS_SObject_i::GetIOR()
   CORBA::String_var aStr = CORBA::string_dup(_impl->GetIOR().ToCString());
   return aStr._retn();
 }
+
+//===========================================================================
+//   PRIVATE FUNCTIONS
+//===========================================================================
+long SALOMEDS_SObject_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
+{
+#ifdef WNT
+  long pid = (long)_getpid();
+#else
+  long pid = (long)getpid();
+#endif  
+  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
+  SALOMEDSImpl_SObject* local_impl = _impl.operator->();
+  return ((long)local_impl);
+}
index a5573d924bc0d9a07a26e2f99340c64bf095c150..2027c236f7ff3bbd2af2628f74939b337961b061 100644 (file)
@@ -49,6 +49,8 @@ public:
 
   virtual CORBA::Short Tag();
   virtual CORBA::Short Depth();
+
+  virtual long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
 };
 
 #endif
index 9c4a9d7484c86dd4688402267cdd6d394ae3d1a4..1b39659242a71524362c7e1d4a1bf5243d90209d 100644 (file)
 #include <strstream>
 using namespace std;
 
+#ifdef WNT
+#include <process.h>
+#else
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
+#include "OpUtil.hxx"
+
 #include "SALOME_GenericObj_i.hh"
 
 #include "Utils_ExceptHandlers.hxx"
@@ -402,6 +411,20 @@ SALOMEDS_Driver_i* GetDriver(const Handle(SALOMEDSImpl_SObject)& theObject, CORB
 
   return driver;
 }
+//===========================================================================
+//   PRIVATE FUNCTIONS
+//===========================================================================
+long SALOMEDS_StudyManager_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
+{
+#ifdef WNT
+  long pid = (long)_getpid();
+#else
+  long pid = (long)getpid();
+#endif  
+  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
+  SALOMEDSImpl_StudyManager* aManager = _impl.operator->();
+  return ((long)aManager);
+}
 
 //===========================================================================
 namespace SALOMEDS
index a3ded98f878cf78a4ed71c08dc336f23d14c01e0..e057cb7ca09d02c86569ade13b30120f50dc7974 100644 (file)
@@ -123,6 +123,8 @@ public:
   virtual CORBA::Object_ptr ConvertIORToObject(const char* theIOR) { return _orb->string_to_object(theIOR); };  
   
   void ping(){};
+
+  virtual long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
 };
 
 #endif 
index 77e8bbe62a5365551c4e27a73431e8efe24dcd0f..3298a746694f9b544d6aa6716e042d3c65204cce 100644 (file)
@@ -27,6 +27,14 @@ using namespace std;
 #include <TDF_Label.hxx>
 #include <TDF_Attribute.hxx>
 
+#ifdef WNT
+#include <process.h>
+#else
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
+#include "OpUtil.hxx"
 
 //============================================================================
 /*! Function : SALOMEDS_Study_i
@@ -700,3 +708,18 @@ CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, const char* theB
   delete factory;
   return ret;
 }
+
+//===========================================================================
+//   PRIVATE FUNCTIONS
+//===========================================================================
+long SALOMEDS_Study_i::GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal)
+{
+#ifdef WNT
+  long pid = (long)_getpid();
+#else
+  long pid = (long)getpid();
+#endif  
+  isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0;
+  SALOMEDSImpl_Study* local_impl = _impl.operator->();
+  return ((long)local_impl);
+}
index e8f4518f2d4cd105ff562e3a681134ab0c06bfa1..7800eae18467678cae17269b18d9b43cc8fa840c 100644 (file)
@@ -258,5 +258,7 @@ public:
   virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished); 
 
   virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
+
+  virtual long GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
 };
 #endif