Salome HOME
Porting SALOME COMPONENT module to win32 platform.
authorrnv <rnv@opencascade.com>
Tue, 29 Oct 2013 06:43:14 +0000 (06:43 +0000)
committerrnv <rnv@opencascade.com>
Tue, 29 Oct 2013 06:43:14 +0000 (06:43 +0000)
47 files changed:
CMakeLists.txt
SalomeCOMPONENTConfig.cmake.in
src/AddComponent/AddComponent.hxx [new file with mode: 0755]
src/AddComponent/AddComponent_CheckOfUndefined.cxx
src/AddComponent/AddComponent_Impl.cxx
src/AddComponent/AddComponent_Impl.hxx
src/AddComponent/Adder_Impl.cxx
src/AddComponent/Adder_Impl.hxx
src/AddComponent/CMakeLists.txt
src/AdditionComponent/AdditionComponent.hxx [new file with mode: 0755]
src/AdditionComponent/AdditionComponent_CheckOfUndefined.cxx
src/AdditionComponent/AdditionComponent_Impl.cxx
src/AdditionComponent/AdditionComponent_Impl.hxx
src/AdditionComponent/Addition_Adder_Impl.cxx
src/AdditionComponent/Addition_Adder_Impl.hxx
src/AdditionComponent/CMakeLists.txt
src/CMakeLists.txt
src/DataStreamComponent/DataStreamComponent_CheckOfUndefined.cxx
src/DataStreamComponent/DataStreamComponent_Impl.cxx
src/DataStreamComponent/DataStreamComponent_Impl.hxx
src/DivComponent/DivComponent.cxx
src/DivComponent/DivComponent.hxx
src/MulComponent/MulComponent.cxx
src/MulComponent/MulComponent.hxx
src/SIGNALSComponent/CMakeLists.txt
src/SIGNALSComponent/SIGNALSComponent.cxx
src/SIGNALSComponent/SIGNALSComponent.hxx
src/SIGNALSComponent/SIGNALSComponent_CheckOfUndefined.cxx
src/SIGNALSComponent/SIGNALSComponent_Impl.cxx
src/SIGNALSComponent/SIGNALSComponent_Impl.hxx
src/SIGNALSComponent/SIGNALSComponent_defines.hxx [new file with mode: 0755]
src/SubComponent/SubComponent.cxx
src/SubComponent/SubComponent.hxx
src/SyrComponent/SyrComponent_CheckOfUndefined.cxx
src/SyrComponent/SyrComponent_Impl.cxx
src/SyrComponent/SyrComponent_Impl.hxx
src/TestFunctions/DynInvoke.cxx
src/TestFunctions/DynInvoke.hxx
src/TestFunctions/TestFunctions.cxx
src/TestFunctions/TestFunctionsMemory.cxx
src/TestFunctions/TestFunctionsMemory1.cxx
src/TestFunctions/TestFunctionsMemory2.cxx
src/TestFunctions/TestFunctionsMemory3.cxx
src/TestFunctions/TestFunctionsMemory4.cxx
src/TypesCheck/TypesCheck_CheckOfUndefined.cxx
src/TypesCheck/TypesCheck_Impl.cxx
src/TypesCheck/TypesCheck_Impl.hxx

index d72e86defc9a602fbfdb9b3790d693cf81ab3b41..cfeb252140e5899000127b53fa60ff6a1828f18a 100755 (executable)
@@ -139,9 +139,16 @@ SET(_${PROJECT_NAME}_exposed_targets
   AddComponentEngine AdditionComponentEngine DivComponentEngine
   MulComponentEngine SubComponentEngine SyrComponentEngine DynInvoke
   TypesCheckEngine DataStreamFactoryEngine SIGNALSComponentEngine
-  UndefinedSymbolComponentEngine SalomeIDLCOMPONENT
+  SalomeIDLCOMPONENT
 )
 
+IF(NOT WIN32)
+  LIST(APPEND _${PROJECT_NAME}_exposed_targets 
+   UndefinedSymbolComponentEngine)
+ENDIF(NOT WIN32)
+
+
 # Add all targets to the build-tree export set
 EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
   FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
index 22bb14a04aecc968d31eca55411b842a4037c4b2..04593999b4ce2fe05275dcb31a1e6b226201898f 100644 (file)
@@ -106,6 +106,8 @@ SET(COMPONENT_SyrComponentEngine SyrComponentEngine)
 SET(COMPONENT_TypesCheckEngine TypesCheckEngine)
 SET(COMPONENT_DataStreamFactoryEngine DataStreamFactoryEngine)
 SET(COMPONENT_SIGNALSComponentEngine SIGNALSComponentEngine)
-SET(COMPONENT_UndefinedSymbolComponentEngine UndefinedSymbolComponentEngine)
+IF(NOT WIN32)
+  SET(COMPONENT_UndefinedSymbolComponentEngine UndefinedSymbolComponentEngine)
+ENDIF(NOT WIN32)
 SET(COMPONENT_DynInvoke DynInvoke)
 SET(COMPONENT_SalomeIDLCOMPONENT ${SalomeIDLCOMPONENT})
\ No newline at end of file
diff --git a/src/AddComponent/AddComponent.hxx b/src/AddComponent/AddComponent.hxx
new file mode 100755 (executable)
index 0000000..34dc70a
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (C) 2007-2013  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
+//
+
+//  SuperVisionTest AddComponent : example of component that adds two numbers
+//  File   : AddComponent.hxx
+//  Author : Roman NIKOLAEV, OPEN CASCADE
+//  $Header:
+//
+#ifndef _ADD_COMPONENT_HXX_
+#define _ADD_COMPONENT_HXX_
+
+#ifdef WIN32
+# if defined ADDCOMPONENTENGINE_EXPORTS || defined AddComponentEngine_EXPORTS
+#  define ADDCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define ADDCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define ADDCOMPONENTENGINE_EXPORT
+#endif
+
+#endif _ADD_COMPONENT_HXX_
index 550f2f4a0d49f91993a3158370eae312cb772500..ea530596d771fb7915eac0f1f5c1400a6584151b 100644 (file)
@@ -31,7 +31,7 @@
 #include <string>
 #include <stdio.h>
 
-#ifndef WNT
+#ifndef WIN32
 #include <unistd.h>
 #else
 #include <process.h>
 //CCRT
 #include <sstream>
 #include <time.h>
