SALOME documentation central

src/DSC/ParallelDSC/ParallelDSC_i.hxx

00001 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 //  This library is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU Lesser General Public
00008 //  License as published by the Free Software Foundation; either
00009 //  version 2.1 of the License.
00010 //
00011 //  This library is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 //  Lesser General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU Lesser General Public
00017 //  License along with this library; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  File   : ParallelDSC_i.hxx
00023 //  Author : André RIBES (EDF)
00024 //  Module : KERNEL
00025 //
00026 #ifndef _PARALLEL_DSC_COMPONENT_I_HXX_
00027 #define _PARALLEL_DSC_COMPONENT_I_HXX_
00028 
00029 #include <iostream>
00030 #include <map>
00031 
00032 #include "DSC_interface.hxx"
00033 #include "SALOME_ParallelComponent_i.hxx"
00034 
00035 #include "SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.hxx"
00036 #include "SALOME_PortsPaCO.hxx"
00037 
00038 class Engines_ParallelDSC_i: 
00039   public virtual Engines_Parallel_Component_i,
00040   public virtual Engines::Parallel_DSC_serv,
00041   public virtual Engines_DSC_interface 
00042 {
00043 public:
00044   Engines_ParallelDSC_i(CORBA::ORB_ptr orb, 
00045                char * ior,
00046                int rank,
00047                PortableServer::POA_ptr poa,
00048                PortableServer::ObjectId * contId,
00049                const char *instanceName,
00050                const char *interfaceName,
00051                bool notif = false);
00052 
00053   virtual ~Engines_ParallelDSC_i();
00054 
00055   
00059   virtual void add_provides_port(Ports::Port_ptr ref, 
00060                      const char* provides_port_name,
00061                      Ports::PortProperties_ptr port_prop) 
00062     throw (Engines::DSC::PortAlreadyDefined,
00063         Engines::DSC::NilPort,
00064         Engines::DSC::BadProperty) {
00065       Engines_DSC_interface::add_provides_port(ref, 
00066                                 provides_port_name,
00067                                 port_prop);
00068     }
00069 
00073   virtual void add_uses_port(const char* repository_id, 
00074                     const char* uses_port_name,
00075                     Ports::PortProperties_ptr port_prop)
00076     throw (Engines::DSC::PortAlreadyDefined,
00077         Engines::DSC::BadProperty) {
00078       Engines_DSC_interface::add_uses_port(repository_id, 
00079                             uses_port_name,
00080                             port_prop);
00081     }
00082 
00086   virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
00087                              const CORBA::Boolean connection_error) 
00088     throw (Engines::DSC::PortNotDefined,
00089         Engines::DSC::PortNotConnected) {
00090       return Engines_DSC_interface::get_provides_port(provides_port_name,
00091                                     connection_error);
00092     }
00093 
00097   virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
00098     throw (Engines::DSC::PortNotDefined,
00099         Engines::DSC::PortNotConnected) {
00100       return Engines_DSC_interface::get_uses_port(uses_port_name);
00101     }
00102 
00106   virtual void connect_provides_port(const char* provides_port_name)
00107     throw (Engines::DSC::PortNotDefined) {
00108       Engines_DSC_interface::connect_provides_port(provides_port_name);
00109     }
00110 
00114   virtual void connect_uses_port(const char* uses_port_name,
00115                      Ports::Port_ptr provides_port_ref) 
00116   throw (Engines::DSC::PortNotDefined,
00117       Engines::DSC::BadPortType,
00118       Engines::DSC::NilPort) {
00119     Engines_DSC_interface::connect_uses_port(uses_port_name,
00120                               provides_port_ref);
00121   }
00122 
00126   virtual CORBA::Boolean is_connected(const char* port_name)
00127     throw (Engines::DSC::PortNotDefined) {
00128       return Engines_DSC_interface::is_connected(port_name);
00129     }
00130 
00134   virtual void disconnect_provides_port(const char* provides_port_name,
00135                          const Engines::DSC::Message message)
00136     throw (Engines::DSC::PortNotDefined,
00137         Engines::DSC::PortNotConnected) {
00138       Engines_DSC_interface::disconnect_provides_port(provides_port_name,
00139                                     message);
00140     }
00141 
00145   virtual void disconnect_uses_port(const char* uses_port_name,
00146                         Ports::Port_ptr provides_port_ref,
00147                         const Engines::DSC::Message message)
00148     throw (Engines::DSC::PortNotDefined,
00149         Engines::DSC::PortNotConnected,
00150         Engines::DSC::BadPortReference) {
00151       Engines_DSC_interface::disconnect_uses_port(uses_port_name,
00152                                 provides_port_ref,
00153                                 message);
00154     }
00155 
00156   virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
00157     throw (Engines::DSC::PortNotDefined) {
00158       return Engines_DSC_interface::get_port_properties(port_name);
00159     }
00160   
00169   virtual void set_paco_proxy(CORBA::Object_ptr ref, 
00170                      const char* provides_port_name,
00171                      Ports::PortProperties_ptr port_prop);
00172 
00181   virtual CORBA::Boolean add_parallel_provides_proxy_port(const CORBA::Object_ptr ref, 
00182                                      const char * provides_port_name,
00183                                      Ports::PortProperties_ptr port_prop);
00184 
00192   virtual CORBA::Boolean add_parallel_provides_proxy_wait(const char * provides_port_name);
00193 
00202   virtual CORBA::Boolean add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref, 
00203                                     const char* provides_port_name);
00204 
00212   virtual const char * get_proxy(const char* provides_port_name);
00213 
00214 };
00215 
00216 #endif