Back to index

salome-med  6.5.0
Med_Gen_Driver_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  MED MED : implemetation of MED idl descriptions
00024 //  File   : Med_Gen_Driver_i.hxx
00025 //  Author : Paul RASCLE, EDF
00026 //  Module : MED
00027 
00028 #ifndef _MED_GEN_DRIVER_I_HXX_
00029 #define _MED_GEN_DRIVER_I_HXX_
00030 
00031 #include <SALOMEconfig.h>
00032 #include CORBA_SERVER_HEADER(MED_Gen)
00033 #include CORBA_SERVER_HEADER(MED)
00034 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
00035 
00036 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
00037 
00038 #include "SALOME_Component_i.hxx"
00039 #include "SALOME_NamingService.hxx"
00040 
00041 #include <map>
00042 
00043 namespace MEDMEM {
00044   class MED_i;
00045 }
00046 
00047 class Med_Gen_Driver_i : public virtual POA_SALOME_MED::MED_Gen_Driver
00048 {
00049 private:
00050   Med_Gen_Driver_i();
00051 
00052 public:
00053   //  Constructor and Destructor
00054   Med_Gen_Driver_i(CORBA::ORB_ptr orb);
00055   virtual ~Med_Gen_Driver_i();
00056 
00057   // Get Med object of the study (for persistance)
00058   static MEDMEM::MED_i* GetMED(SALOMEDS::SComponent_ptr theStudy);
00059 
00060   // inherited methods from SALOMEDS::Driver
00061 
00062   SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
00063                           const char* theURL,
00064                           bool isMultiFile);
00065   SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
00066                                const char* theURL,
00067                                bool isMultiFile);
00068 
00069   CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
00070                       const SALOMEDS::TMPFile& theStream,
00071                       const char* theURL,
00072                       bool isMultiFile);
00073   CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
00074                            const SALOMEDS::TMPFile& theStream,
00075                            const char* theURL,
00076                            bool isMultiFile);
00077 
00078   void Close(SALOMEDS::SComponent_ptr theComponent);
00079 
00080   char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
00081                                const char* IORString,
00082                                CORBA::Boolean isMultiFile,
00083                                CORBA::Boolean isASCII);
00084   char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
00085                                const char* aLocalPersistentID,
00086                                CORBA::Boolean isMultiFile,
00087                                CORBA::Boolean isASCII)
00088     throw(SALOME::SALOME_Exception);
00089 
00090   bool CanPublishInStudy(CORBA::Object_ptr theIOR);
00091 
00092   SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
00093                                        SALOMEDS::SObject_ptr theSObject,
00094                                        CORBA::Object_ptr theObject,
00095                                        const char* theName) throw (SALOME::SALOME_Exception);
00096 
00097   CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
00098   SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
00099 
00100   CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
00101   SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
00102                                   CORBA::Long theObjectID,
00103                                   SALOMEDS::SObject_ptr theObject);
00104 
00105   // this method of SALOMEDS::Driver must be implemented in Component
00106   //char* ComponentDataType();
00107 
00108   // to be defined in Component
00109   virtual Engines::EngineComponent_ptr GetComponentInstance() = 0;
00110 
00111 private:
00112   static std::map<std::string, MEDMEM::MED_i*> _MedCorbaObj;
00113 
00114   CORBA::ORB_ptr _driver_orb;
00115 
00116 protected:
00117   SALOME_NamingService *_NS;
00118 };
00119 
00120 #endif