1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,78 +0,0 @@
-- Created on: 1997-08-07
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package CDF
uses CDM, PCDM, TCollection, TColStd, Resource, Quantity, OSD
is
class Directory;
class DirectoryIterator;
class Session;
enumeration TypeOfActivation is TOA_New,TOA_Modified,TOA_Unchanged
end TypeOfActivation from CDF;
deferred class Application;
private class StoreList;
---Category: API for Store and retrieve
--
class Store;
enumeration TryStoreStatus is TS_OK,TS_NoCurrentDocument,TS_NoDriver,TS_NoSubComponentDriver
end TryStoreStatus;
enumeration SubComponentStatus is SCS_Consistent, SCS_Unconsistent,SCS_Stored,SCS_Modified
end SubComponentStatus;
enumeration StoreSetNameStatus is
SSNS_OK,
SSNS_ReplacingAnExistentDocument,
SSNS_OpenDocument
end StoreSetNameStatus;
---Category: MetaData management
--
deferred class MetaDataDriver;
class FWOSDriver;
exception MetaDataDriverError inherits Failure from Standard;
---Purpose: this exception is used in the deferred methods.
-- Programmer implementing such methods may use this
-- exception or any exception inheriting MetaDataDriverError.
deferred class MetaDataDriverFactory;
private class Timer;
GetLicense(anApplicationIdentifier: Integer from Standard);
IsAvailable(anApplicationIdentifier: Integer from Standard)
returns Boolean from Standard;
end CDF;

View File

@@ -14,7 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF.ixx>
#include <CDF.hxx>
#include <Standard_Failure.hxx>
static void CDF_InitApplication () {

83
src/CDF/CDF.hxx Normal file
View File

@@ -0,0 +1,83 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_HeaderFile
#define _CDF_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class CDF_Directory;
class CDF_DirectoryIterator;
class CDF_Session;
class CDF_Application;
class CDF_StoreList;
class CDF_Store;
class CDF_MetaDataDriver;
class CDF_FWOSDriver;
class CDF_MetaDataDriverFactory;
class CDF_Timer;
class CDF
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static void GetLicense (const Standard_Integer anApplicationIdentifier);
Standard_EXPORT static Standard_Boolean IsAvailable (const Standard_Integer anApplicationIdentifier);
protected:
private:
friend class CDF_Directory;
friend class CDF_DirectoryIterator;
friend class CDF_Session;
friend class CDF_Application;
friend class CDF_StoreList;
friend class CDF_Store;
friend class CDF_MetaDataDriver;
friend class CDF_FWOSDriver;
friend class CDF_MetaDataDriverFactory;
friend class CDF_Timer;
};
#endif // _CDF_HeaderFile

View File

@@ -1,224 +0,0 @@
-- Created on: 1997-08-07
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class Application from CDF inherits Application from CDM
uses
ExtendedString from TCollection,
ExtendedString from TCollection,
Document from CDM,
Manager from Resource,
MetaData from CDM,
ReaderStatus from PCDM,
GUID from Standard,
Reader from PCDM,
Writer from PCDM,
TypeOfActivation from CDF,
SequenceOfExtendedString from TColStd,
CanCloseStatus from CDM,
AsciiString from TCollection
raises NoSuchObject from Standard
is
Initialize;
Load(myclass; aGUID:GUID from Standard)
returns Application from CDF;
---Purpose: plugs an application.
---Category: Open closing of documents
---Purpose:
-- Open is used
-- - for opening a Document that has been created in an application
-- - for opening a Document from the database
-- - for opening a Document from a file.
-- The Open methods always add the document in the session directory and
-- calls the virtual Activate method. The document is considered to be
-- opened until Close is used. To be storable, a document must be
-- opened by an application since the application resources are
-- needed to store it.
--
--
--
--
Open(me: mutable; aDocument: Document from CDM);
---Purpose: puts the document in the current session directory
-- and calls the virtual method Activate on it.
CanClose(me: mutable; aDocument: Document from CDM)
returns CanCloseStatus from CDM;
Close(me: mutable; aDocument: Document from CDM);
---Purpose: removes the document of the current session directory
-- and closes the document;
Retrieve (me: mutable; aFolder, aName: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True)
returns Document from CDM;
---Purpose: This method retrieves a document from the database.
-- If the Document references other documents which have
-- been updated, the latest version of these documents will
-- be used if {UseStorageConfiguration} is Standard_True.
-- The content of {aFolder}, {aName} and {aVersion} depends on
-- the Database Manager system. If the DBMS is only based on
-- the OS, {aFolder} is a directory and {aName} is the name of a
-- file. In this case the use of the syntax with {aVersion}
-- has no sense. For example:
--
-- Handle(CDM_Document) theDocument=myApplication->Retrieve("/home/cascade","box.dsg");
-- If the DBMS is EUCLID/Design Manager, {aFolder}, {aName}
-- have the form they have in EUCLID/Design Manager. For example:
--
-- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box");
--
-- Since the version is not specified in this syntax, the latest wil be used.
-- A link is kept with the database through an instance of CDM_MetaData
Retrieve (me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True)
returns Document from CDM;
---Purpose: This method retrieves a document from the database.
-- If the Document references other documents which have
-- been updated, the latest version of these documents
-- will be used if {UseStorageConfiguration} is
-- Standard_True. -- If the DBMS is only based on the
-- OS, this syntax should not be used.
--
-- If the DBMS is EUCLID/Design Manager, {aFolder}, {aName}
-- and {aVersion} have the form they have in
-- EUCLID/Design Manager. For example:
--
-- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box","2");
-- A link is kept with the database through an instance
-- of CDM_MetaData
CanRetrieve(me: mutable; aFolder, aName: ExtendedString from TCollection)
---Purpose:
returns ReaderStatus from PCDM;
CanRetrieve(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
---Purpose:
returns ReaderStatus from PCDM;
Formats(me: mutable; Formats: out SequenceOfExtendedString from TColStd)
is deferred;
---Category: CurrentDocument methods.
--
GetRetrieveStatus(me) returns ReaderStatus from PCDM;
---C++: inline
---Purpose: Checks status after Retrieve
---Category: Store&Retrieve virtuals methods
Activate(me: mutable; aDocument: Document from CDM; aTypeOfActivation: TypeOfActivation from CDF)
is virtual private;
---Purpose: Informs the application that aDocument has been
-- activated. A document is activated when it is created or
-- retrieved.
-- aTypeOfActivation will be:
-- - CDF_TOA_New if the document is a new one
-- (even empty or retrieved from the database for
-- the first time).
-- - CDF_TOA_Unchanged if the document was already
-- retrieved but had no changes since the previous retrieval.
-- - CDF_TOA_Modified if the document was already
-- retrieved and modified since the previous retrieval.
-- You do not need to call <Activate>, but you should redefine
-- this method to implement application specific behavior.
---Category: methods to get storage/retrieval driver.
--
--
FindReader(me: mutable; aFileName: ExtendedString from TCollection)
returns Boolean from Standard;
Reader(me: mutable; aFileName: ExtendedString from TCollection)
returns Reader from PCDM
raises NoSuchObject from Standard;
FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection)
returns Boolean from Standard;
ReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection)
returns Reader from PCDM
raises NoSuchObject from Standard;
---Purpose:
Format (me : mutable; aFileName : ExtendedString from TCollection;
theFormat : out ExtendedString from TCollection)
---Purpose: try to retrieve a Format directly in the file or in
-- application resource by using extension. returns
-- True if found;
returns Boolean from Standard;
---Category: Default Storage folder
--
DefaultFolder(me: mutable) returns ExtString from Standard;
SetDefaultFolder(me: mutable; aFolder: ExtString from Standard)
returns Boolean from Standard;
DefaultExtension(me: mutable) returns ExtString from Standard;
---Category: private methods
Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard)
returns Document from CDM
is private;
Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard; IsComponent: Boolean from Standard)
returns Document from CDM
is private;
DocumentVersion(me: mutable; theMetaData: MetaData from CDM)
returns Integer from Standard
is private;
FindReader(me: mutable; aFileName: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection)
returns Boolean from Standard
is private;
FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection)
returns Boolean from Standard
is private;
TypeOfActivation(me: mutable; aMetaData: MetaData from CDM)
returns TypeOfActivation from CDF
is private;
CanRetrieve(me: mutable; aMetaData: MetaData from CDM)
returns ReaderStatus from PCDM
is private;
fields
myDefaultFolder: ExtendedString from TCollection;
myRetrievableStatus : ReaderStatus from PCDM is protected;
friends
class Session from CDF--,
--class CheckDocumentToStore from CDF
end Application from CDF;

