Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:20:06

0001 // Created on: 1997-11-17
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _CDF_MetaDataDriver_HeaderFile
0018 #define _CDF_MetaDataDriver_HeaderFile
0019 
0020 #include <Standard_Type.hxx>
0021 
0022 class CDM_MetaData;
0023 class TCollection_ExtendedString;
0024 class CDM_Document;
0025 class PCDM_ReferenceIterator;
0026 class Message_Messenger;
0027 
0028 //! this class list the method that must be available for
0029 //! a specific DBMS
0030 class CDF_MetaDataDriver : public Standard_Transient
0031 {
0032 
0033 public:
0034   //! returns true if the MetaDataDriver can manage different
0035   //! versions of a Data.
0036   //! By default, returns false.
0037   Standard_EXPORT virtual bool HasVersionCapability();
0038 
0039   //! Creates a "Depends On" relation between two Datas.
0040   //! By default does nothing
0041   Standard_EXPORT virtual void CreateDependsOn(const occ::handle<CDM_MetaData>& aFirstData,
0042                                                const occ::handle<CDM_MetaData>& aSecondData);
0043 
0044   Standard_EXPORT virtual void CreateReference(const occ::handle<CDM_MetaData>& aFrom,
0045                                                const occ::handle<CDM_MetaData>& aTo,
0046                                                const int aReferenceIdentifier,
0047                                                const int aToDocumentVersion);
0048 
0049   //! by default return true.
0050   Standard_EXPORT virtual bool HasVersion(const TCollection_ExtendedString& aFolder,
0051                                           const TCollection_ExtendedString& aName);
0052 
0053   Standard_EXPORT virtual TCollection_ExtendedString BuildFileName(
0054     const occ::handle<CDM_Document>& aDocument) = 0;
0055 
0056   //! this method is useful if the name of an object
0057   //! depends on the metadatadriver. For example a Driver
0058   //! based on the operating system can choose to add
0059   //! the extension of file to create to the object.
0060   Standard_EXPORT virtual TCollection_ExtendedString SetName(
0061     const occ::handle<CDM_Document>&  aDocument,
0062     const TCollection_ExtendedString& aName);
0063 
0064   //! should indicate whether meta-data exist in the DBMS corresponding
0065   //! to the Data.
0066   //! aVersion may be NULL;
0067   Standard_EXPORT virtual bool Find(const TCollection_ExtendedString& aFolder,
0068                                     const TCollection_ExtendedString& aName,
0069                                     const TCollection_ExtendedString& aVersion) = 0;
0070 
0071   Standard_EXPORT virtual bool HasReadPermission(const TCollection_ExtendedString& aFolder,
0072                                                  const TCollection_ExtendedString& aName,
0073                                                  const TCollection_ExtendedString& aVersion) = 0;
0074 
0075   //! should return the MetaData stored in the DBMS with the meta-data
0076   //! corresponding to the Data. If the MetaDataDriver has version management capabilities
0077   //! the version has to be set in the returned MetaData.
0078   //! aVersion may be NULL
0079   //! MetaData is called by GetMetaData
0080   //! If the version is set to NULL, MetaData should return
0081   //! the last version of the metadata
0082   Standard_EXPORT virtual occ::handle<CDM_MetaData> MetaData(
0083     const TCollection_ExtendedString& aFolder,
0084     const TCollection_ExtendedString& aName,
0085     const TCollection_ExtendedString& aVersion) = 0;
0086 
0087   //! by default returns aMetaDATA
0088   //! should return the MetaData stored in the DBMS with the meta-data
0089   //! corresponding to the path. If the MetaDataDriver has version management capabilities
0090   //! the version has to be set in the returned MetaData.
0091   //! MetaData is called by GetMetaData
0092   //! If the version is not included in the path, MetaData should return
0093   //! the last version of the metadata
0094   //! is deferred;
0095   Standard_EXPORT virtual occ::handle<CDM_MetaData> LastVersion(
0096     const occ::handle<CDM_MetaData>& aMetaData);
0097 
0098   //! should create meta-data corresponding to aData and maintaining a meta-link
0099   //! between these meta-data and aFileName
0100   //! CreateMetaData is called by CreateData
0101   //! If the metadata-driver
0102   //! has version capabilities, version must be set in the returned Data.
0103   Standard_EXPORT virtual occ::handle<CDM_MetaData> CreateMetaData(
0104     const occ::handle<CDM_Document>&  aDocument,
0105     const TCollection_ExtendedString& aFileName) = 0;
0106 
0107   Standard_EXPORT virtual bool FindFolder(const TCollection_ExtendedString& aFolder) = 0;
0108 
0109   Standard_EXPORT virtual TCollection_ExtendedString DefaultFolder() = 0;
0110 
0111   Standard_EXPORT virtual occ::handle<PCDM_ReferenceIterator> ReferenceIterator(
0112     const occ::handle<Message_Messenger>& theMessageDriver);
0113 
0114   //! calls Find with an empty version
0115   Standard_EXPORT bool Find(const TCollection_ExtendedString& aFolder,
0116                             const TCollection_ExtendedString& aName);
0117 
0118   //! calls MetaData with an empty version
0119   Standard_EXPORT occ::handle<CDM_MetaData> MetaData(const TCollection_ExtendedString& aFolder,
0120                                                      const TCollection_ExtendedString& aName);
0121 
0122   DEFINE_STANDARD_RTTIEXT(CDF_MetaDataDriver, Standard_Transient)
0123 
0124 protected:
0125   Standard_EXPORT CDF_MetaDataDriver();
0126 };
0127 
0128 #endif // _CDF_MetaDataDriver_HeaderFile