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