View File

@@ -16,29 +16,28 @@
// Modified by rmi, Wed Jan 14 08:17:35 1998
#include <CDF_Application.ixx>
#include <Standard_ErrorHandler.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_GUID.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_CanCloseStatus.hxx>
#include <CDF_Session.hxx>
#include <CDF_Application.hxx>
#include <CDF_Directory.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <CDF_Session.hxx>
#include <CDF_Timer.hxx>
#include <CDM_CanCloseStatus.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <PCDM_Reader.hxx>
#include <PCDM_ReaderStatus.hxx>
#include <PCDM_ReadWriter.hxx>
#include <PCDM_RetrievalDriver.hxx>
#include <PCDM_StorageDriver.hxx>
#include <Plugin.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_GUID.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <UTL.hxx>
#include <CDF_Timer.hxx>
#include <PCDM_Reader.hxx>
#define theMetaDataDriver CDF_Session::CurrentSession()->MetaDataDriver()

196
src/CDF/CDF_Application.hxx Normal file
View File

@@ -0,0 +1,196 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_Application_HeaderFile
#define _CDF_Application_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCDM_ReaderStatus.hxx>
#include <CDM_Application.hxx>
#include <CDM_CanCloseStatus.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <CDF_TypeOfActivation.hxx>
#include <Standard_ExtString.hxx>
#include <Standard_Integer.hxx>
class Standard_NoSuchObject;
class CDF_Session;
class Standard_GUID;
class CDM_Document;
class TCollection_ExtendedString;
class PCDM_Reader;
class CDM_MetaData;
class CDF_Application;
DEFINE_STANDARD_HANDLE(CDF_Application, CDM_Application)
class CDF_Application : public CDM_Application
{
public:
//! plugs an application.
//!
//! Open is used
//! - for opening a Document that has been created in an application
//! - for opening a Document from the database
//! - for opening a Document from a file.
//! The Open methods always add the document in the session directory and
//! calls the virtual Activate method. The document is considered to be
//! opened until Close is used. To be storable, a document must be
//! opened by an application since the application resources are
//! needed to store it.
Standard_EXPORT static Handle(CDF_Application) Load (const Standard_GUID& aGUID);
//! puts the document in the current session directory
//! and calls the virtual method Activate on it.
Standard_EXPORT void Open (const Handle(CDM_Document)& aDocument);
Standard_EXPORT CDM_CanCloseStatus CanClose (const Handle(CDM_Document)& aDocument);
//! removes the document of the current session directory
//! and closes the document;
Standard_EXPORT void Close (const Handle(CDM_Document)& aDocument);
//! This method retrieves a document from the database.
//! If the Document references other documents which have
//! been updated, the latest version of these documents will
//! be used if {UseStorageConfiguration} is Standard_True.
//! The content of {aFolder}, {aName} and {aVersion} depends on
//! the Database Manager system. If the DBMS is only based on
//! the OS, {aFolder} is a directory and {aName} is the name of a
//! file. In this case the use of the syntax with {aVersion}
//! has no sense. For example:
//!
//! Handle(CDM_Document) theDocument=myApplication->Retrieve("/home/cascade","box.dsg");
//! If the DBMS is EUCLID/Design Manager, {aFolder}, {aName}
//! have the form they have in EUCLID/Design Manager. For example:
//!
//! Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box");
//!
//! Since the version is not specified in this syntax, the latest wil be used.
//! A link is kept with the database through an instance of CDM_MetaData
Standard_EXPORT Handle(CDM_Document) Retrieve (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const Standard_Boolean UseStorageConfiguration = Standard_True);
//! This method retrieves a document from the database.
//! If the Document references other documents which have
//! been updated, the latest version of these documents
//! will be used if {UseStorageConfiguration} is
//! Standard_True. -- If the DBMS is only based on the
//! OS, this syntax should not be used.
//!
//! If the DBMS is EUCLID/Design Manager, {aFolder}, {aName}
//! and {aVersion} have the form they have in
//! EUCLID/Design Manager. For example:
//!
//! Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box","2");
//! A link is kept with the database through an instance
//! of CDM_MetaData
Standard_EXPORT Handle(CDM_Document) Retrieve (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion, const Standard_Boolean UseStorageConfiguration = Standard_True);
Standard_EXPORT PCDM_ReaderStatus CanRetrieve (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
Standard_EXPORT PCDM_ReaderStatus CanRetrieve (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion);
Standard_EXPORT virtual void Formats (TColStd_SequenceOfExtendedString& Formats) = 0;
//! Checks status after Retrieve
PCDM_ReaderStatus GetRetrieveStatus() const;
Standard_EXPORT Standard_Boolean FindReader (const TCollection_ExtendedString& aFileName);
Standard_EXPORT Handle(PCDM_Reader) Reader (const TCollection_ExtendedString& aFileName);
Standard_EXPORT Standard_Boolean FindReaderFromFormat (const TCollection_ExtendedString& aFormat);
Standard_EXPORT Handle(PCDM_Reader) ReaderFromFormat (const TCollection_ExtendedString& aFormat);
//! try to retrieve a Format directly in the file or in
//! application resource by using extension. returns
//! True if found;
Standard_EXPORT Standard_Boolean Format (const TCollection_ExtendedString& aFileName, TCollection_ExtendedString& theFormat);
Standard_EXPORT Standard_ExtString DefaultFolder();
Standard_EXPORT Standard_Boolean SetDefaultFolder (const Standard_ExtString aFolder);
Standard_EXPORT Standard_ExtString DefaultExtension();
friend class CDF_Session;
DEFINE_STANDARD_RTTI(CDF_Application,CDM_Application)
protected:
Standard_EXPORT CDF_Application();
PCDM_ReaderStatus myRetrievableStatus;
private:
//! Informs the application that aDocument has been
//! activated. A document is activated when it is created or
//! retrieved.
//! aTypeOfActivation will be:
//! - CDF_TOA_New if the document is a new one
//! (even empty or retrieved from the database for
//! the first time).
//! - CDF_TOA_Unchanged if the document was already
//! retrieved but had no changes since the previous retrieval.
//! - CDF_TOA_Modified if the document was already
//! retrieved and modified since the previous retrieval.
//! You do not need to call <Activate>, but you should redefine
//! this method to implement application specific behavior.
Standard_EXPORT virtual void Activate (const Handle(CDM_Document)& aDocument, const CDF_TypeOfActivation aTypeOfActivation);
Standard_EXPORT Handle(CDM_Document) Retrieve (const Handle(CDM_MetaData)& aMetaData, const Standard_Boolean UseStorageConfiguration);
Standard_EXPORT Handle(CDM_Document) Retrieve (const Handle(CDM_MetaData)& aMetaData, const Standard_Boolean UseStorageConfiguration, const Standard_Boolean IsComponent);
Standard_EXPORT Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& theMetaData);
Standard_EXPORT Standard_Boolean FindReader (const TCollection_ExtendedString& aFileName, Standard_GUID& PluginIn, TCollection_ExtendedString& ResourceName);
Standard_EXPORT Standard_Boolean FindReaderFromFormat (const TCollection_ExtendedString& aFormat, Standard_GUID& PluginIn, TCollection_ExtendedString& ResourceName);
Standard_EXPORT CDF_TypeOfActivation TypeOfActivation (const Handle(CDM_MetaData)& aMetaData);
Standard_EXPORT PCDM_ReaderStatus CanRetrieve (const Handle(CDM_MetaData)& aMetaData);
TCollection_ExtendedString myDefaultFolder;
};
#include <CDF_Application.lxx>
#endif // _CDF_Application_HeaderFile

