]> SALOME platform Git repositories - modules/kernel.git/blob - src/DSC/DSC_Basic/DSC_i.hxx
Salome HOME
Fix a long-standing problem with passing wrong values to the --standalone or --embedd...
[modules/kernel.git] / src / DSC / DSC_Basic / DSC_i.hxx
1 //  Copyright (C) 2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
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
60   virtual ~Engines_DSC_i();
61
62   /*!
63    * \see Engines::DSC::add_provides_port
64    */
65   virtual void add_provides_port(Ports::Port_ptr ref, 
66                                  const char* provides_port_name,
67                                  Ports::PortProperties_ptr port_prop) 
68     throw (Engines::DSC::PortAlreadyDefined,
69            Engines::DSC::NilPort,
70            Engines::DSC::BadProperty) {
71       Engines_DSC_interface::add_provides_port(ref, 
72                                                provides_port_name,
73                                                port_prop);
74     }
75
76   /*!
77    * \see Engines::DSC::add_uses_port
78    */
79   virtual void add_uses_port(const char* repository_id, 
80                              const char* uses_port_name,
81                              Ports::PortProperties_ptr port_prop)
82     throw (Engines::DSC::PortAlreadyDefined,
83            Engines::DSC::BadProperty) {
84       Engines_DSC_interface::add_uses_port(repository_id, 
85                                            uses_port_name,
86                                            port_prop);
87     }
88
89   /*!
90    * \see Engines::DSC::get_provides_port
91    */
92   virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
93                                             const CORBA::Boolean connection_error) 
94     throw (Engines::DSC::PortNotDefined,
95            Engines::DSC::PortNotConnected) {
96       return Engines_DSC_interface::get_provides_port(provides_port_name,
97                                                       connection_error);
98     }
99
100   /*!
101    * \see Engines::DSC::get_uses_port
102    */
103   virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
104     throw (Engines::DSC::PortNotDefined,
105            Engines::DSC::PortNotConnected) {
106       return Engines_DSC_interface::get_uses_port(uses_port_name);
107     }
108
109   /*!
110    * \see Engines::DSC::connect_provides_port
111    */
112   virtual void connect_provides_port(const char* provides_port_name)
113     throw (Engines::DSC::PortNotDefined) {
114       Engines_DSC_interface::connect_provides_port(provides_port_name);
115     }
116
117   /*!
118    * \see Engines::DSC::connect_uses_port
119    */
120   virtual void connect_uses_port(const char* uses_port_name,
121                                  Ports::Port_ptr provides_port_ref) 
122   throw (Engines::DSC::PortNotDefined,
123          Engines::DSC::BadPortType,
124          Engines::DSC::NilPort) {
125     Engines_DSC_interface::connect_uses_port(uses_port_name,
126                                              provides_port_ref);
127   }
128
129   /*!
130    * \see Engines::DSC::is_connected
131    */
132   virtual CORBA::Boolean is_connected(const char* port_name)
133     throw (Engines::DSC::PortNotDefined) {
134       return Engines_DSC_interface::is_connected(port_name);
135     }
136
137    /*!
138    * \see Engines::DSC::disconnect_provides_port
139    */
140   virtual void disconnect_provides_port(const char* provides_port_name,
141                                         const Engines::DSC::Message message)
142     throw (Engines::DSC::PortNotDefined,
143            Engines::DSC::PortNotConnected) {
144       Engines_DSC_interface::disconnect_provides_port(provides_port_name,
145                                                       message);
146     }
147
148    /*!
149    * \see Engines::DSC::disconnect_uses_port
150    */
151   virtual void disconnect_uses_port(const char* uses_port_name,
152                                     Ports::Port_ptr provides_port_ref,
153                                     const Engines::DSC::Message message)
154     throw (Engines::DSC::PortNotDefined,
155            Engines::DSC::PortNotConnected,
156            Engines::DSC::BadPortReference) {
157       Engines_DSC_interface::disconnect_uses_port(uses_port_name,
158                                                   provides_port_ref,
159                                                   message);
160     }
161
162   /*!
163    * \see Engines::DSC::get_port_properties
164    */
165   virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
166     throw (Engines::DSC::PortNotDefined) {
167       return Engines_DSC_interface::get_port_properties(port_name);
168     }
169 };
170
171 #endif