1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __SALOMEDSIMPL_DRIVER_H__
21 #define __SALOMEDSIMPL_DRIVER_H__
24 #include <SALOMEDSImpl_SComponent.hxx>
25 #include <SALOMEDSImpl_SObject.hxx>
26 #include <SALOMEDSImpl_TMPFile.hxx>
29 class SALOMEDSImpl_Driver
33 virtual std::string GetIOR() = 0;
35 virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
36 const std::string& theURL,
37 long& theStreamLength,
38 bool isMultiFile) = 0;
40 virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
41 const std::string& theURL,
42 long& theStreamLength,
43 bool isMultiFile) = 0;
45 virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
46 const unsigned char* theStream,
47 const long theStreamLength,
48 const std::string& theURL,
49 bool isMultiFile) = 0;
51 virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
52 const unsigned char* theStream,
53 const long theStreamLength,
54 const std::string& theURL,
55 bool isMultiFile) = 0;
57 virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
59 virtual std::string ComponentDataType() = 0;
62 virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
63 const std::string& IORString,
67 virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
68 const std::string& aLocalPersistentID,
72 virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
74 virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
76 long& theStreamLength) = 0;
78 virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
80 virtual std::string PasteInto(const unsigned char* theStream,
81 const long theStreamLength,
83 const SALOMEDSImpl_SObject& theObject) = 0;
85 virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy,
88 long& theStreamLength) = 0;
91 class SALOMEDSImpl_DriverFactory
95 virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
97 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;