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/
20 #ifndef __SALOMEDSIMPL_DRIVER_H__
21 #define __SALOMEDSIMPL_DRIVER_H__
23 #include <TCollection_AsciiString.hxx>
24 #include <SALOMEDSImpl_SComponent.hxx>
25 #include <SALOMEDSImpl_SObject.hxx>
28 class SALOMEDSImpl_Driver
32 virtual TCollection_AsciiString GetIOR() = 0;
34 virtual unsigned char* Save(const Handle(SALOMEDSImpl_SComponent)& theComponent,
35 const TCollection_AsciiString& theURL,
36 long& theStreamLength,
37 bool isMultiFile) = 0;
39 virtual unsigned char* SaveASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
40 const TCollection_AsciiString& theURL,
41 long& theStreamLength,
42 bool isMultiFile) = 0;
44 virtual bool Load(const Handle(SALOMEDSImpl_SComponent)& theComponent,
45 const unsigned char* theStream,
46 const long theStreamLength,
47 const TCollection_AsciiString& theURL,
48 bool isMultiFile) = 0;
50 virtual bool LoadASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
51 const unsigned char* theStream,
52 const long theStreamLength,
53 const TCollection_AsciiString& theURL,
54 bool isMultiFile) = 0;
56 virtual void Close(const Handle(SALOMEDSImpl_SComponent)& theComponent) = 0;
58 virtual TCollection_AsciiString ComponentDataType() = 0;
61 virtual TCollection_AsciiString IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
62 const TCollection_AsciiString& IORString,
66 virtual TCollection_AsciiString LocalPersistentIDToIOR(const Handle(SALOMEDSImpl_SObject)& theSObject,
67 const TCollection_AsciiString& aLocalPersistentID,
71 virtual bool CanCopy(const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
73 virtual unsigned char* CopyFrom(const Handle(SALOMEDSImpl_SObject)& theObject,
75 long& theStreamLength) = 0;
77 virtual bool CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID) = 0;
79 virtual TCollection_AsciiString PasteInto(const unsigned char* theStream,
80 const long theStreamLength,
82 const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
84 virtual unsigned char* DumpPython(const Handle(SALOMEDSImpl_Study)& theStudy,
87 long& theStreamLength) = 0;
90 class SALOMEDSImpl_DriverFactory
94 virtual SALOMEDSImpl_Driver* GetDriverByType(const TCollection_AsciiString& theComponentType) = 0;
96 virtual SALOMEDSImpl_Driver* GetDriverByIOR(const TCollection_AsciiString& theIOR) = 0;