+#ifndef WIN32
 #include <sys/time.h>
 #include <sys/stat.h>
+#endif
 //end-CCRT
 
 #include "Container_init_python.hxx"
index 662a2d748eebab94a4e333d43c0e6940a6f700ff..a990354d18f009c250f006d7ecf6964c31561047 100644 (file)
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#else
+#include <process.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -81,9 +85,13 @@ CORBA::Double AddComponent_Impl::Add( CORBA::Double x , CORBA::Double y , CORBA:
   sendMessage(NOTIF_STEP, "AddComponent_Impl::Add is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "AddComponent_Impl::Add( " <<  x << " , " << y << " , " << z
        << " ) returns " << (x - y) << " after " << S << " seconds" )
   LastAddition = z ;
@@ -115,25 +123,37 @@ CORBA::Long AddComponent_Impl::Sigma( CORBA::Long n ) {
 
 void AddComponent_Impl::Setx( CORBA::Double x ) {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   xx = x ;
 }
 
 void AddComponent_Impl::Sety( CORBA::Double y ) {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   yy = y ;
 }
 
 CORBA::Double AddComponent_Impl::Addxy() {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   double zz = xx + yy ;
   LastAddition = zz ;
   return zz;
@@ -141,9 +161,13 @@ CORBA::Double AddComponent_Impl::Addxy() {
 
 CORBA::Double AddComponent_Impl::AddyTox( CORBA::Double y ) {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   double zz = xx + y ;
   LastAddition = zz ;
   return zz;
@@ -249,8 +273,13 @@ extern "C"
       const char *instanceName,
       const char *interfaceName)
   {
+#ifndef WIN32
     MESSAGE("AddComponentEngine_factory AddComponentEngine ("
             << instanceName << "," << interfaceName << "," << getpid() << ")");
+#else 
+    MESSAGE("AddComponentEngine_factory AddComponentEngine ("
+            << instanceName << "," << interfaceName << "," << _getpid() << ")");
+#endif
     AddComponent_Impl * myAddComponent 
       = new AddComponent_Impl(orb, poa, contId, instanceName, interfaceName);
     return myAddComponent->getId() ;
index d6db6e2cc2d53f3c306885b275e7c9b1ba602757..85393e213552a001c9785b10f96b1d81349d0686 100644 (file)
 #ifndef _ADDINTERFACE_IMPL_HXX_
 #define _ADDINTERFACE_IMPL_HXX_
 
-//#include <iostream.h>
+
+#include "AddComponent.hxx"
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(AddComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class AddComponent_Impl :  public POA_SuperVisionTest::AddComponent ,
-                           public Engines_Component_i {
+class ADDCOMPONENTENGINE_EXPORT AddComponent_Impl :  public POA_SuperVisionTest::AddComponent ,
+                                                     public Engines_Component_i {
 public:
   AddComponent_Impl() ;
   AddComponent_Impl( CORBA::ORB_ptr orb,
@@ -83,6 +84,7 @@ private:
 };
 
 extern "C"
+  ADDCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * AddComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
index 8ea13821e15d4b59291fff1571d3fd36aad24f3b..6f114741e2051328f6ca33eaf847a1ada7805f59 100644 (file)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -95,9 +97,13 @@ CORBA::Double Adder_Impl::Add( CORBA::Double x , CORBA::Double y , CORBA::Double
   sendMessage(NOTIF_STEP, "Adder_Impl::Add is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "Adder_Impl::Add( " <<  x << " , " << y << " , " << z
        << " ) returns " << -(x - y) << " after " << S << " seconds" )
   LastAddition = z ;
@@ -122,9 +128,13 @@ CORBA::Double Adder_Impl::AddAndCompare( CORBA::Double x , CORBA::Double y ,
   sendMessage(NOTIF_STEP, "Adder_Impl::AddAndCompare is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "Adder_Impl::AddAndCompare( " <<  x << " , " << y << " , " << z
        << " ) returns " << -(x - y) << " after " << S << " seconds" )
   LastAddition = z ;
@@ -150,9 +160,13 @@ void Adder_Impl::SetLastResult( CORBA::Double z ) {
   int S;
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   LastAddition = z ;
   endService( " Adder_Impl::SetLastResult"  );
   return ;
@@ -164,9 +178,13 @@ void Adder_Impl::LastResult( CORBA::Double & z ) {
   int S;
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   z = LastAddition ;
   endService( " Adder_Impl::LastResult"  );
   return ;
index edc632dfa49aaa54635701f0858665bbbe97934a..e5934ef53b08cd7f2f4346ca87d7b00dc3390edb 100644 (file)
 #ifndef _ADDER_IMPL_HXX_
 #define _ADDER_IMPL_HXX_
 
+#include "AddComponent.hxx"
 #include <iostream>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(AddComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class Adder_Impl :  public POA_SuperVisionTest::Adder ,
-                    public Engines_Component_i {
+class ADDCOMPONENTENGINE_EXPORT Adder_Impl :  public POA_SuperVisionTest::Adder ,
+                                              public Engines_Component_i {
   public:
     Adder_Impl() ;
     Adder_Impl( CORBA::ORB_ptr orb ,
index 5cf248ff50acd796ba8848c732fb8d11ab19fa70..31d7f7bc447a496188c364c863f6bb228d185335 100644 (file)
@@ -57,6 +57,7 @@ SET(_link_LIBRARIES
 SET(AddComponentEngine_HEADERS
   AddComponent_Impl.hxx
   Adder_Impl.hxx
+  AddComponent.hxx 
 )
 
 # --- sources ---
diff --git a/src/AdditionComponent/AdditionComponent.hxx b/src/AdditionComponent/AdditionComponent.hxx
new file mode 100755 (executable)
index 0000000..48ec1b2
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2007-2013  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
+//
+
+//  File   : AdditionComponent.hxx
+//  Author : Roman NIKOLAEV, OPEN CASCADE
+//  $Header:
+//
+#ifndef _ADDITION_COMPONENT_HXX_
+#define _ADDITION_COMPONENT_HXX_
+
+#ifdef WIN32
+# if defined ADDITIONCOMPONENTENGINE_EXPORTS || defined AdditionComponentEngine_EXPORTS
+#  define ADDITIONCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define ADDITIONCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define ADDITIONCOMPONENTENGINE_EXPORT
+#endif
+
+#endif _ADDITION_COMPONENT_HXX_
index f847991e142da50e7eb5cdaed666f1ffd46fb538..77112df42ee38d8a3227fec0b09bdc769520bde5 100644 (file)
@@ -26,7 +26,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include "AdditionComponent_Impl.hxx"
 
index 89266b63d26a2f67370df5f01dbe8d254240adba..386296aba58aed8220c0ed15b8c7ec4f6e283490 100644 (file)
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#else
+#include <process.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -81,11 +85,14 @@ CORBA::Double AdditionInterface_Impl::Add( CORBA::Double x , CORBA::Double y , C
   sendMessage(NOTIF_STEP, "AdditionInterface_Impl::Add is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
-  MESSAGE( "AdditionInterface_Impl::Add( " <<  x << " , " << y << " , " << z
-       << " ) returns " << (x - y) << " after " << S << " seconds" )
+#else
+  Sleep(S*1000);
+#endif  
+    MESSAGE( "AdditionInterface_Impl::Add( " <<  x << " , " << y << " , " << z << " ) returns " << (x - y) << " after " << S << " seconds" )
   LastAddition = z ;
   endService( " AdditionInterface_Impl::Add"  );
   return (x - y) ;
@@ -115,25 +122,37 @@ CORBA::Long AdditionInterface_Impl::Sigma( CORBA::Long n ) {
 
 void AdditionInterface_Impl::Setx( CORBA::Double x ) {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   xx = x ;
 }
 
 void AdditionInterface_Impl::Sety( CORBA::Double y ) {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   yy = y ;
 }
 
 CORBA::Double AdditionInterface_Impl::Addxy() {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   double zz = xx + yy ;
   LastAddition = zz ;
   return zz;
@@ -141,9 +160,13 @@ CORBA::Double AdditionInterface_Impl::Addxy() {
 
 CORBA::Double AdditionInterface_Impl::AddyTox( CORBA::Double y ) {
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   double zz = xx + y ;
   LastAddition = zz ;
   return zz;
@@ -249,8 +272,13 @@ extern "C"
       const char *instanceName,
       const char *interfaceName)
   {
+#ifndef WIN32
     MESSAGE("AdditionComponentEngine_factory AdditionInterfaceEngine ("
             << instanceName << "," << interfaceName << "," << getpid() << ")");
+#else
+    MESSAGE("AdditionComponentEngine_factory AdditionInterfaceEngine ("
+            << instanceName << "," << interfaceName << "," << _getpid() << ")");
+#endif
     AdditionInterface_Impl * myAdditionInterface 
       = new AdditionInterface_Impl(orb, poa, contId, instanceName, interfaceName);
     return myAdditionInterface->getId() ;
index 92d08fb7b0423371d4a24326bb5764b6e83341d1..e9889f6313ce7bb26b050a489e14ac96e21e8b8c 100644 (file)
 #ifndef _ADDITIONINTERFACE_IMPL_HXX_
 #define _ADDITIONINTERFACE_IMPL_HXX_
 
-//#include <iostream.h>
+#include "AdditionComponent.hxx"
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(AdditionComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class AdditionInterface_Impl :  public POA_AdditionComponent::AdditionInterface ,
-                           public Engines_Component_i {
+class ADDITIONCOMPONENTENGINE_EXPORT AdditionInterface_Impl :  public POA_AdditionComponent::AdditionInterface ,
+                                                               public Engines_Component_i {
 public:
   AdditionInterface_Impl() ;
   AdditionInterface_Impl( CORBA::ORB_ptr orb,
@@ -83,6 +83,7 @@ private:
 };
 
 extern "C"
+  ADDITIONCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * AdditionInterfaceEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
index a2c36f61468863bb5122071a3ff5309464de01b8..7fd3a9ba9eb35c61768b29ccb4491b4ffd1dfd81 100644 (file)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -95,9 +97,13 @@ CORBA::Double Adder_Impl::Add( CORBA::Double x , CORBA::Double y , CORBA::Double
   sendMessage(NOTIF_STEP, "Adder_Impl::Add is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "Adder_Impl::Add( " <<  x << " , " << y << " , " << z
        << " ) returns " << -(x - y) << " after " << S << " seconds" )
   LastAddition = z ;
@@ -122,9 +128,13 @@ CORBA::Double Adder_Impl::AddAndCompare( CORBA::Double x , CORBA::Double y ,
   sendMessage(NOTIF_STEP, "Adder_Impl::AddAndCompare is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "Adder_Impl::AddAndCompare( " <<  x << " , " << y << " , " << z
        << " ) returns " << -(x - y) << " after " << S << " seconds" )
   LastAddition = z ;
@@ -150,9 +160,13 @@ void Adder_Impl::SetLastResult( CORBA::Double z ) {
   int S;
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   LastAddition = z ;
   endService( " Adder_Impl::SetLastResult"  );
   return ;
@@ -164,9 +178,13 @@ void Adder_Impl::LastResult( CORBA::Double & z ) {
   int S;
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   z = LastAddition ;
   endService( " Adder_Impl::LastResult"  );
   return ;
index fe9083b414db809ec7f72e8f29e78486bc6af16a..01abad0489b99bf4eb4b9f383862ce83bc852dc2 100644 (file)
 #ifndef _ADDITION_ADDER_IMPL_HXX_
 #define _ADDITION_ADDER_IMPL_HXX_
 
+#include "AdditionComponent.hxx"
 #include <iostream>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(AdditionComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class Adder_Impl :  public POA_AdditionComponent::Adder ,
-                    public Engines_Component_i {
+class ADDITIONCOMPONENTENGINE_EXPORT Adder_Impl :  public POA_AdditionComponent::Adder ,
+                                                   public Engines_Component_i {
   public:
     Adder_Impl() ;
     Adder_Impl( CORBA::ORB_ptr orb ,
index d2be5cce4c5f108a737161c22900a7ec03b4c54c..9d1c97ef950d8843c214567b7148c6b04a01f664 100644 (file)
@@ -66,6 +66,7 @@ SET(AdditionComponentEngine_HEADERS
 SET(AdditionComponentEngine_SOURCES
   Addition_Adder_Impl.cxx 
   AdditionComponent_Impl.cxx
+  AdditionComponent.hxx 
 )
 
 # bin programs
index 756064d7aea4947a8db36559bed6f97843fee129..ff774dd839decedda5a248e6a0d98df20faead14 100755 (executable)
@@ -32,13 +32,17 @@ SET(SUBDIRS_COMMON
   TypesCheck
   DataStreamComponent
   SIGNALSComponent
-  UndefinedSymbolComponent
   SIGNALSComponent_Swig
   TestFunctions
 )
 
+IF(NOT WIN32)
+  SET(SUBDIRS_UNDEFINED UndefinedSymbolComponent)
+ENDIF(NOT WIN32)
+
 SET(SUBDIRS
   ${SUBDIRS_COMMON}
+  ${SUBDIRS_UNDEFINED}
 )
 
 FOREACH(dir ${SUBDIRS})
index c9ae1c9650fe8159905df30cb4c976cdf3e376bd..e410f11f715cf5bdf21bde7807e649675876906a 100644 (file)
@@ -26,7 +26,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include "DataStreamComponent_Impl.hxx"
 
index 5b49ffe155c0b5196d4a6cea54e10b52a9e868f8..093cc46f535c390a5e6ede5046891b8171749d1a 100644 (file)
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#else
+#include <process.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -111,8 +115,13 @@ extern "C"
       const char *instanceName,
       const char *interfaceName)
   {
+#ifndef WIN32
     MESSAGE("DataStreamFactoryEngine_factory DataStreamFactoryEngine ("
             << instanceName << "," << interfaceName << "," << getpid() << ")");
+#else
+    MESSAGE("DataStreamFactoryEngine_factory DataStreamFactoryEngine ("
+            << instanceName << "," << interfaceName << "," << _getpid() << ")");
+#endif
     DataStreamFactory_Impl * myDataStreamFactory 
       = new DataStreamFactory_Impl(orb, poa, contId, instanceName, interfaceName);
     return myDataStreamFactory->getId() ;
index 963979ded663589e7c3d82f9a0e5ac1224b49175..841a12f25533d13dc2639510f0d1881bc762ac98 100644 (file)
 #ifndef _DATASTREAMINTERFACE_IMPL_HXX_
 #define _DATASTREAMINTERFACE_IMPL_HXX_
 
+#ifdef WIN32
+# if defined DATASTREAMFACTORYENGINE_EXPORTS || defined DataStreamFactoryEngine_EXPORTS
+#  define DATASTREAMFACTORYENGINE_EXPORT __declspec( dllexport )
+# else
+#  define DATASTREAMFACTORYENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define DATASTREAMFACTORYENGINE_EXPORT
+#endif
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(DataStreamComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class DataStreamFactory_Impl :  public POA_DataStreamComponent::DataStreamFactory ,
-                                public Engines_Component_i {
+class DATASTREAMFACTORYENGINE_EXPORT DataStreamFactory_Impl :  public POA_DataStreamComponent::DataStreamFactory ,
+                                                               public Engines_Component_i {
 public:
   DataStreamFactory_Impl() ;
   DataStreamFactory_Impl( CORBA::ORB_ptr orb,
@@ -67,6 +77,7 @@ private:
 };
 
 extern "C"
+  DATASTREAMFACTORYENGINE_EXPORT
   PortableServer::ObjectId * DataStreamFactoryEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
@@ -75,8 +86,8 @@ extern "C"
                                      const char *interfaceName ) ;
 
 
-class DataStream_Impl :  public POA_DataStreamComponent::DataStream ,
-                         public Engines_Component_i {
+class DATASTREAMFACTORYENGINE_EXPORT DataStream_Impl :  public POA_DataStreamComponent::DataStream ,
+                                                        public Engines_Component_i {
 public:
   DataStream_Impl() ;
   DataStream_Impl( CORBA::ORB_ptr orb ,
index 7cdcb8ab5363de8c729694cb6b5f80b5fff56095..11f96f1d307b016ee80606a2f6351dafaf962b51 100644 (file)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -76,9 +78,13 @@ void DivComponentEngine::Div( double x , double y , double & z ) {
   sendMessage(NOTIF_STEP, "Div is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   sendMessage(NOTIF_TRACE, "Div is Much More Difficult Operation");
   MESSAGE("DivComponentEngine::Div( " <<  x << " , " << y << " , " << z
        << " ) after " << S << " seconds" )
index a6826ee22e354aea0aa244a47f3e9ac970e234e0..0a7026bd566496df9c1c178a598192c55818bb4b 100644 (file)
 #ifndef _DIVCOMPONENTENGINE_HXX_
 #define _DIVCOMPONENTENGINE_HXX_
 
+#ifdef WIN32
+# if defined DIVCOMPONENTENGINE_EXPORTS || defined DivComponentEngine_EXPORTS
+#  define DIVCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define DIVCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define DIVCOMPONENTENGINE_EXPORT
+#endif
+
 //#include <iostream.h>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(DivComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class DivComponentEngine :  public POA_SuperVisionTest::DivComponent ,
-                            public Engines_Component_i {
+class DIVCOMPONENTENGINE_EXPORT DivComponentEngine :  public POA_SuperVisionTest::DivComponent ,
+                                                      public Engines_Component_i {
 public:
   DivComponentEngine() ;
   DivComponentEngine( CORBA::ORB_ptr orb,
@@ -58,6 +68,7 @@ private:
 };
 
 extern "C"
+  DIVCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * DivComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
index a5a71a0a3d064da61d48d3945bff1183778a79db..620ff74fd84a8f2159f37db9db84c7115b94c4d2 100644 (file)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -76,9 +78,13 @@ void MulComponentEngine::Mul( double x , double y , double & z ) {
   sendMessage(NOTIF_STEP, "Mul is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+ #ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "MulComponentEngine::Mul( " <<  x << " , " << y << " , " << z
        << " ) after " << S << " seconds" )
   endService( " MulComponentEngine::Mul"  );
index 90341d1d4719bf259c6e94d621bd2001c6fbbb8b..a79a82aebb29f11aa1aa6ad8d1e9a303beded645 100644 (file)
 #ifndef _MULCOMPONENTENGINE_HXX_
 #define _MULCOMPONENTENGINE_HXX_
 
+#ifdef WIN32
+# if defined MULCOMPONENTENGINE_EXPORTS || defined MulComponentEngine_EXPORTS
+#  define MULCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define MULCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define MULCOMPONENTENGINE_EXPORT
+#endif
+
 //#include <iostream.h>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(MulComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class MulComponentEngine :  public POA_SuperVisionTest::MulComponent ,
-                            public Engines_Component_i {
+class MULCOMPONENTENGINE_EXPORT MulComponentEngine :  public POA_SuperVisionTest::MulComponent ,
+                                                      public Engines_Component_i {
 public:
   MulComponentEngine() ;
   MulComponentEngine( CORBA::ORB_ptr orb,
@@ -58,6 +68,7 @@ private:
 };
 
 extern "C"
+  MULCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * MulComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
index 0bb0286390f3cf8cf4b87595b2db320c696660b4..40c7d84c53b1fbb9b93103cd140588a2febac1b7 100644 (file)
@@ -52,6 +52,7 @@ SET(_link_LIBRARIES
 # header files / no moc processing
 SET(SIGNALSComponentEngine_HEADERS
   SIGNALSComponent_Impl.hxx 
+  SIGNALSComponent_defines.hxx
 )
 
 # --- sources ---
index 543c66fd4f84dc7af72f3e9155eb40b88aeeb1e8..d1b294dec4d8f9a82a9074d70f2a0e7c26dd756f 100755 (executable)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
index 8e2a47c4d6abe50842050da01a376aa2d9be566e..cd5d0183c2775a04802d836fcad9e938c38271a4 100755 (executable)
 #ifndef _SIGNALSCOMPONENTENGINE_HXX_
 #define _SIGNALSCOMPONENTENGINE_HXX_
 
-//#include <iostream.h>
+#include "SIGNALSComponent_defines.hxx"
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SIGNALSComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class SIGNALSComponentEngine :  public POA_SuperVisionTest::SIGNALSComponent ,
-                            public Engines_Component_i {
+class SIGNALSCOMPONENTENGINE_EXPORT SIGNALSComponentEngine :  public POA_SuperVisionTest::SIGNALSComponent ,
+                                                              public Engines_Component_i {
 public:
   SIGNALSComponentEngine() ;
   SIGNALSComponentEngine( CORBA::ORB_ptr orb,
@@ -57,6 +57,7 @@ private:
 };
 
 extern "C"
+  SIGNALSCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * SIGNALSComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
index aabad639cc7076e8483694ec39ca33ce79d093c8..4001680ff5f1f6d3c022b3701e2c2c19a73f7a21 100644 (file)
@@ -30,7 +30,7 @@
 #include <string>
 #include <stdio.h>
 
-#ifndef WNT
+#ifndef WIN32
 #include <unistd.h>
 #else
 #include <process.h>
 //CCRT
 #include <sstream>
 #include <time.h>
+#ifndef WIN32
 #include <sys/time.h>
 #include <sys/stat.h>
+#endif
 //end-CCRT
 
 #include "Container_init_python.hxx"
index 8baecc8d96d6b874d7472d521e07d2d713b9d6ce..40550753bfcc89ff1a2ab6744a1a03ccced352af 100755 (executable)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -72,11 +74,20 @@ char* SIGNALSComponent_Impl::getVersion()
 
 CORBA::Long SIGNALSComponent_Impl::SIGSEGVfunc() {
   beginService( " SIGNALSComponent_Impl::SIGSEGVfunc" );
+#ifndef WIN32
   cout << pthread_self() << "SIGNALSComponent_Impl::SIGSEGVfunc" << endl ;
+#else
+  cout << pthread_self().p << "SIGNALSComponent_Impl::SIGSEGVfunc" << endl ;
+#endif
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+
+#ifndef WIN32
   while ( S ) {
     S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   long nullptr = *NULLPTR ;
   endService( " SIGNALSComponent_Impl::SIGSEGVfunc"  );
   return nullptr ;
@@ -84,11 +95,19 @@ CORBA::Long SIGNALSComponent_Impl::SIGSEGVfunc() {
 
 CORBA::Long SIGNALSComponent_Impl::SIGFPEfunc( CORBA::Long a , CORBA::Long b ) {
   beginService( " SIGNALSComponent_Impl::SIGFPEfunc" );
+#ifndef WIN32
   cout << pthread_self() << "SIGNALSComponent_Impl::SIGFPEfunc" << endl ;
+#else 
+  cout << pthread_self().p << "SIGNALSComponent_Impl::SIGFPEfunc" << endl ;
+#endif
   int S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
+#ifndef WIN32
   while ( S ) {
     S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   long c = a/b ;
   endService( " SIGNALSComponent_Impl::SIGFPEfunc"  );
   return c ;
@@ -97,7 +116,12 @@ CORBA::Long SIGNALSComponent_Impl::SIGFPEfunc( CORBA::Long a , CORBA::Long b ) {
 void SIGNALSComponent_Impl::MethodToKill() {
   beginService( " SIGNALSComponent_Impl::MethodToKill" );
   while ( 1 ) {
-    sleep(1) ;
+#ifndef WIN32
+    sleep(1);
+#else
+    Sleep(1000);
+#endif
+
   }
   endService( " SIGNALSComponent_Impl::MethodToKill"  );
   return ;
index 8679fa2c670e4b3d2c4d63fea8d69dcbb3a799e7..08578455a1cc73733f63206bc0c4dcd2c8b9879d 100755 (executable)
 #ifndef _SIGNALSCOMPONENT_IMPL_HXX_
 #define _SIGNALSCOMPONENT_IMPL_HXX_
 
-//#include <iostream.h>
+#include "SIGNALSComponent_defines.hxx"
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SIGNALSComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class SIGNALSComponent_Impl :  public POA_SuperVisionTest::SIGNALSComponent ,
-                               public Engines_Component_i {
+class SIGNALSCOMPONENTENGINE_EXPORT SIGNALSComponent_Impl :  public POA_SuperVisionTest::SIGNALSComponent ,
+                                                             public Engines_Component_i {
 public:
   SIGNALSComponent_Impl() ;
   SIGNALSComponent_Impl( CORBA::ORB_ptr orb,
@@ -61,6 +61,7 @@ private:
 };
 
 extern "C"
+  SIGNALSCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * SIGNALSComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
diff --git a/src/SIGNALSComponent/SIGNALSComponent_defines.hxx b/src/SIGNALSComponent/SIGNALSComponent_defines.hxx
new file mode 100755 (executable)
index 0000000..cbb654e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2007-2013  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
+//
+
+//  File   : SIGNALSComponent_defines.hxx
+//  Author : Roman NIKOLAEV, OPEN CASCADE
+//  $Header$
+//
+#ifndef _SIGNALSCOMPONENT_DEFINES_HXX_
+#define _SIGNALSCOMPONENT_DEFINES_HXX_
+
+#ifdef WIN32
+# if defined SIGNALSCOMPONENTENGINE_EXPORTS || defined SIGNALSComponentEngine_EXPORTS
+#  define SIGNALSCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define SIGNALSCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define SIGNALSCOMPONENTENGINE_EXPORT
+#endif
+
+#endif //_SIGNALSCOMPONENT_DEFINES_HXX_
index 3868afc08c6bfa6f7bb970ddcb2c06aed53a4e8f..662681db3acbd67968a8135fa9560dc0d2f10fa1 100644 (file)
@@ -26,7 +26,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -75,9 +77,13 @@ void SubComponentEngine::Sub( double x , double y , double & z ) {
   sendMessage(NOTIF_STEP, "Sub is Computing");
 //  S = 1+(int) (15.0*rand()/(RAND_MAX+1.0));
   S = 5 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( "SubComponentEngine::Sub( " <<  x << " , " << y << " , " << z
        << " ) after " << S << " seconds" )
   endService( " SubComponentEngine::Sub"  );
index fe2b7d262209c1a0e04033e8cffc0ad58119c2b8..edf3e484d1d96a6964984b5fede20c090d476dc4 100644 (file)
 #ifndef _SUBCOMPONENTENGINE_HXX_
 #define _SUBCOMPONENTENGINE_HXX_
 
+#ifdef WIN32
+# if defined SUBCOMPONENTENGINE_EXPORTS || defined SubComponentEngine_EXPORTS
+#  define SUBCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define SUBCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define SUBCOMPONENTENGINE_EXPORT
+#endif
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SubComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class SubComponentEngine :  public POA_SuperVisionTest::SubComponent ,
-                            public Engines_Component_i {
+class SUBCOMPONENTENGINE_EXPORT SubComponentEngine :  public POA_SuperVisionTest::SubComponent ,
+                                                      public Engines_Component_i {
 public:
   SubComponentEngine() ;
   SubComponentEngine( CORBA::ORB_ptr orb,
@@ -57,6 +67,7 @@ private:
 };
 
 extern "C"
+  SUBCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * SubComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
index ae5e436ae0344877d4a83804052a63f668fd1469..8ac46db3903fd556e86e3cea356d88f6ac646308 100755 (executable)
@@ -25,7 +25,9 @@
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <iostream>
 #include <fstream>
 #include <strstream>
index c4ef2fbbaed5300dffc54ae753562581011a1b8d..81b5df8fb3d93254a4f604918093778f7d357dca 100755 (executable)
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#else
+#include <process.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -74,9 +78,13 @@ CORBA::Long SyrComponent_Impl::C_ISEVEN( CORBA::Long anInteger ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_ISEVEN is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   RetVal = ( anInteger & 1 ) == 0 ;
   endService( " SyrComponent_Impl::C_ISEVEN"  );
   return RetVal ;
@@ -88,9 +96,13 @@ CORBA::Long SyrComponent_Impl::C_ISONE( CORBA::Long anOddInteger ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_ISONE is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   RetVal = ( anOddInteger == 1 ) ;
   endService( " SyrComponent_Impl::C_ISONE"  );
   return RetVal ;
@@ -101,10 +113,13 @@ CORBA::Long SyrComponent_Impl::C_M3( CORBA::Long anOddInteger ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_M3 is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
-  endService( " SyrComponent_Impl::C_M3"  );
+#else
+  Sleep(S*1000);
+#endif  endService( " SyrComponent_Impl::C_M3"  );
   if ( C_ISEVEN( anOddInteger ) )
     return 0 ;
   return ( 3*anOddInteger ) ;
@@ -115,9 +130,13 @@ CORBA::Long SyrComponent_Impl::C_M3P1( CORBA::Long anOddInteger ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_M3P1 is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   endService( " SyrComponent_Impl::C_M3P1"  );
   if ( C_ISEVEN( anOddInteger ) )
     return 0 ;
@@ -129,9 +148,13 @@ CORBA::Long SyrComponent_Impl::C_DIV2( CORBA::Long anEvenInteger ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_DIV2 is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   endService( " SyrComponent_Impl::C_DIV2"  );
   if ( !C_ISEVEN( anEvenInteger ) )
     return 0 ;
@@ -143,9 +166,13 @@ CORBA::Long SyrComponent_Impl::C_INCR( CORBA::Long aCount ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_INCR is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   endService( " SyrComponent_Impl::C_INCR"  );
   return ( aCount + 1 ) ;
 }
@@ -155,9 +182,13 @@ void SyrComponent_Impl::CPP_SETLONG( CORBA::Long aCount ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::CPP_SETLONG is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   _Count = aCount ;
   endService( " SyrComponent_Impl::CPP_SETLONG"  );
   return ;
@@ -168,9 +199,13 @@ CORBA::Long SyrComponent_Impl::CPP_ADDTOLONG( CORBA::Long anIncr ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::CPP_ADDTOLONG is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   endService( " SyrComponent_Impl::CPP_ADDTOLONG"  );
   return ( _Count + anIncr ) ;
 }
@@ -180,9 +215,13 @@ CORBA::Long SyrComponent_Impl::C_MIN( CORBA::Long aMinVal , CORBA::Long anIntege
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_MIN is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   int min = aMinVal ;
   if ( anInteger < min || aMinVal == 0 ) {
     min = anInteger ;
@@ -201,9 +240,13 @@ CORBA::Long SyrComponent_Impl::C_MAX( CORBA::Long aMaxVal , CORBA::Long anIntege
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_MAX is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   int max = aMaxVal ;
   if ( anInteger > max ) {
     max = anInteger ;
@@ -222,9 +265,13 @@ SuperVisionTest::ListOfSyr_ptr SyrComponent_Impl::C_LISTOFSYR() {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_LISTOFSYR is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   ListOfSyr_Impl * aNewListOfSyr = new ListOfSyr_Impl( _orb , _poa, _contId,
                         instanceName() , interfaceName() ,
                         graphName() , nodeName() ) ;
@@ -246,9 +293,13 @@ SuperVisionTest::ListOfSyr_ptr SyrComponent_Impl::C_AVERAGE(
   sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_AVERAGE is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   SuperVisionTest::SeqOfSyr * aSeqOfSyr = aListOfSyr->GetSeqOfSyr() ;
   int len = aSeqOfSyr->length() ;
   aSeqOfSyr->length( len + 1 ) ;
@@ -273,9 +324,13 @@ SuperVisionTest::Syr_ptr SyrComponent_Impl::Init( CORBA::Long anOddInteger ) {
   sendMessage(NOTIF_STEP, "SyrComponent_Impl creates Syr_Impl");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   Syr_Impl * mySyr ;
   mySyr = new Syr_Impl( _orb , _poa, _contId,
                         instanceName() , interfaceName() ,
@@ -343,8 +398,13 @@ extern "C"
       const char *instanceName,
       const char *interfaceName)
   {
+#ifndef WIN32
     MESSAGE("SyrComponentEngine_factory SyrComponentEngine ("
             << instanceName << "," << interfaceName << "," << getpid() << ")");
+#else
+    MESSAGE("SyrComponentEngine_factory SyrComponentEngine ("
+            << instanceName << "," << interfaceName << "," << _getpid() << ")");
+#endif
     SyrComponent_Impl * mySyrComponent 
       = new SyrComponent_Impl(orb, poa, contId, instanceName, interfaceName);
     return mySyrComponent->getId() ;
@@ -387,9 +447,13 @@ CORBA::Long Syr_Impl::Initial() {
   sendMessage(NOTIF_STEP, "Syr_Impl::Initial is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   endService( " Syr_Impl::Initial"  );
   return _InitialInteger ;
 }
@@ -399,9 +463,13 @@ CORBA::Long Syr_Impl::Current() {
   sendMessage(NOTIF_STEP, "Syr_Impl::Current is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   endService( " Syr_Impl::Current"  );
   return _CurrentInteger ;
 }
@@ -412,9 +480,13 @@ CORBA::Long Syr_Impl::IsEven() {
   sendMessage(NOTIF_STEP, "Syr_Impl::IsEven is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   RetVal = ( _CurrentInteger & 1 ) == 0 ;
   MESSAGE( " Syr_Impl::IsEven " << _CurrentInteger << " " << RetVal );
   endService( " Syr_Impl::IsEven"  );
@@ -427,9 +499,13 @@ CORBA::Long Syr_Impl::IsOne() {
   sendMessage(NOTIF_STEP, "Syr_Impl::IsOne is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   RetVal = ( _CurrentInteger == 1 ) ;
   MESSAGE( " Syr_Impl::IsOne " << _CurrentInteger << " " << RetVal );
   endService( " Syr_Impl::IsOne"  );
@@ -441,9 +517,13 @@ CORBA::Long Syr_Impl::Count() {
   sendMessage(NOTIF_STEP, "Syr_Impl::Count is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   MESSAGE( " Syr_Impl::Count " << _Count );
   endService( " Syr_Impl::Count"  );
   return _Count ;
@@ -454,9 +534,13 @@ void Syr_Impl::M3p1() {
   sendMessage(NOTIF_STEP, "Syr_Impl::M3p1 is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   if ( IsEven() )
     _CurrentInteger = 0 ;
   else
@@ -470,9 +554,13 @@ void Syr_Impl::Div2() {
   sendMessage(NOTIF_STEP, "Syr_Impl::Div2 is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   if ( !IsEven() )
     _CurrentInteger = 0 ;
   else
@@ -486,9 +574,13 @@ void Syr_Impl::Incr() {
   sendMessage(NOTIF_STEP, "Syr_Impl::Incr is Computing");
 //  int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0));
   int S = 1 ;
+#ifndef WIN32
   while ( S ) {
-    S = sleep(S);
+    S = sleep( S ) ;
   }
+#else
+  Sleep(S*1000);
+#endif
   _Count = _Count + 1 ;
   MESSAGE( " Syr_Impl::Incr " << _Count );
   endService( " Syr_Impl::Incr"  );
index 35d94f3965f0f0d32a6eeb6e0bbec38808b7466d..fa48f76426d670038cfdb3fd625d39e1719eac34 100755 (executable)
 #ifndef _SYRCOMPONENT_IMPL_HXX_
 #define _SYRCOMPONENT_IMPL_HXX_
 
+#ifdef WIN32
+# if defined SYRCOMPONENTENGINE_EXPORTS || defined SyrComponentEngine_EXPORTS                                                   
+#  define SYRCOMPONENTENGINE_EXPORT __declspec( dllexport )
+# else
+#  define SYRCOMPONENTENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define SYRCOMPONENTENGINE_EXPORT
+#endif
+
 //#include <iostream.h>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SyrComponent)
 #include CORBA_SERVER_HEADER(SALOME_Component)
 #include "SALOME_Component_i.hxx"
 
-class SyrComponent_Impl :  public POA_SuperVisionTest::SyrComponent ,
-                           public Engines_Component_i {
+class SYRCOMPONENTENGINE_EXPORT SyrComponent_Impl : public POA_SuperVisionTest::SyrComponent,
+                                                      public Engines_Component_i {
 public:
   SyrComponent_Impl() ;
   SyrComponent_Impl( CORBA::ORB_ptr orb ,
@@ -85,8 +95,8 @@ private:
   long _Count ;
 };
 
-class ListOfSyr_Impl :  public POA_SuperVisionTest::ListOfSyr ,
-                        public Engines_Component_i {
+class SYRCOMPONENTENGINE_EXPORT ListOfSyr_Impl :  public POA_SuperVisionTest::ListOfSyr ,
+                                                   public Engines_Component_i {
 public:
   ListOfSyr_Impl( CORBA::ORB_ptr orb ,
                  PortableServer::POA_ptr poa ,
@@ -110,6 +120,7 @@ private:
 };
 
 extern "C"
+  SYRCOMPONENTENGINE_EXPORT
   PortableServer::ObjectId * SyrComponentEngine_factory
                                    ( CORBA::ORB_ptr orb ,
                                      PortableServer::POA_ptr poa , 
@@ -117,8 +128,8 @@ extern "C"
                                      const char *instanceName ,
                                      const char *interfaceName ) ;
 
-class Syr_Impl :  public POA_SuperVisionTest::Syr ,
-                  public SyrComponent_Impl {
+class SYRCOMPONENTENGINE_EXPORT Syr_Impl :  public POA_SuperVisionTest::SyrComponent ,
+                                             public SyrComponent_Impl {
 public:
   Syr_Impl() ;
   Syr_Impl( CORBA::ORB_ptr orb ,
index 47ee16f7e56ca1bd9f2016c589123dfdb274eed9..32831725bed936d364fff3b852af1df04fa35c61 100644 (file)
@@ -27,7 +27,9 @@
 //  $Header:
 //
 #include <iostream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <iostream>
 #include <fstream>
 #include <sstream>
index 9847ef995a1e0d912e9e6192da93c077b1cfe4d3..4e68df58e8f4d8c0d145d54250abb42ed07467f1 100644 (file)
 #ifndef _DYNINVOKE_
 #define _DYNINVOKE_
 
+#ifdef WIN32
+# if defined DYNINVOKE_EXPORTS || defined DynInvoke_EXPORTS
+#  define DYNINVOKE_EXPORT __declspec( dllexport )
+# else
+#  define DYNINVOKE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define DYNINVOKE_EXPORT
+#endif
+
 struct ServicesAnyData {
 
   std::string Name;
@@ -38,9 +48,9 @@ struct ServicesAnyData {
 // dynamic call for function with list of in parameters, followed 
 // by out parameters with no return value
 
-void DynInvoke(Engines::EngineComponent_ptr obj,
-              const char *method, 
-              ServicesAnyData * inParams, int nInParams,
-              ServicesAnyData * outParams, int nOutParams);
+void DYNINVOKE_EXPORT DynInvoke(Engines::EngineComponent_ptr obj,
+                            const char *method, 
+                            ServicesAnyData * inParams, int nInParams,
+                            ServicesAnyData * outParams, int nOutParams);
 
 #endif
index 3e03d6ce120cea6a0030aa68f1f266fe3e94fe51..d836bd927d058be0c9e79821b6ea0a86a640ba1a 100644 (file)
@@ -26,7 +26,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(AddComponent)
index e2a0f3dac86ff37d7fd7014dc75bdeb399424c37..e4492fd621ea46e3fdcc10b7461d8857231d08d4 100644 (file)
 //
 #include <iostream>
 #include <fstream>
+
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(AddComponent)
index f74fa635ad18c5fcf9f36c993d6231010fd320a0..73fc2d9c98989f6b16faf60ced8ea9cb14908825 100644 (file)
@@ -27,7 +27,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(AddComponent)
index f40ad4740ab38c175372c34bda2d1929fbd8a6b4..7e43760afbe400844d7602bae5e9f545b8ba6c37 100644 (file)
@@ -27,7 +27,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(AddComponent)
index 6020f5ad5be9889df58ca76dbb0543d57a237ce8..51c1859c0536e07b81843a67cb8a0e65879e624b 100644 (file)
@@ -27,7 +27,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(AddComponent)
index 56665fa42a619855149c71b02a299ae244c54bb0..c06f97bb74f804e3999795db56f86a439a61f2c0 100644 (file)
@@ -27,7 +27,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(AddComponent)
index 75c4425e765eb83121477d824b06a91aab4e2e92..890040c11a1848daa942ea062ed6c2454be081d6 100644 (file)
@@ -26,7 +26,9 @@
 //
 #include <iostream>
 #include <fstream>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include "TypesCheck_Impl.hxx"
 
index 7c505d7d298e041c6ab959812d55569682489e94..3ccd6ba9a3a77d7653d827d017c38da4bbb7be5f 100644 (file)
 //  Module : SuperVisionTest
 //
 #include <stdio.h>
+#ifndef WIN32
 #include <unistd.h>
+#else
+#include <process.h>
+#endif
 #include <fstream>
 #include <sstream>
 #include <string>
@@ -148,8 +152,14 @@ extern "C"
                                                        PortableServer::ObjectId * contId ,
                                                        const char *instanceName ,
                                                        const char *interfaceName ) {
+#ifndef WIN32
     MESSAGE("TypesCheckEngine_factory TypesCheckEngine ("
-            << instanceName << "," << interfaceName << "," << getpid() << ")");
+            << instanceName << "," << interfaceName << "," << getpid()<< ")");
+#else
+    MESSAGE("TypesCheckEngine_factory TypesCheckEngine ("
+            << instanceName << "," << interfaceName << "," << _getpid()<< ")");
+#endif
+            
     TypesCheck_Impl * myTypesCheck  = new TypesCheck_Impl(orb, poa, contId, instanceName, interfaceName);
     return myTypesCheck->getId() ;
   }
index 0d4ba70a611e65d29eba19dcb05dec01817f6dcd..935325a7731fd35f487135b854e040fe3d4c41c9 100644 (file)
 #ifndef _TYPESCHECK_IMPL_HXX_
 #define _TYPESCHECK_IMPL_HXX_
 
+#ifdef WIN32
+# if defined TYPESCHECKENGINE_EXPORTS || defined TypesCheckEngine_EXPORTS
+#  define TYPESCHECKENGINE_EXPORT __declspec( dllexport )
+# else
+#  define TYPESCHECKENGINE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define TYPESCHECKENGINE_EXPORT
+#endif
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(AddComponent)
 #include CORBA_SERVER_HEADER(TypesCheck)
@@ -37,8 +47,8 @@
 
 #include "AddComponent_Impl.hxx"
 
-class TypesCheck_Impl : public POA_SuperVisionTest::TypesCheck ,
-                        public Engines_Component_i {
+class TYPESCHECKENGINE_EXPORT TypesCheck_Impl : public POA_SuperVisionTest::TypesCheck ,
+                                                public Engines_Component_i {
   public:
     TypesCheck_Impl() ;
     TypesCheck_Impl( CORBA::ORB_ptr orb ,
@@ -78,6 +88,7 @@ class TypesCheck_Impl : public POA_SuperVisionTest::TypesCheck ,
 };
 
 extern "C"
+  TYPESCHECKENGINE_EXPORT
   PortableServer::ObjectId * TypesCheckEngine_factory ( CORBA::ORB_ptr orb ,
                                                         PortableServer::POA_ptr poa , 
                                                         PortableServer::ObjectId * contId ,