Salome HOME
Revert "Synchronize adm files"
[modules/kernel.git] / src / DSC / ParallelDSC / ParallelDSC_i.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  File   : ParallelDSC_i.hxx
21 //  Author : AndrĂ© RIBES (EDF)
22 //  Module : KERNEL
23 //
24 #ifndef _PARALLEL_DSC_COMPONENT_I_HXX_
25 #define _PARALLEL_DSC_COMPONENT_I_HXX_
26
27 #include <iostream>
28 #include <map>
29
30 #include "DSC_interface.hxx"
31 #include "SALOME_ParallelComponent_i.hxx"
32
33 #include "SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.hxx"
34 #include "SALOME_PortsPaCO.hxx"
35
36 class Engines_ParallelDSC_i: 
37   public virtual Engines_Parallel_Component_i,
38   public virtual Engines::Parallel_DSC_serv,
39   public virtual Engines_DSC_interface 
40 {
41 public:
42   Engines_ParallelDSC_i(CORBA::ORB_ptr orb, 
43                         char * ior,
44                         int rank,
45                         PortableServer::POA_ptr poa,
46                         PortableServer::ObjectId * contId,
47                         const char *instanceName,
48                         const char *interfaceName,
49                         bool notif = false);
50
51   virtual ~Engines_ParallelDSC_i();
52
53   
54   /*!
55    * \see Engines::DSC::add_provides_port
56    */
57   virtual void add_provides_port(Ports::Port_ptr ref, 
58                                  const char* provides_port_name,
59                                  Ports::PortProperties_ptr port_prop) 
60     throw (Engines::DSC::PortAlreadyDefined,
61            Engines::DSC::NilPort,
62            Engines::DSC::BadProperty) {
63       Engines_DSC_interface::add_provides_port(ref, 
64                                                provides_port_name,
65                                                port_prop);
66     }
67
68   /*!
69    * \see Engines::DSC::add_uses_port
70    */
71   virtual void add_uses_port(const char* repository_id, 
72                              const char* uses_port_name,
73                              Ports::PortProperties_ptr port_prop)
74     throw (Engines::DSC::PortAlreadyDefined,
75            Engines::DSC::BadProperty) {
76       Engines_DSC_interface::add_uses_port(repository_id, 
77                                            uses_port_name,
78                                            port_prop);
79     }
80
81   /*!
82    * \see Engines::DSC::get_provides_port
83    */
84   virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
85                                             const CORBA::Boolean connection_error) 
86     throw (Engines::DSC::PortNotDefined,
87            Engines::DSC::PortNotConnected) {
88       return Engines_DSC_interface::get_provides_port(provides_port_name,
89                                                       connection_error);
90     }
91
92   /*!
93    * \see Engines::DSC::get_uses_port
94    */
95   virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
96     throw (Engines::DSC::PortNotDefined,
97            Engines::DSC::PortNotConnected) {
98       return Engines_DSC_interface::get_uses_port(uses_port_name);
99     }
100
101   /*!
102    * \see Engines::DSC::connect_provides_port
103    */
104   virtual void connect_provides_port(const char* provides_port_name)
105     throw (Engines::DSC::PortNotDefined) {
106       Engines_DSC_interface::connect_provides_port(provides_port_name);
107     }
108
109   /*!
110    * \see Engines::DSC::connect_uses_port
111    */
112   virtual void connect_uses_port(const char* uses_port_name,
113                                  Ports::Port_ptr provides_port_ref) 
114   throw (Engines::DSC::PortNotDefined,
115          Engines::DSC::BadPortType,
116          Engines::DSC::NilPort) {
117     Engines_DSC_interface::connect_uses_port(uses_port_name,
118                                              provides_port_ref);
119   }
120
121   /*!
122    * \see Engines::DSC::is_connected
123    */
124   virtual CORBA::Boolean is_connected(const char* port_name)
125     throw (Engines::DSC::PortNotDefined) {
126       return Engines_DSC_interface::is_connected(port_name);
127     }
128
129    /*!
130    * \see Engines::DSC::disconnect_provides_port
131    */
132   virtual void disconnect_provides_port(const char* provides_port_name,
133                                         const Engines::DSC::Message message)
134     throw (Engines::DSC::PortNotDefined,
135            Engines::DSC::PortNotConnected) {
136       Engines_DSC_interface::disconnect_provides_port(provides_port_name,
137                                                       message);
138     }
139
140    /*!
141    * \see Engines::DSC::disconnect_uses_port
142    */
143   virtual void disconnect_uses_port(const char* uses_port_name,
144                                     Ports::Port_ptr provides_port_ref,
145                                     const Engines::DSC::Message message)
146     throw (Engines::DSC::PortNotDefined,
147            Engines::DSC::PortNotConnected,
148            Engines::DSC::BadPortReference) {
149       Engines_DSC_interface::disconnect_uses_port(uses_port_name,
150                                                   provides_port_ref,
151                                                   message);
152     }
153
154   virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
155     throw (Engines::DSC::PortNotDefined) {
156       return Engines_DSC_interface::get_port_properties(port_name);
157     }
158   
159   /*!
160    * This method is used to register the proxy of the parallel port into
161    * all the nodes of the parallel component.
162    * 
163    * \param ref CORBA proxy reference.
164    * \param provides_port_name provides port associated with the proxy.
165    * \param port_prop port properties.
166    */
167   virtual void set_paco_proxy(CORBA::Object_ptr ref, 
168                               const char* provides_port_name,
169                               Ports::PortProperties_ptr port_prop);
170
171   /*! 
172    * This method is used by the node that want to add the parallel proxy port.
173    *
174    * \param ref CORBA proxy reference.
175    * \param provides_port_name provides port associated with the proxy.
176    *
177    * \return true if the proxy is correctly added.
178    */
179   virtual CORBA::Boolean add_parallel_provides_proxy_port(const CORBA::Object_ptr ref, 
180                                                           const char * provides_port_name,
181                                                           Ports::PortProperties_ptr port_prop);
182
183   /*! 
184    * This method by the nodes that do not add the proxy to wait is reference.
185    *
186    * \param provides_port_name provides port associated with the proxy.
187    *
188    * \return true if the proxy is correctly added.
189    */
190   virtual CORBA::Boolean add_parallel_provides_proxy_wait(const char * provides_port_name);
191
192   /*!
193    * Permits to add a parallel node of a parallel provides port.
194    *
195    * \param ref CORBA node reference.
196    * \param provides_port_name provides port associated with the node.
197    *
198    * \return true if the node is correctly added.
199    */
200   virtual CORBA::Boolean add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref, 
201                                                          const char* provides_port_name);
202
203   /*!
204    * Used to get the proxy of the parallel port.
205    *
206    * \param provides_port_name name of the parallel provides port.
207    *
208    * \return IOR of the proxy.
209    */
210   virtual const char * get_proxy(const char* provides_port_name);
211
212 };
213
214 #endif