View File

@@ -1,78 +0,0 @@
-- Created on: 1997-08-07
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Directory from CDF inherits Transient from Standard
---Purpose: A directory is a collection of documents. There is only one instance
-- of a given document in a directory.
-- put.
uses Document from CDM, ListOfDocument from CDM
raises NoSuchObject
is
Create
returns Directory from CDF;
---Purpose: Creates an empty directory.
Add(me:mutable; aDocument: Document from CDM);
---Purpose: adds a document into the directory.
Remove(me: mutable; aDocument: Document from CDM);
---Purpose: removes the document.
---Category: Inquire Methods
--
Contains(me; aDocument: Document from CDM)
---Purpose: Returns true if the document aDocument is in the directory
returns Boolean from Standard
is static;
Last(me:mutable) returns Document from CDM
---Purpose: returns the last document (if any) which has been added
-- in the directory.
raises NoSuchObject from Standard
---Warning: if the directory is empty.
is static;
Length(me) returns Integer from Standard
---Purpose: returns the number of documents of the directory.
is static;
IsEmpty(me) returns Boolean from Standard
---Purpose: returns true if the directory is empty.
is static;
---Category: Private methods
List(me) returns ListOfDocument from CDM
is static private;
---C++: return const &
--
fields
myDocuments: ListOfDocument from CDM;
friends
class DirectoryIterator from CDF
end Directory from CDF;

View File

