1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : ConnectionManager_i.hxx
24 // Author : André RIBES (EDF)
27 #ifndef _CONNECTION_MANAGER_I_HXX_
28 #define _CONNECTION_MANAGER_I_HXX_
30 #include "DSC_Basic.hxx"
31 #include "SALOME_NamingService.hxx"
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(DSC_Engines)
40 /*! \class ConnectionManager_i
41 * \brief This class implements the interface Engines::ConnectionManager.
43 class ConnectionManager_i :
44 public virtual POA_Engines::ConnectionManager
47 ConnectionManager_i(CORBA::ORB_ptr orb);
48 virtual ~ConnectionManager_i();
51 * CORBA method : connect two ports of two components.
52 * \see Engines::ConnectionManager::connect
54 Engines::ConnectionManager::connectionId connect(Engines::DSC_ptr uses_component,
55 const char* uses_port_name,
56 Engines::DSC_ptr provides_component,
57 const char* provides_port_name);
60 * CORBA method : releases a connection performed with
61 * ConnectionManager_i::connect.
63 * \see Engines::ConnectionManager::disconnect
65 void disconnect(Engines::ConnectionManager::connectionId id,
66 Engines::DSC::Message message);
69 Shutdown the ConnectionManager process.
71 void ShutdownWithExit();
74 Returns the PID of the connection manager
78 static const char *_ConnectionManagerNameInNS;
82 struct connection_infos {
83 Engines::DSC_var uses_component;
84 std::string uses_port_name;
85 Engines::DSC_var provides_component;
86 std::string provides_port_name;
87 Ports::Port_var provides_port;
90 typedef std::map<Engines::ConnectionManager::connectionId,
91 connection_infos *> ids_type;
92 typedef std::map<Engines::ConnectionManager::connectionId,
93 connection_infos *>::iterator ids_it_type;
99 pthread_mutex_t mutex;
102 SALOME_NamingService * _NS;