Salome HOME
Merge branch 'omu/multijob'
[modules/kernel.git] / src / DSC / DSC_Basic / DSC_i.hxx
1 // Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : DSC_i.hxx
24 //  Author : AndrĂ© RIBES (EDF)
25 //  Module : KERNEL
26 //
27 #ifndef _DSC_I_HXX_
28 #define _DSC_I_HXX_
29
30 #include "DSC_Basic.hxx"
31
32 #include <iostream>
33 #include <map>
34 #include <string.h>
35 #include <assert.h>
36
37 #include "SALOME_Component_i.hxx"
38 #include "DSC_interface.hxx"
39
40 /*! \class Engines_DSC_i
41  *  \brief This class implements the interface Engines::DSC
42  *
43  *  The implementation of methods are performed by the class Engines_DSC_interface.
44  */
45 class DSC_BASIC_EXPORT Engines_DSC_i: 
46   public Engines_Component_i, // keyword virtual is not use to be able to
47                               // call the right Engines_Component_i constructor.
48                               // If virtual is used, a derived class of Engines_DSC_i
49                               // will have to call the right Engines_Component_i constructor.
50   public virtual POA_Engines::DSC,
51   public Engines_DSC_interface
52 {
53 public:
54   Engines_DSC_i(CORBA::ORB_ptr orb,
55                           PortableServer::POA_ptr poa,
56                           PortableServer::ObjectId * contId,
57                           const char *instanceName,
58                           const char *interfaceName,
59                           bool notif = false);
60   Engines_DSC_i(CORBA::ORB_ptr orb,
61                           PortableServer::POA_ptr poa,
62                           Engines::Container_ptr container, 
63                           const char *instanceName,
64                           const char *interfaceName,
65         bool notif = false,
66         bool regist = true );
67
68   virtual ~Engines_DSC_i();
69
70   /*!
71    * \see Engines::DSC::add_provides_port
72    */
73   virtual void add_provides_port(Ports::Port_ptr ref, 
74                                  const char* provides_port_name,
75                                  Ports::PortProperties_ptr port_prop) 
76     throw (Engines::DSC::PortAlreadyDefined,
77            Engines::DSC::NilPort,
78            Engines::DSC::BadProperty) {
79       Engines_DSC_interface::add_provides_port(ref, 
80                                                provides_port_name,
81                                                port_prop);
82     }
83
84   /*!
85    * \see Engines::DSC::add_uses_port
86    */
87   virtual void add_uses_port(const char* repository_id, 
88                              const char* uses_port_name,
89                              Ports::PortProperties_ptr port_prop)
90     throw (Engines::DSC::PortAlreadyDefined,
91            Engines::DSC::BadProperty) {
92       Engines_DSC_interface::add_uses_port(repository_id, 
93                                            uses_port_name,
94                                            port_prop);
95     }
96
97   /*!
98    * \see Engines::DSC::get_provides_port
99    */
100   virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
101                                             const CORBA::Boolean connection_error) 
102     throw (Engines::DSC::PortNotDefined,
103            Engines::DSC::PortNotConnected) {
104       return Engines_DSC_interface::get_provides_port(provides_port_name,
105                                                       connection_error);
106     }
107
108   /*!
109    * \see Engines::DSC::get_uses_port
110    */
111   virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
112     throw (Engines::DSC::PortNotDefined,
113            Engines::DSC::PortNotConnected) {
114       return Engines_DSC_interface::get_uses_port(uses_port_name);
115     }
116
117   /*!
118    * \see Engines::DSC::connect_provides_port
119    */
120   virtual void connect_provides_port(const char* provides_port_name)
121     throw (Engines::DSC::PortNotDefined) {
122       Engines_DSC_interface::connect_provides_port(provides_port_name);
123     }
124
125   /*!
126    * \see Engines::DSC::connect_uses_port
127    */
128   virtual void connect_uses_port(const char* uses_port_name,
129                                  Ports::Port_ptr provides_port_ref) 
130   throw (Engines::DSC::PortNotDefined,
131          Engines::DSC::BadPortType,
132          Engines::DSC::NilPort) {
133     Engines_DSC_interface::connect_uses_port(uses_port_name,
134                                              provides_port_ref);
135   }
136
137   /*!
138    * \see Engines::DSC::is_connected
139    */
140   virtual CORBA::Boolean is_connected(const char* port_name)
141     throw (Engines::DSC::PortNotDefined) {
142       return Engines_DSC_interface::is_connected(port_name);
143     }
144
145    /*!
146    * \see Engines::DSC::disconnect_provides_port
147    */
148   virtual void disconnect_provides_port(const char* provides_port_name,
149                                         const Engines::DSC::Message message)
150     throw (Engines::DSC::PortNotDefined,
151            Engines::DSC::PortNotConnected) {
152       Engines_DSC_interface::disconnect_provides_port(provides_port_name,
153                                                       message);
154     }
155
156    /*!
157    * \see Engines::DSC::disconnect_uses_port
158    */
159   virtual void disconnect_uses_port(const char* uses_port_name,
160                                     Ports::Port_ptr provides_port_ref,
161                                     const Engines::DSC::Message message)
162     throw (Engines::DSC::PortNotDefined,
163            Engines::DSC::PortNotConnected,
164            Engines::DSC::BadPortReference) {
165       Engines_DSC_interface::disconnect_uses_port(uses_port_name,
166                                                   provides_port_ref,
167                                                   message);
168     }
169
170   /*!
171    * \see Engines::DSC::get_port_properties
172    */
173   virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
174     throw (Engines::DSC::PortNotDefined) {
175       return Engines_DSC_interface::get_port_properties(port_name);
176     }
177 };
178
179 #endif