1 // Copyright (C) 2011 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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
19 // Authors : Guillaume Boulant (EDF) - 01/06/2011
21 #include "MEDEventListener_i.hxx"
22 #include <Basics_Utils.hxx>
24 MEDEventListener_i * MEDEventListener_i::_instance = NULL;
25 MEDEventListener_i * MEDEventListener_i::getInstance() {
26 // _GBO_ we will certainly need to define one EventListener per
27 // DataManager or SALOME study and not one singleton for the whole
29 if ( _instance == NULL ) {
30 _instance = new MEDEventListener_i();
35 void MEDEventListener_i::release() {
39 MEDEventListener_i::MEDEventListener_i()
41 LOG("Creating a MEDEventListener_i instance");
43 MEDEventListener_i::~MEDEventListener_i()
45 LOG("Deleting MEDEventListener_i instance");
48 void MEDEventListener_i::processMedEvent(const MEDOP::MedEvent & event) {
49 LOG("Start processing event for field id="<<event.fieldid);
51 // This function must be executed as fast as possible because the
52 // CORBA request is a synchronous call. Then we just emit a Qt
53 // signal and exit. The Qt signal should be received by the
54 // WorkspaceController (connect to a slot of WorkspaceController).
56 emit medEventSignal(new MEDOP::MedEvent(event));