]> SALOME platform Git repositories - modules/yacs.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / SALOMEDSImpl / SALOMEDSImpl_Driver.hxx
1 #ifndef __SALOMEDSIMPL_DRIVER_H__
2 #define __SALOMEDSIMPL_DRIVER_H__
3
4 #include <TCollection_AsciiString.hxx>
5 #include <SALOMEDSImpl_SComponent.hxx>
6 #include <SALOMEDSImpl_SObject.hxx>
7
8
9 class SALOMEDSImpl_Driver
10 {
11 public:
12
13   virtual TCollection_AsciiString GetIOR() = 0;
14
15   virtual unsigned char* Save(const Handle(SALOMEDSImpl_SComponent)& theComponent,
16                               const TCollection_AsciiString& theURL,
17                               long& theStreamLength,
18                               bool isMultiFile) = 0;
19
20   virtual unsigned char* SaveASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
21                                    const TCollection_AsciiString& theURL,
22                                    long& theStreamLength,
23                                    bool isMultiFile) = 0;
24   
25   virtual bool Load(const Handle(SALOMEDSImpl_SComponent)& theComponent,
26                     const unsigned char* theStream,
27                     const long theStreamLength,
28                     const TCollection_AsciiString& theURL,
29                     bool isMultiFile) = 0;
30
31   virtual bool LoadASCII(const Handle(SALOMEDSImpl_SComponent)& theComponent,
32                          const unsigned char* theStream,
33                          const long theStreamLength,
34                          const TCollection_AsciiString& theURL,
35                          bool isMultiFile) = 0;
36
37   virtual void Close(const Handle(SALOMEDSImpl_SComponent)& theComponent) = 0;
38  
39   virtual TCollection_AsciiString ComponentDataType() = 0;
40
41
42   virtual TCollection_AsciiString IORToLocalPersistentID(const Handle(SALOMEDSImpl_SObject)& theSObject,
43                                                          const TCollection_AsciiString& IORString,
44                                                          bool isMultiFile,
45                                                          bool isASCII) = 0;
46
47   virtual TCollection_AsciiString LocalPersistentIDToIOR(const Handle(SALOMEDSImpl_SObject)& theSObject,
48                                                          const TCollection_AsciiString& aLocalPersistentID,
49                                                          bool isMultiFile,
50                                                          bool isASCII) = 0;
51
52   virtual bool CanCopy(const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
53
54   virtual unsigned char* CopyFrom(const Handle(SALOMEDSImpl_SObject)& theObject, 
55                                   int& theObjectID,
56                                   long& theStreamLength) = 0;
57
58   virtual bool CanPaste(const TCollection_AsciiString& theComponentName, int theObjectID) = 0;
59
60   virtual TCollection_AsciiString PasteInto(const unsigned char* theStream,
61                                             const long theStreamLength,
62                                             int theObjectID,
63                                             const Handle(SALOMEDSImpl_SObject)& theObject) = 0;
64
65   virtual unsigned char* DumpPython(const Handle(SALOMEDSImpl_Study)& theStudy, 
66                                     bool isPublished, 
67                                     bool& isValidScript,
68                                     long& theStreamLength) = 0;
69 };
70
71 class SALOMEDSImpl_DriverFactory
72 {
73 public:
74   
75   virtual SALOMEDSImpl_Driver* GetDriverByType(const TCollection_AsciiString& theComponentType) = 0;
76
77   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const TCollection_AsciiString& theIOR) = 0;
78 };
79
80 #endif