1 // Copyright (C) 2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : DSC_interface.hxx
23 // Author : André RIBES (EDF)
26 #ifndef _DSC_INTERFACE_HXX_
27 #define _DSC_INTERFACE_HXX_
34 #include "DSC_Callbacks.hxx"
36 /*! \class Engines_DSC_interface
37 * \brief This class implements the interface Engines::DSC
39 * This class is used by the sequential DSC implementation
40 * and the parallel DSC implementation.
42 class Engines_DSC_interface:
46 Engines_DSC_interface();
47 virtual ~Engines_DSC_interface();
50 * \see Engines::DSC::add_provides_port
52 virtual void add_provides_port(Ports::Port_ptr ref,
53 const char* provides_port_name,
54 Ports::PortProperties_ptr port_prop)
55 throw (Engines::DSC::PortAlreadyDefined,
56 Engines::DSC::NilPort,
57 Engines::DSC::BadProperty);
60 * \see Engines::DSC::add_uses_port
62 virtual void add_uses_port(const char* repository_id,
63 const char* uses_port_name,
64 Ports::PortProperties_ptr port_prop)
65 throw (Engines::DSC::PortAlreadyDefined,
66 Engines::DSC::BadProperty);
69 * \see Engines::DSC::get_provides_port
71 virtual Ports::Port_ptr get_provides_port(const char* provides_port_name,
72 const CORBA::Boolean connection_error)
73 throw (Engines::DSC::PortNotDefined,
74 Engines::DSC::PortNotConnected,
75 Engines::DSC::BadPortType);
78 * \see Engines::DSC::get_uses_port
80 virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name)
81 throw (Engines::DSC::PortNotDefined,
82 Engines::DSC::PortNotConnected,
83 Engines::DSC::BadPortType);
86 * \see Engines::DSC::connect_provides_port
88 * \note This method uses Callbacks mechanism to inform the provides
89 * port how much uses ports are connected with. Currently, the provides
90 * port doesn't know its uses ports references. It's framework or application role
91 * to manage connections between ports.
93 virtual void connect_provides_port(const char* provides_port_name)
94 throw (Engines::DSC::PortNotDefined);
97 * \see Engines::DSC::connect_uses_port
99 * \note This method uses Callbacks mechanism to inform the uses
100 * port how much provides ports are connected with.
102 virtual void connect_uses_port(const char* uses_port_name,
103 Ports::Port_ptr provides_port_ref)
104 throw (Engines::DSC::PortNotDefined,
105 Engines::DSC::BadPortType,
106 Engines::DSC::NilPort);
109 * \see Engines::DSC::is_connected
111 virtual CORBA::Boolean is_connected(const char* port_name)
112 throw (Engines::DSC::PortNotDefined);
115 * \see Engines::DSC::disconnect_provides_port
117 * \note This method uses Callbacks mechanism to inform the provides
118 * port how much uses ports are connected with. Currently, the provides
119 * port doesn't know its uses ports references. It's framework or application role
120 * to manage connections between ports.
122 virtual void disconnect_provides_port(const char* provides_port_name,
123 const Engines::DSC::Message message)
124 throw (Engines::DSC::PortNotDefined,
125 Engines::DSC::PortNotConnected);
128 * \see Engines::DSC::disconnect_uses_port
131 * \note This method uses Callbacks mechanism to inform the uses
132 * port how much provides ports are connected with.
134 * \warning The new sequence of the uses port is sended by the callback.
135 * The old sequence is not destoyed. Is uses port user's role to destroy
138 virtual void disconnect_uses_port(const char* uses_port_name,
139 Ports::Port_ptr provides_port_ref,
140 const Engines::DSC::Message message)
141 throw (Engines::DSC::PortNotDefined,
142 Engines::DSC::PortNotConnected,
143 Engines::DSC::BadPortReference);
146 * \see Engines::DSC::get_port_properties
148 virtual Ports::PortProperties_ptr get_port_properties(const char* port_name)
149 throw (Engines::DSC::PortNotDefined);
153 /*-------------------------------------------------*/
154 /* Definition des types pour le stockage des ports */
156 enum port_type {uses, provides, none};
162 // Specifique aux uses port
163 Engines::DSC::uses_port uses_port_refs;
164 std::string repository_id;
166 // Specifique aux provides port;
167 Ports::Port_ptr provides_port_ref;
169 Ports::PortProperties_ptr port_prop;
172 typedef std::map<std::string, port_t *> ports;
174 /*-------------------------------------------------*/
175 /*-------------------------------------------------*/
178 ports::iterator my_ports_it;