1 // SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
3 // Copyright (C) 2003 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.
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOMEDS.cxx
25 // Author : Sergey ANIKIN
30 #include <SALOMEDS.hxx>
31 #include <SALOMEDS_StudyManager.hxx>
32 #include <SALOMEDS_Study.hxx>
33 #include <SALOMEDS_SObject.hxx>
34 #include <SALOMEDS_SComponent.hxx>
35 #include <SALOMEDSClient.hxx>
36 #include <SALOMEDS_StudyManager_i.hxx>
38 #include "SALOMEDS.hxx"
39 #include "SALOMEDS_StudyManager.hxx"
40 #include "SALOMEDS_Study.hxx"
41 #include "SALOMEDS_SObject.hxx"
42 #include "SALOMEDS_SComponent.hxx"
43 #include "SALOMEDSClient.hxx"
44 #include "SALOMEDS_StudyManager_i.hxx"
48 #include <SALOMEconfig.h>
49 #include CORBA_SERVER_HEADER(SALOMEDS)
51 using namespace SALOMEDS;
53 // PAL8065: san -- Global recursive mutex for SALOMEDS methods
54 Utils_Mutex Locker::MutexDS;
56 // PAL8065: san -- Global SALOMEDS locker
58 : Utils_Locker( &MutexDS )
66 Locker::MutexDS.lock();
69 void SALOMEDS::unlock()
71 Locker::MutexDS.unlock();
76 // srn: Added new library methods that create basic SALOMEDS objects (StudyManager, Study, SComponent, SObject)
78 //=============================================================================
80 * C factory, accessible with dlsym, after dlopen
82 //=============================================================================
88 SALOMEDSClient_StudyManager* StudyManagerFactory()
90 return new SALOMEDS_StudyManager();
93 SALOMEDSClient_Study* StudyFactory(SALOMEDS::Study_ptr theStudy)
95 return new SALOMEDS_Study(theStudy);
98 SALOMEDSClient_SObject* SObjectFactory(SALOMEDS::SObject_ptr theSObject)
100 return new SALOMEDS_SObject(theSObject);
103 SALOMEDSClient_SComponent* SComponentFactory(SALOMEDS::SComponent_ptr theSComponent)
105 return new SALOMEDS_SComponent(theSComponent);
108 SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
110 SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
111 // Activate the objects. This tells the POA that the objects are ready to accept requests.
112 PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
113 aStudyManager_i->register_name("/myStudyManager");
114 return new SALOMEDS_StudyManager();