1 // Copyright (C) 2011-2021 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // Authors : Guillaume Boulant (EDF) - 01/06/2011
22 #include "MEDEventListener_i.hxx"
23 #include <Basics_Utils.hxx>
25 MEDEventListener_i * MEDEventListener_i::_instance = NULL;
26 MEDEventListener_i * MEDEventListener_i::getInstance() {
27 // _GBO_ we will certainly need to define one EventListener per
28 // DataManager or SALOME study and not one singleton for the whole
30 if ( _instance == NULL ) {
31 _instance = new MEDEventListener_i();
36 void MEDEventListener_i::release() {
40 MEDEventListener_i::MEDEventListener_i()
42 LOG("Creating a MEDEventListener_i instance");
44 MEDEventListener_i::~MEDEventListener_i()
46 LOG("Deleting MEDEventListener_i instance");
49 void MEDEventListener_i::processMedEvent(const MEDCALC::MedEvent & event) {
50 LOG("Start processing event for field id="<<event.dataId);
52 // This function must be executed as fast as possible because the
53 // CORBA request is a synchronous call. Then we just emit a Qt
54 // signal and exit. The Qt signal should be received by the
55 // WorkspaceController (connect to a slot of WorkspaceController).
57 emit medEventSignal(new MEDCALC::MedEvent(event));