Salome HOME
add check on mpi implementation
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_Client.cxx
index aa39a9f526eb935fa043f095df9f9168077e65bd..4b57e30dcddb931366c792f72ef0c3d3f241d274 100644 (file)
@@ -1,44 +1,44 @@
-//  SALOME SALOMEDS : data structure of SALOME and sources of Salome data server 
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
+//  SALOME SALOMEDS : data structure of SALOME and sources of Salome data server 
 //  File   : SALOMEDS_Client.cxx
 //  Author : Yves FRICAUD
 //  Module : SALOME
 //  $Header$
-
-using namespace std;
+//
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
 #include "SALOMEDS_StudyManager_i.hxx"
-#include "utilities.h"
 #include "SALOMEDS_AttributeName_i.hxx"
+#include "utilities.h"
+#include "HDFOI.hxx"
 
 //============================================================================
 /*! Function :
  *  Purpose  : 
  */
 //============================================================================
-static void DumpComponent(SALOMEDS::Study_ptr Study,SALOMEDS::SObject_ptr SO,Standard_Integer offset) {
+static void DumpComponent(SALOMEDS::Study_ptr Study,SALOMEDS::SObject_ptr SO, int offset) {
   SALOMEDS::SObject_var RefSO;
   SALOMEDS::ChildIterator_var it = Study->NewChildIterator(SO);
   for (; it->More();it->Next()){
@@ -48,13 +48,13 @@ static void DumpComponent(SALOMEDS::Study_ptr Study,SALOMEDS::SObject_ptr SO,Sta
     {
       SALOMEDS::AttributeName_var Name = SALOMEDS::AttributeName::_narrow(anAttr);
       CORBA::String_var Val = Name->Value();
-      for (Standard_Integer i = 1; i <= offset ; i++) 
-       MESSAGE("--");
+      for (int i = 1; i <= offset ; i++) 
+        MESSAGE("--");
       MESSAGE(">"<<CSO->GetID()<<Val);
     }
     if (CSO->ReferencedObject(RefSO)) {
-      for (Standard_Integer i = 1; i <= offset ; i++) 
-       MESSAGE(" ");
+      for (int i = 1; i <= offset ; i++) 
+        MESSAGE(" ");
       MESSAGE("*Reference"<<RefSO->GetID());
     }
     DumpComponent(Study,CSO,offset+2);
@@ -69,9 +69,9 @@ static void DumpComponent(SALOMEDS::Study_ptr Study,SALOMEDS::SObject_ptr SO,Sta
 static void DumpStudy (SALOMEDS::Study_ptr Study) {
   MESSAGE("Explore Study and Write name of each object if it exists");
   
-  Standard_CString name;
+  char* name;
   SALOMEDS::SComponentIterator_var itcomp = Study->NewComponentIterator();
-  Standard_Integer offset = 1;
+  int offset = 1;
   for (; itcomp->More(); itcomp->Next()) {
     SALOMEDS::SComponent_var SC = itcomp->Value();
     name = SC->ComponentDataType();
@@ -88,7 +88,7 @@ static void DumpStudy (SALOMEDS::Study_ptr Study) {
 static void Test(SALOMEDS::StudyManager_ptr myStudyMgr )
 {
   try {
-  Standard_CString name;
+  char* name;
   MESSAGE("Create New Study Study1");
   SALOMEDS::Study_var myStudy = myStudyMgr->NewStudy("Study1");
  
@@ -279,8 +279,11 @@ int main(int argc, char** argv)
 { 
   try {
     // Initialise the ORB.
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
-    omniORB::MaxMessageSize(100 * 1024 * 1024);
+#if OMNIORB_VERSION >= 4
+    CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ;
+#else
+    CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB3" );
+#endif
     
     // Obtain a reference to the root POA.
     CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");