Salome HOME
Revert "Synchronize adm files"
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_Driver.hxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef __SALOMEDSIMPL_DRIVER_H__
24 #define __SALOMEDSIMPL_DRIVER_H__
25
26 #include "SALOMEDSImpl_Defines.hxx"
27 #include <string>
28 #include "SALOMEDSImpl_SComponent.hxx"
29 #include "SALOMEDSImpl_SObject.hxx"
30 #include "SALOMEDSImpl_TMPFile.hxx"
31
32
33 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Driver
34 {
35 public:
36
37   virtual std::string GetIOR() = 0;
38
39   virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent,
40     const std::string& theURL,
41     long& theStreamLength,
42     bool isMultiFile) = 0;
43
44   virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
45     const std::string& theURL,
46     long& theStreamLength,
47     bool isMultiFile) = 0;
48
49   virtual bool Load(const SALOMEDSImpl_SComponent& theComponent,
50     const unsigned char* theStream,
51     const long theStreamLength,
52     const std::string& theURL,
53     bool isMultiFile) = 0;
54
55   virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent,
56     const unsigned char* theStream,
57     const long theStreamLength,
58     const std::string& theURL,
59     bool isMultiFile) = 0;
60
61   virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0;
62
63   virtual std::string ComponentDataType() = 0;
64
65   virtual std::string Version() = 0;
66
67   virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
68     const std::string& IORString,
69     bool isMultiFile,
70     bool isASCII) = 0;
71
72   virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject,
73     const std::string& aLocalPersistentID,
74     bool isMultiFile,
75     bool isASCII) = 0;
76
77   virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject) = 0;
78
79   virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject, 
80     int& theObjectID,
81     long& theStreamLength) = 0;
82
83   virtual bool CanPaste(const std::string& theComponentName, int theObjectID) = 0;
84
85   virtual std::string PasteInto(const unsigned char* theStream,
86     const long theStreamLength,
87     int theObjectID,
88     const SALOMEDSImpl_SObject& theObject) = 0;
89
90   virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy, 
91     bool isPublished, 
92     bool isMultiFile, 
93     bool& isValidScript,
94     long& theStreamLength) = 0;
95 };
96
97 class SALOMEDSImpl_DriverFactory
98 {
99 public:
100
101   virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType) = 0;
102
103   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR) = 0;
104 };
105
106 #endif