Salome HOME
0023366: [CEA 1972] Porting Salome to GCC 6
[modules/kernel.git] / src / Container / SALOME_Component_i.hxx
index ccf8ddff2c6adfc882b9d012c8d40ad5c49cab0f..4315da8b38b6e954f96adc1509b8e134b21bbac6 100644 (file)
@@ -1,30 +1,31 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
+// 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 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, or (at your option) any later version.
 //
-//  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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME Container : implementation of container and engine for Kernel
 //  File   : SALOME_Component_i.hxx
 //  Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef _SALOME_COMPONENT_I_HXX_
 #define _SALOME_COMPONENT_I_HXX_
 
 class RegistryConnexion;
 class Engines_Container_i;
 
-class CONTAINER_EXPORT Engines_Component_i: 
-  public virtual POA_Engines::Component,
+class CONTAINER_EXPORT Engines_Component_i:
+  public virtual POA_Engines::EngineComponent,
   public virtual PortableServer::ServantBase
 {
 public:
   Engines_Component_i();
   Engines_Component_i(CORBA::ORB_ptr orb,
-                     PortableServer::POA_ptr poa,
-                     PortableServer::ObjectId * contId, 
-                     const char *instanceName, 
-                     const char *interfaceName,
-                      bool notif = false);
+                      PortableServer::POA_ptr poa,
+                      PortableServer::ObjectId * contId,
+                      const char *instanceName,
+                      const char *interfaceName,
+                      bool notif = false,
+                      bool regist = true);
   //Constructor for standalone component
   Engines_Component_i(CORBA::ORB_ptr orb,
-                     PortableServer::POA_ptr poa,
-                     Engines::Container_ptr container, 
-                     const char *instanceName, 
-                     const char *interfaceName,
+                      PortableServer::POA_ptr poa,
+                      Engines::Container_ptr container,
+                      const char *instanceName,
+                      const char *interfaceName,
                       bool notif = false,
-                      bool regist=true);
-  // Constructor for parallel component : don't call registry
-  Engines_Component_i(CORBA::ORB_ptr orb,
-                     PortableServer::POA_ptr poa,
-                     PortableServer::ObjectId * contId, 
-                     const char *instanceName, 
-                     const char *interfaceName,
-                     int flag,
-                      bool notif = false);
+                      bool regist = true);
 
   virtual ~Engines_Component_i();
 
@@ -93,41 +87,50 @@ public:
   void setProperties(const Engines::FieldsDict& dico);
   Engines::FieldsDict* getProperties();
 
-  void Names( const char * graphName , const char * nodeName ) ;
+  virtual void  SetOption(const char*, const char*);
+  virtual char* GetOption(const char*);
+
+        void Names( const char * graphName , const char * nodeName ) ;
   bool Kill_impl();
   bool Stop_impl();
   bool Suspend_impl();
   bool Resume_impl();
   CORBA::Long CpuUsed_impl() ;
 
- virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
-                                     CORBA::Boolean isPublished,
-                                     CORBA::Boolean& isValidScript);
+  virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
+                                       CORBA::Boolean isPublished,
+                                       CORBA::Boolean isMultiFile,
+                                       CORBA::Boolean& isValidScript);
 
- // CORBA operations for Salome_file
- virtual Engines::Salome_file_ptr getInputFileToService(const char* service_name, 
-                                                       const char* Salome_file_name);
- virtual Engines::Salome_file_ptr getOutputFileToService(const char* service_name, 
-                                                             const char* Salome_file_name);
 // CORBA operations for Salome_file
+  virtual Engines::Salome_file_ptr getInputFileToService(const char* service_name,
+                                                         const char* Salome_file_name);
+  virtual Engines::Salome_file_ptr getOutputFileToService(const char* service_name,
+                                                          const char* Salome_file_name);
 
- virtual void checkInputFilesToService(const char* service_name);
- virtual Engines::Salome_file_ptr setInputFileToService(const char* service_name, 
-                                                       const char* Salome_file_name);
 virtual void checkInputFilesToService(const char* service_name);
+  virtual Engines::Salome_file_ptr setInputFileToService(const char* service_name,
+                                                         const char* Salome_file_name);
 
- virtual void checkOutputFilesToService(const char* service_name);
- virtual Engines::Salome_file_ptr setOutputFileToService(const char* service_name, 
-                                                        const char* Salome_file_name);
 virtual void checkOutputFilesToService(const char* service_name);
+  virtual Engines::Salome_file_ptr setOutputFileToService(const char* service_name,
+                                                          const char* Salome_file_name);
 
   // Object information
   virtual bool hasObjectInfo() { return false; }
-  virtual char* getObjectInfo(CORBA::Long studyId, const char* entry) { return ""; }
-  
+  virtual char* getObjectInfo(CORBA::Long studyId, const char* entry) { return CORBA::string_dup(""); }
+
+  // Version information
+  virtual char* getVersion();
+
   // --- local C++ methods
 
-  PortableServer::ObjectId * getId(); 
+  PortableServer::ObjectId * getId();
   Engines_Container_i *GetContainerPtr();
+  std::string getContainerName();
+  void setContainerName();
 
-  bool setStudyId(CORBA::Long studyId);
+  virtual bool setStudyId(CORBA::Long studyId);
   static bool isMultiStudy();
   static bool isMultiInstance();
   static std::string GetDynLibraryName(const char *componentName);
@@ -143,9 +146,8 @@ public:
   void CancelThread() ;
 
   virtual void configureSalome_file(std::string service_name,
-                                   std::string file_port_name,
-                                   Salome_file_i * file);
-
+                                    std::string file_port_name,
+                                    Salome_file_i * file);
 
 protected:
   int _studyId; // -1: not initialised; 0: multiStudy; >0: study
@@ -154,6 +156,7 @@ protected:
 
   std::string _instanceName ;
   std::string _interfaceName ;
+  std::string _containerName ;
 
   CORBA::ORB_var _orb;
   PortableServer::POA_var _poa;
@@ -169,7 +172,7 @@ protected:
   typedef std::map<std::string, Salome_file_i*> _t_Salome_file_map;
   // Map Service_name to  _Salome_file_map
   typedef std::map<std::string, Engines_Component_i::_t_Salome_file_map*> _t_Service_file_map;
-  
+
   _t_Service_file_map _Input_Service_file_map;
   _t_Service_file_map _Output_Service_file_map;
   _t_Service_file_map::iterator _Service_file_map_it;