Back to index

salome-kernel  6.5.0
DSC_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 
00023 //  File   : DSC_i.hxx
00024 //  Author : André RIBES (EDF)
00025 //  Module : KERNEL
00026 //
00027 #ifndef _DSC_I_HXX_
00028 #define _DSC_I_HXX_
00029 
00030 #include "DSC_Basic.hxx"
00031 
00032 #include <iostream>
00033 #include <map>
00034 #include <string.h>
00035 #include <assert.h>
00036 
00037 #include "SALOME_Component_i.hxx"
00038 #include "DSC_interface.hxx"
00039 
00045 class DSC_BASIC_EXPORT Engines_DSC_i: 
00046   public Engines_Component_i, // keyword virtual is not use to be able to
00047                               // call the right Engines_Component_i constructor.
00048                               // If virtual is used, a derived class of Engines_DSC_i
00049                               // will have to call the right Engines_Component_i constructor.
00050   public virtual POA_Engines::DSC,
00051   public Engines_DSC_interface
00052 {
00053 public:
00054   Engines_DSC_i(CORBA::ORB_ptr orb,
00055                           PortableServer::POA_ptr poa,
00056                           PortableServer::ObjectId * contId,
00057                           const char *instanceName,
00058                           const char *interfaceName,
00059                           bool notif = false);
00060   Engines_DSC_i(CORBA::ORB_ptr orb,
00061                           PortableServer::POA_ptr poa,
00062                           Engines::Container_ptr container, 
00063                           const char *instanceName,
00064                           const char *interfaceName,
00065         bool notif = false,
00066         bool regist = true );
00067 
00068   virtual ~Engines_DSC_i();
00069 
00073   virtual void add_provides_port(Ports::Port_ptr ref, 
00074                                  const char* provides_port_name,
00075                                  Ports::PortProperties_ptr port_prop) 
00076     throw (Engines::DSC::PortAlreadyDefined,
00077            Engines::DSC::NilPort,
00078            Engines::DSC::BadProperty) {
00079       Engines_DSC_interface::add_provides_port(ref, 
00080                                                provides_port_name,
00081                                                port_prop);
00082     }
00083 
00087   virtual void add_uses_port(const char* repository_id, 
00088                              const char* uses_port_name,
00089                              Ports::PortProperties_ptr port_prop)
00090     throw (Engines::DSC::PortAlreadyDefined,
00091            Engines::DSC::BadProperty) {
00092       Engines_DSC_interface::add_uses_port(repository_id, 
00093                                            uses_port_name,
00094                                            port_prop);
00095     }
00096 
00100   virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
00101                                             const CORBA::Boolean connection_error) 
00102     throw (Engines::DSC::PortNotDefined,
00103            Engines::DSC::PortNotConnected) {
00104       return Engines_DSC_interface::get_provides_port(provides_port_name,
00105                                                       connection_error);
00106     }
00107 
00111   virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
00112     throw (Engines::DSC::PortNotDefined,
00113            Engines::DSC::PortNotConnected) {
00114       return Engines_DSC_interface::get_uses_port(uses_port_name);
00115     }
00116 
00120   virtual void connect_provides_port(const char* provides_port_name)
00121     throw (Engines::DSC::PortNotDefined) {
00122       Engines_DSC_interface::connect_provides_port(provides_port_name);
00123     }
00124 
00128   virtual void connect_uses_port(const char* uses_port_name,
00129                                  Ports::Port_ptr provides_port_ref) 
00130   throw (Engines::DSC::PortNotDefined,
00131          Engines::DSC::BadPortType,
00132          Engines::DSC::NilPort) {
00133     Engines_DSC_interface::connect_uses_port(uses_port_name,
00134                                              provides_port_ref);
00135   }
00136 
00140   virtual CORBA::Boolean is_connected(const char* port_name)
00141     throw (Engines::DSC::PortNotDefined) {
00142       return Engines_DSC_interface::is_connected(port_name);
00143     }
00144 
00148   virtual void disconnect_provides_port(const char* provides_port_name,
00149                                         const Engines::DSC::Message message)
00150     throw (Engines::DSC::PortNotDefined,
00151            Engines::DSC::PortNotConnected) {
00152       Engines_DSC_interface::disconnect_provides_port(provides_port_name,
00153                                                       message);
00154     }
00155 
00159   virtual void disconnect_uses_port(const char* uses_port_name,
00160                                     Ports::Port_ptr provides_port_ref,
00161                                     const Engines::DSC::Message message)
00162     throw (Engines::DSC::PortNotDefined,
00163            Engines::DSC::PortNotConnected,
00164            Engines::DSC::BadPortReference) {
00165       Engines_DSC_interface::disconnect_uses_port(uses_port_name,
00166                                                   provides_port_ref,
00167                                                   message);
00168     }
00169 
00173   virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
00174     throw (Engines::DSC::PortNotDefined) {
00175       return Engines_DSC_interface::get_port_properties(port_name);
00176     }
00177 };
00178 
00179 #endif