Back to index

salome-kernel  6.5.0
SALOMEDSImpl_Driver.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 __SALOMEDSIMPL_DRIVER_H__
00024 #define __SALOMEDSIMPL_DRIVER_H__
00025 
00026 #include "SALOMEDSImpl_Defines.hxx"
00027 #include <string>
00028 #include "SALOMEDSImpl_SComponent.hxx"
00029 #include "SALOMEDSImpl_SObject.hxx"
00030 #include "SALOMEDSImpl_TMPFile.hxx"
00031 
00032 
00033 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver
00034 {
00035 public:
00036 
00037   virtual std::string GetIOR() = 0;
00038 
00039   virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
00040     const std::string& theURL,
00041     long& theStreamLength,
00042     bool isMultiFile) = 0;
00043 
00044   virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
00045     const std::string& theURL,
00046     long& theStreamLength,
00047     bool isMultiFile) = 0;
00048 
00049   virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
00050     const unsigned char* theStream,
00051     const long theStreamLength,
00052     const std::string& theURL,
00053     bool isMultiFile) = 0;
00054 
00055   virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
00056     const unsigned char* theStream,
00057     const long theStreamLength,
00058     const std::string& theURL,
00059     bool isMultiFile) = 0;
00060 
00061   virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
00062 
00063   virtual std::string ComponentDataType() = 0;
00064 
00065 
00066   virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
00067     const std::string& IORString,
00068     bool isMultiFile,
00069     bool isASCII) = 0;
00070 
00071   virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
00072     const std::string& aLocalPersistentID,
00073     bool isMultiFile,
00074     bool isASCII) = 0;
00075 
00076   virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
00077 
00078   virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject, 
00079     int& theObjectID,
00080     long& theStreamLength) = 0;
00081 
00082   virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
00083 
00084   virtual std::string PasteInto(const unsigned char* theStream,
00085     const long theStreamLength,
00086     int theObjectID,
00087     const SALOMEDSImpl_SObject& theObject) = 0;
00088 
00089   virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy, 
00090     bool isPublished, 
00091     bool isMultiFile, 
00092     bool& isValidScript,
00093     long& theStreamLength) = 0;
00094 };
00095 
00096 class SALOMEDSImpl_DriverFactory
00097 {
00098 public:
00099 
00100   virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
00101 
00102   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;
00103 };
00104 
00105 #endif