1 // Copyright (C) 2007-2008 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.
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
22 // MED MED : implemetation of MED idl descriptions
23 // File : Med_Gen_Driver_i.hxx
24 // Author : Paul RASCLE, EDF
27 #ifndef _MED_GEN_DRIVER_I_HXX_
28 #define _MED_GEN_DRIVER_I_HXX_
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(MED_Gen)
32 #include CORBA_SERVER_HEADER(MED)
33 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
35 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
37 #include "SALOME_Component_i.hxx"
38 #include "SALOME_NamingService.hxx"
46 class Med_Gen_Driver_i : public virtual POA_SALOME_MED::MED_Gen_Driver
52 // Constructor and Destructor
53 Med_Gen_Driver_i(CORBA::ORB_ptr orb);
54 virtual ~Med_Gen_Driver_i();
56 // Get Med object of the study (for persistance)
57 static MEDMEM::MED_i* GetMED(SALOMEDS::SComponent_ptr theStudy);
59 // inherited methods from SALOMEDS::Driver
61 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
64 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
68 CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
69 const SALOMEDS::TMPFile& theStream,
72 CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
73 const SALOMEDS::TMPFile& theStream,
77 void Close(SALOMEDS::SComponent_ptr theComponent);
79 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
80 const char* IORString,
81 CORBA::Boolean isMultiFile,
82 CORBA::Boolean isASCII);
83 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
84 const char* aLocalPersistentID,
85 CORBA::Boolean isMultiFile,
86 CORBA::Boolean isASCII)
87 throw(SALOME::SALOME_Exception);
89 bool CanPublishInStudy(CORBA::Object_ptr theIOR);
91 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
92 SALOMEDS::SObject_ptr theSObject,
93 CORBA::Object_ptr theObject,
94 const char* theName) throw (SALOME::SALOME_Exception);
96 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
97 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
99 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
100 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
101 CORBA::Long theObjectID,
102 SALOMEDS::SObject_ptr theObject);
104 // this method of SALOMEDS::Driver must be implemented in Component
105 //char* ComponentDataType();
107 // to be defined in Component
108 virtual Engines::Component_ptr GetComponentInstance() = 0;
111 static std::map<std::string, MEDMEM::MED_i*> _MedCorbaObj;
113 CORBA::ORB_ptr _driver_orb;
116 SALOME_NamingService *_NS;