@@ -14,9 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_Directory.ixx>
#include <CDF_Directory.hxx>
#include <CDF_DirectoryIterator.hxx>
#include <CDM_Document.hxx>
#include <CDM_ListIteratorOfListOfDocument.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
CDF_Directory::CDF_Directory () {}
void CDF_Directory::Add(const Handle(CDM_Document)& aDocument) {

93
src/CDF/CDF_Directory.hxx Normal file
View File

@@ -0,0 +1,93 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_Directory_HeaderFile
#define _CDF_Directory_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <CDM_ListOfDocument.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class Standard_NoSuchObject;
class CDF_DirectoryIterator;
class CDM_Document;
class CDF_Directory;
DEFINE_STANDARD_HANDLE(CDF_Directory, Standard_Transient)
//! A directory is a collection of documents. There is only one instance
//! of a given document in a directory.
//! put.
class CDF_Directory : public Standard_Transient
{
public:
//! Creates an empty directory.
Standard_EXPORT CDF_Directory();
//! adds a document into the directory.
Standard_EXPORT void Add (const Handle(CDM_Document)& aDocument);
//! removes the document.
Standard_EXPORT void Remove (const Handle(CDM_Document)& aDocument);
//! Returns true if the document aDocument is in the directory
Standard_EXPORT Standard_Boolean Contains (const Handle(CDM_Document)& aDocument) const;
//! returns the last document (if any) which has been added
//! in the directory.
Standard_EXPORT Handle(CDM_Document) Last();
//! returns the number of documents of the directory.
Standard_EXPORT Standard_Integer Length() const;
//! returns true if the directory is empty.
Standard_EXPORT Standard_Boolean IsEmpty() const;
friend class CDF_DirectoryIterator;
DEFINE_STANDARD_RTTI(CDF_Directory,Standard_Transient)
protected:
private:
Standard_EXPORT const CDM_ListOfDocument& List() const;
CDM_ListOfDocument myDocuments;
};
#endif // _CDF_Directory_HeaderFile

View File

@@ -1,50 +0,0 @@
-- Created on: 1997-08-13
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class DirectoryIterator from CDF
uses
Directory from CDF,
Document from CDM,
ListIteratorOfListOfDocument from CDM
raises
NoSuchObject from Standard
is
Create
returns DirectoryIterator from CDF;
---Purpose: creates an Iterator with the directory
-- of the current CDF.
Create(aDirectory: Directory from CDF)
returns DirectoryIterator from CDF;
MoreDocument (me: in out) returns Boolean from Standard;
---Purpose : Returns True if there are more entries to return
NextDocument (me: in out);
---Purpose : Go to the next entry
-- (if there is not, Value will raise an exception)
Document (me: in out) returns Document from CDM
---Purpose : Returns item value of current entry
raises NoSuchObject from Standard;
fields
myIterator: ListIteratorOfListOfDocument from CDM;
end DirectoryIterator from CDF;

View File

@@ -14,8 +14,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_DirectoryIterator.ixx>
#include <CDF_Directory.hxx>
#include <CDF_DirectoryIterator.hxx>
#include <CDF_Session.hxx>
#include <CDM_Document.hxx>
#include <Standard_NoSuchObject.hxx>
CDF_DirectoryIterator::CDF_DirectoryIterator():myIterator(CDF_Session::CurrentSession()->Directory()->List()) {}

View File

@@ -0,0 +1,79 @@
// Created on: 1997-08-13
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_DirectoryIterator_HeaderFile
#define _CDF_DirectoryIterator_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <CDM_ListIteratorOfListOfDocument.hxx>
#include <Standard_Boolean.hxx>
class Standard_NoSuchObject;
class CDF_Directory;
class CDM_Document;
class CDF_DirectoryIterator
{
public:
DEFINE_STANDARD_ALLOC
//! creates an Iterator with the directory
//! of the current CDF.
Standard_EXPORT CDF_DirectoryIterator();
Standard_EXPORT CDF_DirectoryIterator(const Handle(CDF_Directory)& aDirectory);
//! Returns True if there are more entries to return
Standard_EXPORT Standard_Boolean MoreDocument();
//! Go to the next entry
//! (if there is not, Value will raise an exception)
Standard_EXPORT void NextDocument();
//! Returns item value of current entry
Standard_EXPORT Handle(CDM_Document) Document();
protected:
private:
CDM_ListIteratorOfListOfDocument myIterator;
};
#endif // _CDF_DirectoryIterator_HeaderFile

View File

@@ -1,68 +0,0 @@
-- Created on: 1997-01-22
-- Created by: Mister rmi
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class FWOSDriver from CDF inherits MetaDataDriver from CDF
uses
MetaData from CDM,
Document from CDM,
ExtendedString from TCollection
is
Create
returns FWOSDriver from CDF;
---Purpose: initializes the MetaDatadriver with its specific name.
Find(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
returns Boolean from Standard;
---Purpose: indicate whether a file exists corresponding to the folder and the name
HasReadPermission(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
returns Boolean from Standard;
MetaData(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
returns MetaData from CDM
is private;
CreateMetaData(me: mutable; aDocument: Document from CDM;
aFileName: ExtendedString from TCollection)
returns MetaData from CDM
is private;
FindFolder(me: mutable; aFolder: ExtendedString from TCollection)
returns Boolean from Standard;
DefaultFolder(me: mutable) returns ExtendedString from TCollection;
BuildFileName(me: mutable; aDocument: Document from CDM)
returns ExtendedString from TCollection;
Concatenate(myclass; aFolder,aName: ExtendedString from TCollection)
returns ExtendedString from TCollection
is private;
BuildMetaData(me: mutable; aFileName: ExtendedString from TCollection)
returns MetaData from CDM
is private;
SetName(me: mutable; aDocument: Document from CDM; aName: ExtendedString from TCollection)
returns ExtendedString from TCollection
is redefined;
end FWOSDriver from CDF;

View File

@@ -11,16 +11,20 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_FWOSDriver.ixx>
#include <TCollection_ExtendedString.hxx>
#include <OSD_Path.hxx>
#include <CDF_FWOSDriver.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <OSD_Directory.hxx>
#include <OSD_Protection.hxx>
#include <OSD_SingleProtection.hxx>
#include <OSD_File.hxx>
#include <OSD_FileNode.hxx>
#include <UTL.hxx>
#include <OSD_Path.hxx>
#include <OSD_Protection.hxx>
#include <OSD_SingleProtection.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <UTL.hxx>
#ifdef WNT
#include <tchar.h>
#endif // WNT

View File

@@ -0,0 +1,87 @@
// Created on: 1997-01-22
// Created by: Mister rmi
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_FWOSDriver_HeaderFile
#define _CDF_FWOSDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <Standard_Boolean.hxx>
class TCollection_ExtendedString;
class CDM_MetaData;
class CDM_Document;
class CDF_FWOSDriver;
DEFINE_STANDARD_HANDLE(CDF_FWOSDriver, CDF_MetaDataDriver)
class CDF_FWOSDriver : public CDF_MetaDataDriver
{
public:
//! initializes the MetaDatadriver with its specific name.
Standard_EXPORT CDF_FWOSDriver();
//! indicate whether a file exists corresponding to the folder and the name
Standard_EXPORT Standard_Boolean Find (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion);
Standard_EXPORT Standard_Boolean HasReadPermission (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion);
Standard_EXPORT Standard_Boolean FindFolder (const TCollection_ExtendedString& aFolder);
Standard_EXPORT TCollection_ExtendedString DefaultFolder();
Standard_EXPORT TCollection_ExtendedString BuildFileName (const Handle(CDM_Document)& aDocument);
Standard_EXPORT virtual TCollection_ExtendedString SetName (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aName) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(CDF_FWOSDriver,CDF_MetaDataDriver)
protected:
private:
Standard_EXPORT Handle(CDM_MetaData) MetaData (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion);
Standard_EXPORT Handle(CDM_MetaData) CreateMetaData (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName);
Standard_EXPORT static TCollection_ExtendedString Concatenate (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
Standard_EXPORT Handle(CDM_MetaData) BuildMetaData (const TCollection_ExtendedString& aFileName);
};
#endif // _CDF_FWOSDriver_HeaderFile

View File

@@ -1,147 +0,0 @@
-- Created on: 1997-11-17
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class MetaDataDriver from CDF inherits Transient from Standard
---Purpose: this class list the method that must be available for
-- a specific DBMS
uses
Document from CDM, MetaData from CDM,
ExtendedString from TCollection,
ReferenceIterator from PCDM
raises
NotImplemented from Standard
is
Initialize;
---Category: virtual methods
HasVersionCapability(me: mutable)
---Purpose: returns true if the MetaDataDriver can manage different
-- versions of a Data.
-- By default, returns Standard_False.
returns Boolean from Standard
is virtual;
CreateDependsOn(me: mutable; aFirstData: MetaData from CDM;
aSecondData: MetaData from CDM)
---Purpose: Creates a "Depends On" relation between two Datas.
-- By default does nothing
is virtual;
CreateReference(me: mutable; aFrom, aTo: MetaData from CDM; aReferenceIdentifier: Integer from Standard; aToDocumentVersion: Integer from Standard)
is virtual;
HasVersion(me: mutable; aFolder, aName: ExtendedString from TCollection)
returns Boolean from Standard
---Purpose: by default return Standard_True.
is virtual;
BuildFileName(me: mutable; aDocument: Document from CDM)
returns ExtendedString from TCollection
is deferred;
SetName(me: mutable; aDocument: Document from CDM; aName: ExtendedString from TCollection)
returns ExtendedString from TCollection
is virtual;
---Purpose: this methods is usefull if the name of an object --
-- depends on the metadatadriver. For example a Driver
-- -- based on the operating system can choose to add
-- the extension of file to create to the object.
---Category: Deferred methods
---Overview: inquiring can be made either using a folder, a name and eventually
-- a version
-- or a path which is the concatenation of a folder, a name and eventually
-- a version.
Find(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
returns Boolean from Standard
---Purpose: should indicate whether meta-data exist in the DBMS corresponding
-- to the Data.
-- aVersion may be NULL;
is deferred;
HasReadPermission(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
returns Boolean from Standard
is deferred;
MetaData(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
returns MetaData from CDM
---Purpose: should return the MetaData stored in the DBMS with the meta-data
-- corresponding to the Data. If the MetaDataDriver has version management capabilities
-- the version has to be set in the returned MetaData.
-- aVersion may be NULL
-- MetaData is called by GetMetaData
-- If the version is set to NULL, MetaData should return
-- the last version of the metadata
is deferred;
LastVersion(me: mutable; aMetaData: MetaData from CDM)
returns MetaData from CDM
is virtual;
---Purpose: by default returns aMetaDATA
-- MetaData(me: mutable; aPath: ExtendedString from TCollection)
-- returns MetaData from CDM
---Purpose: should return the MetaData stored in the DBMS with the meta-data
-- corresponding to the path. If the MetaDataDriver has version management capabilities
-- the version has to be set in the returned MetaData.
-- MetaData is called by GetMetaData
-- If the version is not included in the path , MetaData should return
-- the last version of the metadata
-- is deferred;
CreateMetaData(me: mutable; aDocument: Document from CDM;
aFileName: ExtendedString from TCollection)
---Purpose: should create meta-data corresponding to aData and maintaining a meta-link
-- between these meta-data and aFileName
-- CreateMetaData is called by CreateData
returns MetaData from CDM
---Purpose: If the metadata-driver
-- has version capabilities, version must be set in the returned Data.
is deferred;
FindFolder(me: mutable; aFolder: ExtendedString from TCollection)
returns Boolean from Standard
is deferred;
DefaultFolder(me: mutable) returns ExtendedString from TCollection
is deferred;
---Category: methods about references.
ReferenceIterator(me: mutable)
returns ReferenceIterator from PCDM
is virtual;
Find(me: mutable; aFolder, aName: ExtendedString from TCollection)
returns Boolean from Standard;
---Purpose: calls Find with an empty version
MetaData(me: mutable; aFolder, aName: ExtendedString from TCollection)
returns MetaData from CDM;
---Purpose: calls MetaData with an empty version
end MetaDataDriver from CDF;

View File

@@ -14,16 +14,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_MetaDataDriver.ixx>
#include <CDF_Application.hxx>
#include <CDF_Session.hxx>
#include <CDF_Application.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <CDF_Session.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <PCDM_ReferenceIterator.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
//=======================================================================
//function : CDF_MetaDataDriver
//purpose :
//=======================================================================
CDF_MetaDataDriver::CDF_MetaDataDriver() {}
//=======================================================================

View File

@@ -0,0 +1,136 @@
// Created on: 1997-11-17
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_MetaDataDriver_HeaderFile
#define _CDF_MetaDataDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class Standard_NotImplemented;
class CDM_MetaData;
class TCollection_ExtendedString;
class CDM_Document;
class PCDM_ReferenceIterator;
class CDF_MetaDataDriver;
DEFINE_STANDARD_HANDLE(CDF_MetaDataDriver, Standard_Transient)
//! this class list the method that must be available for
//! a specific DBMS
class CDF_MetaDataDriver : public Standard_Transient
{
public:
//! returns true if the MetaDataDriver can manage different
//! versions of a Data.
//! By default, returns Standard_False.
Standard_EXPORT virtual Standard_Boolean HasVersionCapability();
//! Creates a "Depends On" relation between two Datas.
//! By default does nothing
Standard_EXPORT virtual void CreateDependsOn (const Handle(CDM_MetaData)& aFirstData, const Handle(CDM_MetaData)& aSecondData);
Standard_EXPORT virtual void CreateReference (const Handle(CDM_MetaData)& aFrom, const Handle(CDM_MetaData)& aTo, const Standard_Integer aReferenceIdentifier, const Standard_Integer aToDocumentVersion);
//! by default return Standard_True.
Standard_EXPORT virtual Standard_Boolean HasVersion (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
Standard_EXPORT virtual TCollection_ExtendedString BuildFileName (const Handle(CDM_Document)& aDocument) = 0;
//! this methods is usefull if the name of an object --
//! depends on the metadatadriver. For example a Driver
//! -- based on the operating system can choose to add
//! the extension of file to create to the object.
Standard_EXPORT virtual TCollection_ExtendedString SetName (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aName);
//! should indicate whether meta-data exist in the DBMS corresponding
//! to the Data.
//! aVersion may be NULL;
Standard_EXPORT virtual Standard_Boolean Find (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion) = 0;
Standard_EXPORT virtual Standard_Boolean HasReadPermission (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion) = 0;
//! should return the MetaData stored in the DBMS with the meta-data
//! corresponding to the Data. If the MetaDataDriver has version management capabilities
//! the version has to be set in the returned MetaData.
//! aVersion may be NULL
//! MetaData is called by GetMetaData
//! If the version is set to NULL, MetaData should return
//! the last version of the metadata
Standard_EXPORT virtual Handle(CDM_MetaData) MetaData (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aVersion) = 0;
//! by default returns aMetaDATA
//! should return the MetaData stored in the DBMS with the meta-data
//! corresponding to the path. If the MetaDataDriver has version management capabilities
//! the version has to be set in the returned MetaData.
//! MetaData is called by GetMetaData
//! If the version is not included in the path , MetaData should return
//! the last version of the metadata
//! is deferred;
Standard_EXPORT virtual Handle(CDM_MetaData) LastVersion (const Handle(CDM_MetaData)& aMetaData);
//! should create meta-data corresponding to aData and maintaining a meta-link
//! between these meta-data and aFileName
//! CreateMetaData is called by CreateData
//! If the metadata-driver
//! has version capabilities, version must be set in the returned Data.
Standard_EXPORT virtual Handle(CDM_MetaData) CreateMetaData (const Handle(CDM_Document)& aDocument, const TCollection_ExtendedString& aFileName) = 0;
Standard_EXPORT virtual Standard_Boolean FindFolder (const TCollection_ExtendedString& aFolder) = 0;
Standard_EXPORT virtual TCollection_ExtendedString DefaultFolder() = 0;
Standard_EXPORT virtual Handle(PCDM_ReferenceIterator) ReferenceIterator();
//! calls Find with an empty version
Standard_EXPORT Standard_Boolean Find (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
//! calls MetaData with an empty version
Standard_EXPORT Handle(CDM_MetaData) MetaData (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName);
DEFINE_STANDARD_RTTI(CDF_MetaDataDriver,Standard_Transient)
protected:
Standard_EXPORT CDF_MetaDataDriver();
private:
};
#endif // _CDF_MetaDataDriver_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_MetaDataDriverError_HeaderFile
#define _CDF_MetaDataDriverError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Failure.hxx>
class CDF_MetaDataDriverError;
DEFINE_STANDARD_HANDLE(CDF_MetaDataDriverError, Standard_Failure)
#if !defined No_Exception && !defined No_CDF_MetaDataDriverError
#define CDF_MetaDataDriverError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) CDF_MetaDataDriverError::Raise(MESSAGE);
#else
#define CDF_MetaDataDriverError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(CDF_MetaDataDriverError, Standard_Failure)
#endif // _CDF_MetaDataDriverError_HeaderFile

View File

@@ -1,25 +0,0 @@
-- Created on: 1997-11-17
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class MetaDataDriverFactory from CDF inherits Transient from Standard
uses MetaDataDriver from CDF, ExtendedString from TCollection
is
Build(me)
returns MetaDataDriver from CDF
is deferred;
end MetaDataDriverFactory from CDF;

View File

@@ -14,4 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_MetaDataDriverFactory.ixx>
#include <CDF_MetaDataDriver.hxx>
#include <CDF_MetaDataDriverFactory.hxx>
#include <Standard_Type.hxx>

View File

@@ -0,0 +1,62 @@
// Created on: 1997-11-17
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_MetaDataDriverFactory_HeaderFile
#define _CDF_MetaDataDriverFactory_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
class CDF_MetaDataDriver;
class CDF_MetaDataDriverFactory;
DEFINE_STANDARD_HANDLE(CDF_MetaDataDriverFactory, Standard_Transient)
class CDF_MetaDataDriverFactory : public Standard_Transient
{
public:
Standard_EXPORT virtual Handle(CDF_MetaDataDriver) Build() const = 0;
DEFINE_STANDARD_RTTI(CDF_MetaDataDriverFactory,Standard_Transient)
protected:
private:
};
#endif // _CDF_MetaDataDriverFactory_HeaderFile

View File

@@ -1,75 +0,0 @@
-- Created on: 1997-08-07
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Session from CDF inherits Transient from Standard
uses
Directory from CDF,
ExtendedString from TCollection,
Application from CDF,
MetaDataDriver from CDF,
Writer from PCDM
raises
NoSuchObject from Standard,MultiplyDefined from Standard
is
Create returns Session from CDF
raises MultiplyDefined from Standard;
Exists(myclass)
--- Purpose: returns true if a session has been created.
returns Boolean from Standard;
CurrentSession(myclass) returns Session from CDF;
---Purpose: returns the only one instance of Session
-- that has been created.
Directory(me) returns Directory from CDF;
---Purpose: returns the directory of the session;
---Level: Public
---Category: current application management
HasCurrentApplication(me) returns Boolean from Standard;
CurrentApplication(me) returns Application from CDF
raises NoSuchObject from Standard;
SetCurrentApplication(me: mutable; anApplication: Application from CDF);
UnsetCurrentApplication(me: mutable);
---Category: database related methods
MetaDataDriver(me) returns MetaDataDriver from CDF
raises NoSuchObject from Standard;
LoadDriver(me: mutable);
fields
myDirectory : Directory from CDF;
myCurrentApplication : Application from CDF;
myHasCurrentApplication: Boolean from Standard;
myMetaDataDriver : MetaDataDriver from CDF;
friends
class Application from CDF
end Session from CDF;

View File

@@ -14,16 +14,23 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_Session.ixx>
#include <TCollection_ExtendedString.hxx>
#include <CDF_MetaDataDriverFactory.hxx>
#include <CDF_Application.hxx>
#include <CDF_Directory.hxx>
#include <CDF_FWOSDriver.hxx>
#include <Plugin.hxx>
#include <Standard_GUID.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <CDF_MetaDataDriverFactory.hxx>
#include <CDF_Session.hxx>
#include <PCDM.hxx>
#include <PCDM_Reader.hxx>
#include <Plugin.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_GUID.hxx>
#include <Standard_MultiplyDefined.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
static Handle(CDF_Session) CS;

94
src/CDF/CDF_Session.hxx Normal file
View File

@@ -0,0 +1,94 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_Session_HeaderFile
#define _CDF_Session_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Transient.hxx>
class CDF_Directory;
class CDF_Application;
class CDF_MetaDataDriver;
class Standard_NoSuchObject;
class Standard_MultiplyDefined;
class CDF_Session;
DEFINE_STANDARD_HANDLE(CDF_Session, Standard_Transient)
class CDF_Session : public Standard_Transient
{
public:
Standard_EXPORT CDF_Session();
//! returns true if a session has been created.
Standard_EXPORT static Standard_Boolean Exists();
//! returns the only one instance of Session
//! that has been created.
Standard_EXPORT static Handle(CDF_Session) CurrentSession();
//! returns the directory of the session;
Standard_EXPORT Handle(CDF_Directory) Directory() const;
Standard_EXPORT Standard_Boolean HasCurrentApplication() const;
Standard_EXPORT Handle(CDF_Application) CurrentApplication() const;
Standard_EXPORT void SetCurrentApplication (const Handle(CDF_Application)& anApplication);
Standard_EXPORT void UnsetCurrentApplication();
Standard_EXPORT Handle(CDF_MetaDataDriver) MetaDataDriver() const;
Standard_EXPORT void LoadDriver();
friend class CDF_Application;
DEFINE_STANDARD_RTTI(CDF_Session,Standard_Transient)
protected:
private:
Handle(CDF_Directory) myDirectory;
Handle(CDF_Application) myCurrentApplication;
Standard_Boolean myHasCurrentApplication;
Handle(CDF_MetaDataDriver) myMetaDataDriver;
};
#endif // _CDF_Session_HeaderFile

View File

@@ -1,197 +0,0 @@
-- Created on: 1995-11-13
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Store from CDF
uses Document from CDM,
TryStoreStatus from CDF,
StoreSetNameStatus from CDF,
SubComponentStatus from CDF,
ExtendedString from TCollection,
StoreList from CDF,
StoreStatus from PCDM,
ExtendedString from TCollection
is
Create is private;
Create (aDocument: Document from CDM)
returns Store from CDF;
---Purpose: creates a store list from the document of the current selection.
--
---Category: Checks methods
--
Check(me: in out)
---Purpose: Checks will make the following control. Check must be used before
-- using Create method. Check will not be done twice by Create.
--
-- 1) controls whether there is one document in the current selection.
-- 2) controls whether there is a storage driver for the document.
-- 3) controls whether the applicationdatatype associated with the driver
-- exists as metadata in the metadata manager (Design Manager for example).
-- 4) controls whether there is a storage driver for each subcomponents
-- of the document if there are. If the control fails for a subcomponent,
-- the control stops and name and type of this subcomponent can be get
-- with LastName method
-- 5) controls whether the applicationdatatype associated with the driver of
-- each subcomponent exists as metadata in the metadata manager
-- (Design Manager for example). If the control fails for a subcomponent,
-- the control stops and name and type of this subcomponent can be get
-- with LastName method
--
returns TryStoreStatus from CDF;
LastName(me) returns ExtString from Standard;
---Purpose: in the case of a subcomponent for which no storage driver exists,
-- returns the name of the subcomponent if there is one.
---Category: Inquire Methods
--
-- The store list contains one or more documents. One of them is the current document.
--
Folder(me)
returns ExtString from Standard;
---Purpose: returns the folder in which the current document will be stored.
Name(me) returns ExtString from Standard;
---Purpose: returns the name under which the current document will be stored
IsStored(me) returns Boolean from Standard;
---Purpose: returns true if the current document is already stored
IsModified(me) returns Boolean from Standard;
CurrentIsConsistent(me) returns Boolean from Standard;
IsConsistent(me) returns Boolean from Standard;
HasAPreviousVersion(me) returns Boolean from Standard;
PreviousVersion(me) returns ExtString from Standard;
IsMainDocument(me) returns Boolean from Standard;
---Purpose: returns true if the currentdocument is the main one, ie the document
-- of the current selection.
---Category: Set methods
--
SetFolder(me: in out; aFolder: ExtendedString from TCollection)
---Purpose: defines the folder in which the document should be
-- stored. returns Standard_True if the Folder exists,
-- Standard_False otherwise.
returns Boolean from Standard;
SetName(me: in out; aName: ExtString from Standard)
---Purpose: defines the name under which the document should be stored.
returns StoreSetNameStatus from CDF;
SetComment(me: in out; aComment: ExtString from Standard);
Comment(me) returns ExtString from Standard;
RecheckName(me: in out)
---Purpose: defines the name under which the document should be stored.
-- uses for example after modification of the folder.
returns StoreSetNameStatus from CDF;
SetPreviousVersion(me: in out; aPreviousVersion: ExtString from Standard)
returns Boolean from Standard;
Realize(me: in out);
Path(me) returns ExtString from Standard;
---Purpose: returns the complete path of the created meta-data.
MetaDataPath(me) returns ExtString from Standard;
---Purpose: returns the path of the previous store is the object
-- is already stored, otherwise an empty string;
Description(me) returns ExtString from Standard;
---Purpose: returns the description of the format of the main object.
---Category: subcomponents management.
InitComponent (me: in out);
---Purpose : Allows to Start a new Iteration from beginning
MoreComponent (me) returns Boolean from Standard;
---Purpose : Returns True if there are more entries to return
NextComponent (me: in out);
---Purpose : Go to the next entry
-- (if there is not, Value will raise an exception)
SetCurrent(me: in out);
Component (me) returns ExtString from Standard;
---Purpose : Returns item value of current entry
HasSubComponents(me) returns Boolean from Standard;
SubComponentStatus(me; aPresentation: ExtString from Standard)
returns SubComponentStatus from CDF;
SetCurrent(me: in out; aPresentation: ExtString from Standard);
SetMain(me: in out);
---Category: Status method
---Purpose: the two following methods can
-- be used just after Realize or Import -- method to know if
-- thes methods worked correctly, and if not why.
StoreStatus(me) returns StoreStatus from PCDM;
AssociatedStatusText(me) returns ExtString from Standard;
---Category: Private methods
FindDefault(me: in out) is private;
Init(me: in out) is private;
SetName(me: in out; aName: ExtendedString from TCollection)
---Purpose: defines the name under which the document should be stored.
returns StoreSetNameStatus from CDF;
---Category: compatibility
SetFolder(me: in out; aFolder: ExtString from Standard)
---Purpose: defines the folder in which the document should be
-- stored. returns Standard_True if the Folder exists,
-- Standard_False otherwise.
returns Boolean from Standard;
fields
myList: StoreList from CDF ;
myMainDocument: Document from CDM ;
myCurrentDocument: Document from CDM ;
myHasSubComponents: Boolean from Standard ;
myIsMainDocument: Boolean from Standard ;
myLastName: ExtendedString from TCollection;
myPath: ExtendedString from TCollection;
myText: ExtendedString from TCollection;
myStatus: StoreStatus from PCDM;
end Store from CDF;

View File

@@ -12,17 +12,20 @@
// commercial license or contractual agreement.
// Modified by rmi, Thu Dec 4 14:24:24 1997
#include <CDF_Store.ixx>
#include <CDF_Session.hxx>
#include <CDF_Application.hxx>
#include <PCDM_StoreStatus.hxx>
#include <CDF_StoreSetNameStatus.hxx>
#include <Standard_ProgramError.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <PCDM_StorageDriver.hxx>
#include <PCDM.hxx>
#include <TCollection_ExtendedString.hxx>
#include <CDF_Session.hxx>
#include <CDF_Store.hxx>
#include <CDF_StoreList.hxx>
#include <CDF_StoreSetNameStatus.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <PCDM.hxx>
#include <PCDM_StorageDriver.hxx>
#include <PCDM_StoreStatus.hxx>
#include <Standard_ProgramError.hxx>
#include <TCollection_ExtendedString.hxx>
#define theMetaDataDriver CDF_Session::CurrentSession()->MetaDataDriver()

198
src/CDF/CDF_Store.hxx Normal file
View File

@@ -0,0 +1,198 @@
// Created on: 1995-11-13
// Created by: Jean-Louis Frenkel
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_Store_HeaderFile
#define _CDF_Store_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCDM_StoreStatus.hxx>
#include <CDF_TryStoreStatus.hxx>
#include <Standard_ExtString.hxx>
#include <CDF_StoreSetNameStatus.hxx>
#include <CDF_SubComponentStatus.hxx>
class CDF_StoreList;
class CDM_Document;
class TCollection_ExtendedString;
class CDF_Store
{
public:
DEFINE_STANDARD_ALLOC
//! creates a store list from the document of the current selection.
Standard_EXPORT CDF_Store(const Handle(CDM_Document)& aDocument);
//! Checks will make the following control. Check must be used before
//! using Create method. Check will not be done twice by Create.
//!
//! 1) controls whether there is one document in the current selection.
//! 2) controls whether there is a storage driver for the document.
//! 3) controls whether the applicationdatatype associated with the driver
//! exists as metadata in the metadata manager (Design Manager for example).
//! 4) controls whether there is a storage driver for each subcomponents
//! of the document if there are. If the control fails for a subcomponent,
//! the control stops and name and type of this subcomponent can be get
//! with LastName method
//! 5) controls whether the applicationdatatype associated with the driver of
//! each subcomponent exists as metadata in the metadata manager
//! (Design Manager for example). If the control fails for a subcomponent,
//! the control stops and name and type of this subcomponent can be get
//! with LastName method
Standard_EXPORT CDF_TryStoreStatus Check();
//! in the case of a subcomponent for which no storage driver exists,
//! returns the name of the subcomponent if there is one.
Standard_EXPORT Standard_ExtString LastName() const;
//! returns the folder in which the current document will be stored.
Standard_EXPORT Standard_ExtString Folder() const;
//! returns the name under which the current document will be stored
Standard_EXPORT Standard_ExtString Name() const;
//! returns true if the current document is already stored
Standard_EXPORT Standard_Boolean IsStored() const;
Standard_EXPORT Standard_Boolean IsModified() const;
Standard_EXPORT Standard_Boolean CurrentIsConsistent() const;
Standard_EXPORT Standard_Boolean IsConsistent() const;
Standard_EXPORT Standard_Boolean HasAPreviousVersion() const;
Standard_EXPORT Standard_ExtString PreviousVersion() const;
//! returns true if the currentdocument is the main one, ie the document
//! of the current selection.
Standard_EXPORT Standard_Boolean IsMainDocument() const;
//! defines the folder in which the document should be
//! stored. returns Standard_True if the Folder exists,
//! Standard_False otherwise.
Standard_EXPORT Standard_Boolean SetFolder (const TCollection_ExtendedString& aFolder);
//! defines the name under which the document should be stored.
Standard_EXPORT CDF_StoreSetNameStatus SetName (const Standard_ExtString aName);
Standard_EXPORT void SetComment (const Standard_ExtString aComment);
Standard_EXPORT Standard_ExtString Comment() const;
//! defines the name under which the document should be stored.
//! uses for example after modification of the folder.
Standard_EXPORT CDF_StoreSetNameStatus RecheckName();
Standard_EXPORT Standard_Boolean SetPreviousVersion (const Standard_ExtString aPreviousVersion);
Standard_EXPORT void Realize();
//! returns the complete path of the created meta-data.
Standard_EXPORT Standard_ExtString Path() const;
//! returns the path of the previous store is the object
//! is already stored, otherwise an empty string;
Standard_EXPORT Standard_ExtString MetaDataPath() const;
//! returns the description of the format of the main object.
Standard_EXPORT Standard_ExtString Description() const;
//! Allows to Start a new Iteration from beginning
Standard_EXPORT void InitComponent();
//! Returns True if there are more entries to return
Standard_EXPORT Standard_Boolean MoreComponent() const;
//! Go to the next entry
//! (if there is not, Value will raise an exception)
Standard_EXPORT void NextComponent();
Standard_EXPORT void SetCurrent();
//! Returns item value of current entry
Standard_EXPORT Standard_ExtString Component() const;
Standard_EXPORT Standard_Boolean HasSubComponents() const;
Standard_EXPORT CDF_SubComponentStatus SubComponentStatus (const Standard_ExtString aPresentation) const;
Standard_EXPORT void SetCurrent (const Standard_ExtString aPresentation);
//! the two following methods can
//! be used just after Realize or Import -- method to know if
//! thes methods worked correctly, and if not why.
Standard_EXPORT void SetMain();
Standard_EXPORT PCDM_StoreStatus StoreStatus() const;
Standard_EXPORT Standard_ExtString AssociatedStatusText() const;
//! defines the name under which the document should be stored.
Standard_EXPORT CDF_StoreSetNameStatus SetName (const TCollection_ExtendedString& aName);
//! defines the folder in which the document should be
//! stored. returns Standard_True if the Folder exists,
//! Standard_False otherwise.
Standard_EXPORT Standard_Boolean SetFolder (const Standard_ExtString aFolder);
protected:
private:
Standard_EXPORT CDF_Store();
Standard_EXPORT void FindDefault();
Standard_EXPORT void Init();
Handle(CDF_StoreList) myList;
Handle(CDM_Document) myMainDocument;
Handle(CDM_Document) myCurrentDocument;
Standard_Boolean myHasSubComponents;
Standard_Boolean myIsMainDocument;
TCollection_ExtendedString myLastName;
TCollection_ExtendedString myPath;
TCollection_ExtendedString myText;
PCDM_StoreStatus myStatus;
};
#endif // _CDF_Store_HeaderFile

View File

@@ -1,65 +0,0 @@
-- Created on: 1995-03-22
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class StoreList from CDF inherits Transient from Standard
uses
Document from CDM,
ListOfDocument from CDM,
MapOfDocument from CDM,
MapIteratorOfMapOfDocument from CDM,
MetaData from CDM,
ExtendedString from TCollection,
StoreStatus from PCDM
raises NoSuchObject from Standard
is
Create(aDocument: Document from CDM)
returns StoreList from CDF;
IsConsistent(me) returns Boolean from Standard;
Store(me: mutable; aMetaData: out MetaData from CDM;
aStatusAssociatedText: out ExtendedString from TCollection)
returns StoreStatus from PCDM
---Purpose: stores each object of the storelist in the reverse
-- order of which they had been added.
raises NoSuchObject from Standard;
---Warning: if the active dbunit cannot be found
---Category: Private methods.
Add(me: mutable; aDocument: Document from CDM)
is private;
---Category: iteration methods
Init(me: mutable);
More(me) returns Boolean from Standard;
Next(me: mutable);
Value(me) returns Document from CDM;
fields
myItems: MapOfDocument from CDM;
myStack: ListOfDocument from CDM;
myIterator: MapIteratorOfMapOfDocument from CDM;
myMainDocument: Document from CDM;
end StoreList from CDF;

View File

@@ -14,23 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_StoreList.ixx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Macro.hxx>
#include <CDF_Application.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <CDF_MetaDataDriverError.hxx>
#include <CDF_Session.hxx>
#include <CDF_StoreList.hxx>
#include <CDF_Timer.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_ReferenceIterator.hxx>
#include <PCDM.hxx>
#include <PCDM_Document.hxx>
#include <PCDM_StorageDriver.hxx>
#include <CDF_MetaDataDriverError.hxx>
#include <CDF_MetaDataDriver.hxx>
#include <CDF_Session.hxx>
#include <CDF_Application.hxx>
#include <CDF_Timer.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Macro.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
static void CAUGHT(TCollection_ExtendedString& status,const TCollection_ExtendedString& what) {
Handle(Standard_Failure) F = Standard_Failure::Caught();

90
src/CDF/CDF_StoreList.hxx Normal file
View File

@@ -0,0 +1,90 @@
// Created on: 1995-03-22
// Created by: Jean-Louis Frenkel
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_StoreList_HeaderFile
#define _CDF_StoreList_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <CDM_MapOfDocument.hxx>
#include <CDM_ListOfDocument.hxx>
#include <CDM_MapIteratorOfMapOfDocument.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
#include <PCDM_StoreStatus.hxx>
class CDM_Document;
class Standard_NoSuchObject;
class CDM_MetaData;
class TCollection_ExtendedString;
class CDF_StoreList;
DEFINE_STANDARD_HANDLE(CDF_StoreList, Standard_Transient)
class CDF_StoreList : public Standard_Transient
{
public:
Standard_EXPORT CDF_StoreList(const Handle(CDM_Document)& aDocument);
Standard_EXPORT Standard_Boolean IsConsistent() const;
//! stores each object of the storelist in the reverse
//! order of which they had been added.
Standard_EXPORT PCDM_StoreStatus Store (Handle(CDM_MetaData)& aMetaData, TCollection_ExtendedString& aStatusAssociatedText);
Standard_EXPORT void Init();
Standard_EXPORT Standard_Boolean More() const;
Standard_EXPORT void Next();
Standard_EXPORT Handle(CDM_Document) Value() const;
DEFINE_STANDARD_RTTI(CDF_StoreList,Standard_Transient)
protected:
private:
Standard_EXPORT void Add (const Handle(CDM_Document)& aDocument);
CDM_MapOfDocument myItems;
CDM_ListOfDocument myStack;
CDM_MapIteratorOfMapOfDocument myIterator;
Handle(CDM_Document) myMainDocument;
};
#endif // _CDF_StoreList_HeaderFile

View File

@@ -0,0 +1,28 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_StoreSetNameStatus_HeaderFile
#define _CDF_StoreSetNameStatus_HeaderFile
enum CDF_StoreSetNameStatus
{
CDF_SSNS_OK,
CDF_SSNS_ReplacingAnExistentDocument,
CDF_SSNS_OpenDocument
};
#endif // _CDF_StoreSetNameStatus_HeaderFile

View File

@@ -0,0 +1,29 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_SubComponentStatus_HeaderFile
#define _CDF_SubComponentStatus_HeaderFile
enum CDF_SubComponentStatus
{
CDF_SCS_Consistent,
CDF_SCS_Unconsistent,
CDF_SCS_Stored,
CDF_SCS_Modified
};
#endif // _CDF_SubComponentStatus_HeaderFile

View File

@@ -1,35 +0,0 @@
-- Created on: 1998-07-17
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1998-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class Timer from CDF
uses Timer from OSD
is
Create returns Timer from CDF;
ShowAndRestart(me: in out; aMessage: CString from Standard);
ShowAndStop(me: in out; aMessage: CString from Standard);
Show(me: in out; aMessage: CString from Standard)
is private;
MustShow(me: in out) returns Boolean from Standard;
fields
myTimer: Timer from OSD;
end Timer from OSD;

View File

@@ -14,9 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDF_Timer.ixx>
#include <stdlib.h>
#include <CDF_Timer.hxx>
#include <stdlib.h>
CDF_Timer::CDF_Timer() {
myTimer.Start();
}

71
src/CDF/CDF_Timer.hxx Normal file
View File

@@ -0,0 +1,71 @@
// Created on: 1998-07-17
// Created by: Jean-Louis Frenkel
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_Timer_HeaderFile
#define _CDF_Timer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <OSD_Timer.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
class CDF_Timer
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT CDF_Timer();
Standard_EXPORT void ShowAndRestart (const Standard_CString aMessage);
Standard_EXPORT void ShowAndStop (const Standard_CString aMessage);
Standard_EXPORT Standard_Boolean MustShow();
protected:
private:
Standard_EXPORT void Show (const Standard_CString aMessage);
OSD_Timer myTimer;
};
#endif // _CDF_Timer_HeaderFile

View File

@@ -0,0 +1,29 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_TryStoreStatus_HeaderFile
#define _CDF_TryStoreStatus_HeaderFile
enum CDF_TryStoreStatus
{
CDF_TS_OK,
CDF_TS_NoCurrentDocument,
CDF_TS_NoDriver,
CDF_TS_NoSubComponentDriver
};
#endif // _CDF_TryStoreStatus_HeaderFile

View File

@@ -0,0 +1,28 @@
// Created on: 1997-08-07
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _CDF_TypeOfActivation_HeaderFile
#define _CDF_TypeOfActivation_HeaderFile
enum CDF_TypeOfActivation
{
CDF_TOA_New,
CDF_TOA_Modified,
CDF_TOA_Unchanged
};
#endif // _CDF_TypeOfActivation_HeaderFile

View File

@@ -1 +1,29 @@
CDF.cxx
CDF.hxx
CDF_Application.cxx
CDF_Application.hxx
CDF_Application.lxx
CDF_Directory.cxx
CDF_Directory.hxx
CDF_DirectoryIterator.cxx
CDF_DirectoryIterator.hxx
CDF_FWOSDriver.cxx
CDF_FWOSDriver.hxx
CDF_MetaDataDriver.cxx
CDF_MetaDataDriver.hxx
CDF_MetaDataDriverError.hxx
CDF_MetaDataDriverFactory.cxx
CDF_MetaDataDriverFactory.hxx
CDF_Session.cxx
CDF_Session.hxx
CDF_Store.cxx
CDF_Store.hxx
CDF_StoreList.cxx
CDF_StoreList.hxx
CDF_StoreSetNameStatus.hxx
CDF_SubComponentStatus.hxx
CDF_Timer.cxx
CDF_Timer.hxx
CDF_TryStoreStatus.hxx
CDF_TypeOfActivation.hxx
EXTERNLIB