1 -- Created on: 2002-10-29
2 -- Created by: Michael SAZONOV
3 -- Copyright (c) 2002-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class DocumentStorageDriver from BinLDrivers inherits StorageDriver from PCDM
18 ---Purpose: persistent implemention of storage a document in a binary file
21 AsciiString from TCollection,
23 MessageDriver from CDM,
24 ExtendedString from TCollection,
26 ADriverTable from BinMDF,
27 SRelocationTable from BinObjMgt,
28 Persistent from BinObjMgt,
30 OStream from Standard,
31 MapOfTransient from TColStd,
32 IndexedMapOfTransient from TColStd,
33 DocumentSection from BinLDrivers,
34 VectorOfDocumentSection from BinLDrivers
37 -- ===== Public methods =====
39 Create returns DocumentStorageDriver from BinLDrivers;
40 ---Purpose: Constructor
42 SchemaName(me) returns ExtendedString from TCollection is redefined virtual;
43 ---Purpose: pure virtual method definition
45 Write (me: mutable; theDocument: Document from CDM;
46 theFileName: ExtendedString from TCollection)
48 ---Purpose: Write <theDocument> to the binary file <theFileName>
50 AttributeDrivers (me : mutable; theMsgDriver: MessageDriver from CDM)
51 returns ADriverTable from BinMDF
54 -- ===== Protected methods =====
56 WriteSubTree (me: mutable; theData : Label from TDF;
57 theOS : in out OStream from Standard)
59 ---Purpose: Write the tree under <theLabel> to the stream <theOS>
61 AddSection (me: mutable; theName : AsciiString from TCollection;
62 isPostRead : Boolean = Standard_True);
63 ---Purpose: Create a section that should be written after the OCAF data
65 WriteSection (me: mutable; theName : AsciiString from TCollection;
66 theDoc : Document from CDM;
67 theOS : in out OStream from Standard)
69 ---Purpose: define the procedure of writing a section to file.
71 WriteShapeSection (me: mutable; theDocSection : in out DocumentSection from BinLDrivers;
72 theOS : in out OStream from Standard)
74 ---Purpose: defines the procedure of writing a shape section to file
76 FirstPass (me: mutable; theRoot : Label from TDF) is private;
78 FirstPassSubTree(me: mutable; L : Label from TDF;
79 ListOfEmptyL : in out LabelList from TDF)
80 returns Boolean from Standard is private;
81 ---Purpose: Returns true if <L> and its sub-labels do not contain
82 -- attributes to store
84 WriteInfoSection(me: mutable; theDocument : Document from CDM;
85 theFile : AsciiString from TCollection)
87 ---Purpose: Write info secton using FSD_BinaryFile driver
89 WriteMessage(me: mutable; theMessage : ExtendedString from TCollection)
91 ---Purpose: write theMessage to the MessageDriver of the
94 UnsupportedAttrMsg(me: mutable; theType: Type from Standard) is private;
98 -- use one self-increasing buffer for an attribute
99 myPAtt : Persistent from BinObjMgt;
100 myDrivers : ADriverTable from BinMDF is protected;
101 myRelocTable: SRelocationTable from BinObjMgt is protected;
102 myMsgDriver : MessageDriver from CDM;
104 -- labels not having writable attributes on it-self and on children
105 myEmptyLabels : LabelList from TDF;
106 -- map of types (Standard_Type) of attributes not having a driver
107 myMapUnsupported : MapOfTransient from TColStd;
108 -- map of types to be written
109 myTypesMap : IndexedMapOfTransient from TColStd;
111 mySections : VectorOfDocumentSection from BinLDrivers;
113 end DocumentStorageDriver;