Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:20

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 class CDF_MetaDataDriver;
0029 DEFINE_STANDARD_HANDLE(CDF_MetaDataDriver, Standard_Transient)
0030 
0031 //! this class list the method that must be available for
0032 //! a specific DBMS
0033 class CDF_MetaDataDriver : public Standard_Transient
0034 {
0035 
0036 public:
0037 
0038   
0039   //! returns true if the MetaDataDriver can manage different
0040   //! versions of a Data.
0041   //! By default, returns Standard_False.
0042   Standard_EXPORT virtual Standard_Boolean HasVersionCapability();
0043   
0044   //! Creates a "Depends On"  relation between two Datas.
0045   //! By default does nothing
0046   Standard_EXPORT virtual void CreateDependsOn (const Handle(CDM_MetaData)& aFirstData, const Handle(CDM_MetaData)& aSecondData);
0047   
0048   Standard_EXPORT virtual void CreateReference (const Handle(CDM_MetaData)& aFrom, const Handle(CDM_MetaData)& aTo, const Standard_Integer aReferenceIdentifier, const Standard_Integer aToDocumentVersion);
0049   
0050   //! by default return Standard_True.
0051   Standard_EXPORT virtual Standard_Boolean HasVersion (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
0052   
0053   Standard_EXPORT virtual TCollection_ExtendedString BuildFileName (const Handle(CDM_Document)& aDocument) = 0;
0054   
0055   //! this method is useful if the name of an object --
0056   //! depends on the metadatadriver. For  example a Driver
0057   //! -- based  on the operating  system can choose to  add
0058   //! the extension of file to create to the object.
0059   Standard_EXPORT virtual TCollection_ExtendedString SetName (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aName);
0060   
0061   //! should indicate whether meta-data exist in the DBMS corresponding
0062   //! to the Data.
0063   //! aVersion may be NULL;
0064   Standard_EXPORT virtual Standard_Boolean Find (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion) = 0;
0065   
0066   Standard_EXPORT virtual Standard_Boolean HasReadPermission (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion) = 0;
0067   
0068   //! should return the MetaData stored in the DBMS with the meta-data
0069   //! corresponding to the Data. If the MetaDataDriver has version management capabilities
0070   //! the version has to be set in the returned MetaData.
0071   //! aVersion may be NULL
0072   //! MetaData is called by GetMetaData
0073   //! If the version is  set to NULL, MetaData should return
0074   //! the last version of the metadata
0075   Standard_EXPORT virtual Handle(CDM_MetaData) MetaData (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion) = 0;
0076   
0077   //! by default returns aMetaDATA
0078   //! should return the MetaData stored in the DBMS with the meta-data
0079   //! corresponding to the path. If the MetaDataDriver has version management capabilities
0080   //! the version has to be set in the returned MetaData.
0081   //! MetaData is called by GetMetaData
0082   //! If the version is not included in the path , MetaData should return
0083   //! the last version of the metadata
0084   //! is deferred;
0085   Standard_EXPORT virtual Handle(CDM_MetaData) LastVersion (const Handle(CDM_MetaData)& aMetaData);
0086   
0087   //! should create meta-data corresponding to aData and maintaining a meta-link
0088   //! between these meta-data and aFileName
0089   //! CreateMetaData is called by CreateData
0090   //! If the metadata-driver
0091   //! has version capabilities, version must be set in the returned Data.
0092   Standard_EXPORT virtual Handle(CDM_MetaData) CreateMetaData (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName) = 0;
0093   
0094   Standard_EXPORT virtual Standard_Boolean FindFolder (const TCollection_ExtendedString& aFolder) = 0;
0095   
0096   Standard_EXPORT virtual TCollection_ExtendedString DefaultFolder() = 0;
0097   
0098   Standard_EXPORT virtual Handle(PCDM_ReferenceIterator) ReferenceIterator(const Handle(Message_Messenger)& theMessageDriver);
0099   
0100   //! calls Find with an empty version
0101   Standard_EXPORT Standard_Boolean Find (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
0102   
0103   //! calls MetaData with an empty version
0104   Standard_EXPORT Handle(CDM_MetaData) MetaData (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
0105 
0106 
0107 
0108 
0109   DEFINE_STANDARD_RTTIEXT(CDF_MetaDataDriver,Standard_Transient)
0110 
0111 protected:
0112 
0113   
0114   Standard_EXPORT CDF_MetaDataDriver();
0115 
0116 
0117 
0118 private:
0119 
0120 
0121 
0122 
0123 };
0124 
0125 
0126 
0127 
0128 
0129 
0130 
0131 #endif // _CDF_MetaDataDriver_HeaderFile