Version: 9.12.0
ConnectionManager_i.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, 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, or (at your option) any later version.
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 
23 // File : ConnectionManager_i.hxx
24 // Author : André RIBES (EDF)
25 // Module : KERNEL
26 //
27 #ifndef _CONNECTION_MANAGER_I_HXX_
28 #define _CONNECTION_MANAGER_I_HXX_
29 
30 #include "DSC_Basic.hxx"
31 #include "SALOME_NamingService.hxx"
32 
33 #include <iostream>
34 #include <map>
35 #include <pthread.h>
36 
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(DSC_Engines)
39 
44  public virtual POA_Engines::ConnectionManager
45 {
46  public :
47  ConnectionManager_i(CORBA::ORB_ptr orb);
48  virtual ~ConnectionManager_i();
49 
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);
58 
66  Engines::DSC::Message message);
67 
71  void ShutdownWithExit();
72 
76  CORBA::Long getPID();
77 
78  static const char *_ConnectionManagerNameInNS;
79 
80  private :
81 
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;
88  };
89 
94 
97 
99  pthread_mutex_t mutex;
100  protected:
101  CORBA::ORB_var _orb;
103 };
104 
105 #endif
This class implements the interface Engines::ConnectionManager.
Definition: ConnectionManager_i.hxx:45
pthread_mutex_t mutex
Definition: ConnectionManager_i.hxx:99
ConnectionManager_i(CORBA::ORB_ptr orb)
Definition: ConnectionManager_i.cxx:37
void ShutdownWithExit()
Shutdown the ConnectionManager process.
Definition: ConnectionManager_i.cxx:125
static const char * _ConnectionManagerNameInNS
Definition: ConnectionManager_i.hxx:78
int current_id
Definition: ConnectionManager_i.hxx:98
CORBA::Long getPID()
Returns the PID of the connection manager.
Definition: ConnectionManager_i.cxx:141
ids_it_type ids_it
Definition: ConnectionManager_i.hxx:96
virtual ~ConnectionManager_i()
Definition: ConnectionManager_i.cxx:48
std::map< Engines::ConnectionManager::connectionId, connection_infos * > ids_type
Definition: ConnectionManager_i.hxx:91
SALOME_NamingService * _NS
Definition: ConnectionManager_i.hxx:102
ids_type ids
Definition: ConnectionManager_i.hxx:95
std::map< Engines::ConnectionManager::connectionId, connection_infos * >::iterator ids_it_type
Definition: ConnectionManager_i.hxx:93
Engines::ConnectionManager::connectionId connect(Engines::DSC_ptr uses_component, const char *uses_port_name, Engines::DSC_ptr provides_component, const char *provides_port_name)
CORBA method : connect two ports of two components.
Definition: ConnectionManager_i.cxx:54
void disconnect(Engines::ConnectionManager::connectionId id, Engines::DSC::Message message)
CORBA method : releases a connection performed with ConnectionManager_i::connect.
Definition: ConnectionManager_i.cxx:86
CORBA::ORB_var _orb
Definition: ConnectionManager_i.hxx:101
A class to manage the SALOME naming service.
Definition: SALOME_NamingService.hxx:48
short connectionId
A connection Id. It's unique.
Definition: DSC_Engines.idl:293
Message
This enumeration is used when the connection of a port (uses or provides) is changed.
Definition: DSC_Engines.idl:79
orb
Definition: salome.py:122
Definition: ConnectionManager_i.hxx:82
Ports::Port_var provides_port
Definition: ConnectionManager_i.hxx:87
std::string provides_port_name
Definition: ConnectionManager_i.hxx:86
Engines::DSC_var uses_component
Definition: ConnectionManager_i.hxx:83
Engines::DSC_var provides_component
Definition: ConnectionManager_i.hxx:85
std::string uses_port_name
Definition: ConnectionManager_i.hxx:84