1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : ParallelDSC_i.hxx
23 // Author : André RIBES (EDF)
26 #ifndef _PARALLEL_DSC_COMPONENT_I_HXX_
27 #define _PARALLEL_DSC_COMPONENT_I_HXX_
32 #include "DSC_interface.hxx"
33 #include "SALOME_ParallelComponent_i.hxx"
35 #include "SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.hxx"
36 #include "SALOME_PortsPaCO.hxx"
38 class Engines_ParallelDSC_i:
39 public virtual Engines_Parallel_Component_i,
40 public virtual Engines::Parallel_DSC_serv,
41 public virtual Engines_DSC_interface
44 Engines_ParallelDSC_i(CORBA::ORB_ptr orb,
47 PortableServer::POA_ptr poa,
48 PortableServer::ObjectId * contId,
49 const char *instanceName,
50 const char *interfaceName,
53 virtual ~Engines_ParallelDSC_i();
57 * \see Engines::DSC::add_provides_port
59 virtual void add_provides_port(Ports::Port_ptr ref,
60 const char* provides_port_name,
61 Ports::PortProperties_ptr port_prop)
62 throw (Engines::DSC::PortAlreadyDefined,
63 Engines::DSC::NilPort,
64 Engines::DSC::BadProperty) {
65 Engines_DSC_interface::add_provides_port(ref,
71 * \see Engines::DSC::add_uses_port
73 virtual void add_uses_port(const char* repository_id,
74 const char* uses_port_name,
75 Ports::PortProperties_ptr port_prop)
76 throw (Engines::DSC::PortAlreadyDefined,
77 Engines::DSC::BadProperty) {
78 Engines_DSC_interface::add_uses_port(repository_id,
84 * \see Engines::DSC::get_provides_port
86 virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
87 const CORBA::Boolean connection_error)
88 throw (Engines::DSC::PortNotDefined,
89 Engines::DSC::PortNotConnected) {
90 return Engines_DSC_interface::get_provides_port(provides_port_name,
95 * \see Engines::DSC::get_uses_port
97 virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
98 throw (Engines::DSC::PortNotDefined,
99 Engines::DSC::PortNotConnected) {
100 return Engines_DSC_interface::get_uses_port(uses_port_name);
104 * \see Engines::DSC::connect_provides_port
106 virtual void connect_provides_port(const char* provides_port_name)
107 throw (Engines::DSC::PortNotDefined) {
108 Engines_DSC_interface::connect_provides_port(provides_port_name);
112 * \see Engines::DSC::connect_uses_port
114 virtual void connect_uses_port(const char* uses_port_name,
115 Ports::Port_ptr provides_port_ref)
116 throw (Engines::DSC::PortNotDefined,
117 Engines::DSC::BadPortType,
118 Engines::DSC::NilPort) {
119 Engines_DSC_interface::connect_uses_port(uses_port_name,
124 * \see Engines::DSC::is_connected
126 virtual CORBA::Boolean is_connected(const char* port_name)
127 throw (Engines::DSC::PortNotDefined) {
128 return Engines_DSC_interface::is_connected(port_name);
132 * \see Engines::DSC::disconnect_provides_port
134 virtual void disconnect_provides_port(const char* provides_port_name,
135 const Engines::DSC::Message message)
136 throw (Engines::DSC::PortNotDefined,
137 Engines::DSC::PortNotConnected) {
138 Engines_DSC_interface::disconnect_provides_port(provides_port_name,
143 * \see Engines::DSC::disconnect_uses_port
145 virtual void disconnect_uses_port(const char* uses_port_name,
146 Ports::Port_ptr provides_port_ref,
147 const Engines::DSC::Message message)
148 throw (Engines::DSC::PortNotDefined,
149 Engines::DSC::PortNotConnected,
150 Engines::DSC::BadPortReference) {
151 Engines_DSC_interface::disconnect_uses_port(uses_port_name,
156 virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
157 throw (Engines::DSC::PortNotDefined) {
158 return Engines_DSC_interface::get_port_properties(port_name);
162 * This method is used to register the proxy of the parallel port into
163 * all the nodes of the parallel component.
165 * \param ref CORBA proxy reference.
166 * \param provides_port_name provides port associated with the proxy.
167 * \param port_prop port properties.
169 virtual void set_paco_proxy(CORBA::Object_ptr ref,
170 const char* provides_port_name,
171 Ports::PortProperties_ptr port_prop);
174 * This method is used by the node that want to add the parallel proxy port.
176 * \param ref CORBA proxy reference.
177 * \param provides_port_name provides port associated with the proxy.
179 * \return true if the proxy is correctly added.
181 virtual CORBA::Boolean add_parallel_provides_proxy_port(const CORBA::Object_ptr ref,
182 const char * provides_port_name,
183 Ports::PortProperties_ptr port_prop);
186 * This method by the nodes that do not add the proxy to wait is reference.
188 * \param provides_port_name provides port associated with the proxy.
190 * \return true if the proxy is correctly added.
192 virtual CORBA::Boolean add_parallel_provides_proxy_wait(const char * provides_port_name);
195 * Permits to add a parallel node of a parallel provides port.
197 * \param ref CORBA node reference.
198 * \param provides_port_name provides port associated with the node.
200 * \return true if the node is correctly added.
202 virtual CORBA::Boolean add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref,
203 const char* provides_port_name);
206 * Used to get the proxy of the parallel port.
208 * \param provides_port_name name of the parallel provides port.
210 * \return IOR of the proxy.
212 virtual const char * get_proxy(const char* provides_port_name);