Salome HOME
Issue 0020194: EDF 977 ALL: Get rid of warnings PACKAGE_VERSION already defined
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_Client.cxx
index 94d5ad1b6ed2599c22c0f9775d469fe0669c82ec..d0ffb0e8866be418a33f569b5ac9329797331e2b 100644 (file)
@@ -1,25 +1,45 @@
-using namespace std;
-//  File      : SALOMEDS_Client.cxx
-//  Created   : Wed Nov 28 16:20:25 2001
-//  Author    : Yves FRICAUD
-
-//  Project   : SALOME
-//  Module    : SALOMEDS
-//  Copyright : Open CASCADE 2001
+//  Copyright (C) 2007-2008  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.
+//
+//  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$
-
+//
 #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"
+
+using namespace std;
 
 //============================================================================
 /*! 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()){
@@ -29,12 +49,12 @@ 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++) 
+      for (int i = 1; i <= offset ; i++) 
        MESSAGE("--");
       MESSAGE(">"<<CSO->GetID()<<Val);
     }
     if (CSO->ReferencedObject(RefSO)) {
-      for (Standard_Integer i = 1; i <= offset ; i++) 
+      for (int i = 1; i <= offset ; i++) 
        MESSAGE(" ");
       MESSAGE("*Reference"<<RefSO->GetID());
     }
@@ -50,9 +70,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();
@@ -69,7 +89,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");
  
@@ -260,9 +280,11 @@ int main(int argc, char** argv)
 { 
   try {
     // Initialise the ORB.
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
-
-
+#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");
@@ -302,4 +324,3 @@ int main(int argc, char** argv)
   }
   return 0;
 }
-