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 : ConnectionManager_i.hxx
23 // Author : André RIBES (EDF)
26 #ifndef _CONNECTION_MANAGER_I_HXX_
27 #define _CONNECTION_MANAGER_I_HXX_
29 #include <DSC_Basic.hxx>
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(DSC_Engines)
38 /*! \class ConnectionManager_i
39 * \brief This class implements the interface Engines::ConnectionManager.
41 class DSC_BASIC_EXPORT ConnectionManager_i :
42 public virtual POA_Engines::ConnectionManager
45 ConnectionManager_i(CORBA::ORB_ptr orb);
46 virtual ~ConnectionManager_i();
49 * CORBA method : connect two ports of two components.
50 * \see Engines::ConnectionManager::connect
52 Engines::ConnectionManager::connectionId connect(Engines::DSC_ptr uses_component,
53 const char* uses_port_name,
54 Engines::DSC_ptr provides_component,
55 const char* provides_port_name)
56 throw (Engines::DSC::PortNotDefined,
57 Engines::DSC::BadPortType,
58 Engines::DSC::NilPort);
61 * CORBA method : releases a connection performed with
62 * ConnectionManager_i::connect.
64 * \see Engines::ConnectionManager::disconnect
66 void disconnect(Engines::ConnectionManager::connectionId id,
67 Engines::DSC::Message message)
68 throw (Engines::ConnectionManager::BadId);
72 struct connection_infos {
73 Engines::DSC_ptr uses_component;
74 std::string uses_port_name;
75 Engines::DSC_ptr provides_component;
76 std::string provides_port_name;
77 Ports::Port_ptr provides_port;
80 typedef std::map<Engines::ConnectionManager::connectionId,
81 connection_infos *> ids_type;
82 typedef std::map<Engines::ConnectionManager::connectionId,
83 connection_infos *>::iterator ids_it_type;
89 pthread_mutex_t mutex;