1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
23 #ifndef __SALOMEDSIMPL_DRIVER_H__
24 #define __SALOMEDSIMPL_DRIVER_H__
26 #include "SALOMEDSImpl_Defines.hxx"
28 #include "SALOMEDSImpl_SComponent.hxx"
29 #include "SALOMEDSImpl_SObject.hxx"
30 #include "SALOMEDSImpl_TMPFile.hxx"
33 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver
37 virtual ~SALOMEDSImpl_Driver() {};
39 virtual std::string GetIOR() = 0;
41 virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
42 const std::string& theURL,
43 long& theStreamLength,
44 bool isMultiFile) = 0;
46 virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
47 const std::string& theURL,
48 long& theStreamLength,
49 bool isMultiFile) = 0;
51 virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
52 const unsigned char* theStream,
53 const long theStreamLength,
54 const std::string& theURL,
55 bool isMultiFile) = 0;
57 virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
58 const unsigned char* theStream,
59 const long theStreamLength,
60 const std::string& theURL,
61 bool isMultiFile) = 0;
63 virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
65 virtual std::string ComponentDataType() = 0;
67 virtual std::string Version() = 0;
69 virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
70 const std::string& IORString,
74 virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
75 const std::string& aLocalPersistentID,
79 virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
81 virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject,
83 long& theStreamLength) = 0;
85 virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
87 virtual std::string PasteInto(const unsigned char* theStream,
88 const long theStreamLength,
90 const SALOMEDSImpl_SObject& theObject) = 0;
92 virtual SALOMEDSImpl_TMPFile* DumpPython(bool isPublished,
95 long& theStreamLength) = 0;
98 class SALOMEDSImpl_DriverFactory
102 virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
104 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;