Back to index

salome-kernel  6.5.0
SALOMEDS_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 #ifndef __SALOMEDS_DRIVER_I_H__
00024 #define __SALOMEDS_DRIVER_I_H__
00025 
00026 #include <SALOMEconfig.h>
00027 
00028 #include <omniORB4/CORBA.h>
00029 #include "SALOMEDSImpl_Driver.hxx"
00030 #include "SALOMEDSImpl_SComponent.hxx"
00031 #include "SALOMEDSImpl_SObject.hxx"
00032 
00033 #include CORBA_SERVER_HEADER(SALOMEDS) 
00034 #include CORBA_SERVER_HEADER(SALOME_Component)
00035 
00036 class Standard_EXPORT SALOMEDS_Driver_i :  public virtual SALOMEDSImpl_Driver 
00037 {
00038 protected:
00039   SALOMEDS::Driver_var _driver;
00040   CORBA::ORB_var _orb;
00041 
00042 public:
00043 
00044   SALOMEDS_Driver_i(SALOMEDS::Driver_ptr theDriver, CORBA::ORB_ptr theORB);
00045 
00046   ~SALOMEDS_Driver_i();
00047 
00048   virtual std::string GetIOR();
00049 
00050   virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
00051                                      const std::string& theURL,
00052                                      long& theStreamLength,
00053                                      bool isMultiFile);
00054 
00055   virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
00056                                           const std::string& theURL,
00057                                           long& theStreamLength,
00058                                           bool isMultiFile);
00059   
00060   virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
00061                     const unsigned char* theStream,
00062                     const long theStreamLength,
00063                     const std::string& theURL,
00064                     bool isMultiFile);
00065 
00066   virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
00067                          const unsigned char* theStream,
00068                          const long theStreamLength,
00069                          const std::string& theURL,
00070                          bool isMultiFile);
00071 
00072   virtual void Close(const SALOMEDSImpl_SComponent& theComponent);
00073  
00074   virtual std::string ComponentDataType();
00075 
00076   virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
00077                                              const std::string& IORString,
00078                                              bool isMultiFile,
00079                                              bool isASCII);
00080 
00081   virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
00082                                              const std::string& aLocalPersistentID,
00083                                              bool isMultiFile,
00084                                              bool isASCII);
00085 
00086   virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject);
00087 
00088   virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject, 
00089                                          int& theObjectID,
00090                                          long& theStreamLength);
00091   
00092   virtual bool CanPaste(const std::string& theComponentName, int theObjectID);
00093 
00094   virtual std::string PasteInto(const unsigned char* theStream,
00095                                 const long theStreamLength,
00096                                 int theObjectID,
00097                                 const SALOMEDSImpl_SObject& theObject);
00098 
00099   virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy, 
00100                                            bool isPublished, 
00101                                            bool isMultiFile,
00102                                            bool& isValidScript,
00103                                            long& theStreamLength);
00104 };
00105 
00106 #include "SALOME_NamingService.hxx"
00107 #include "SALOME_LifeCycleCORBA.hxx"
00108 
00109 class SALOMEDS_DriverFactory_i : public virtual SALOMEDSImpl_DriverFactory 
00110 {
00111 protected:  
00112   CORBA::ORB_var        _orb;
00113   SALOME_NamingService* _name_service;
00114 
00115 public:
00116   
00117   SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB);
00118 
00119   ~SALOMEDS_DriverFactory_i();
00120    
00121   virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType);
00122 
00123   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR);
00124 };
00125 
00126 #endif