0026576: Wrong result obtained by intersection algorithm.
[occt.git] / src / PCDM / PCDM_StorageDriver.hxx
CommitLineData
42cf5bc1 1// Created on: 1997-11-03
2// Created by: Jean-Louis Frenkel
3// Copyright (c) 1997-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _PCDM_StorageDriver_HeaderFile
18#define _PCDM_StorageDriver_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <TCollection_ExtendedString.hxx>
24#include <Standard_Boolean.hxx>
25#include <PCDM_StoreStatus.hxx>
26#include <PCDM_Writer.hxx>
27#include <PCDM_SequenceOfDocument.hxx>
28#include <TColStd_SequenceOfExtendedString.hxx>
29class Standard_NoSuchObject;
30class PCDM_DriverError;
31class PCDM_Document;
32class CDM_Document;
33class TCollection_ExtendedString;
34class Storage_Schema;
35
36
37class PCDM_StorageDriver;
38DEFINE_STANDARD_HANDLE(PCDM_StorageDriver, PCDM_Writer)
39
40//! persistent implemention of storage.
41//!
42//! The application must redefine one the two Make()
43//! methods. The first one, if the application wants to
44//! put only one document in the storage file.
45//!
46//! The second method should be redefined to put
47//! additional document that could be used by the
48//! retrieval instead of the principal document, depending
49//! on the schema used during the retrieval. For example,
50//! a second document could be a standard
51//! CDMShape_Document. This means that a client
52//! application will already be able to extract a CDMShape_Document
53//! of the file, if the Shape Schema remains unchanged.
54class PCDM_StorageDriver : public PCDM_Writer
55{
56
57public:
58
59
60 //! raises NotImplemented.
61 Standard_EXPORT virtual Handle(PCDM_Document) Make (const Handle(CDM_Document)& aDocument);
62
63 //! By default, puts in the Sequence the document returns
64 //! by the previous Make method.
65 Standard_EXPORT virtual void Make (const Handle(CDM_Document)& aDocument, PCDM_SequenceOfDocument& Documents);
66
67 Standard_EXPORT virtual TCollection_ExtendedString SchemaName() const = 0;
68
69 Standard_EXPORT virtual void LoadExtensions (const Handle(Storage_Schema)& aSchema, const TColStd_SequenceOfExtendedString& Extensions);
70
71 //! Warning! raises DriverError if an error occurs during inside the
72 //! Make method.
73 //! stores the content of the Document into a new file.
74 //!
75 //! by default Write will use Make method to build a persistent
76 //! document and the Schema method to write the persistent document.
77 Standard_EXPORT virtual void Write (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName) Standard_OVERRIDE;
78
79 Standard_EXPORT void SetFormat (const TCollection_ExtendedString& aformat);
80
81 Standard_EXPORT TCollection_ExtendedString GetFormat() const;
82
83 Standard_EXPORT Standard_Boolean IsError() const;
84
85 Standard_EXPORT void SetIsError (const Standard_Boolean theIsError);
86
87 Standard_EXPORT PCDM_StoreStatus GetStoreStatus() const;
88
89 Standard_EXPORT void SetStoreStatus (const PCDM_StoreStatus theStoreStatus);
90
91
92
93
92efcf78 94 DEFINE_STANDARD_RTTIEXT(PCDM_StorageDriver,PCDM_Writer)
42cf5bc1 95
96protected:
97
98
99
100
101private:
102
103
104 TCollection_ExtendedString myFormat;
105 Standard_Boolean myIsError;
106 PCDM_StoreStatus myStoreStatus;
107
108
109};
110
111
112
113
114
115
116
117#endif // _PCDM_StorageDriver_HeaderFile