1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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,72 +0,0 @@
-- Created on: 1997-05-06
-- Created by: Jean-Louis Frenkel, Remi Lequette
-- 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 CDM
uses TCollection,TColStd,Resource
is
enumeration CanCloseStatus is CCS_OK, CCS_NotOpen, CCS_UnstoredReferenced,CCS_ModifiedReferenced,CCS_ReferenceRejection
end CanCloseStatus from CDM;
class MetaData;
deferred class MessageDriver;
deferred class Document;
class ReferenceIterator;
class NullMessageDriver;
class COutMessageDriver;
---Category: classes to manager automatic naming of documents.
private alias NamesDirectory is DataMapOfStringInteger from TColStd;
---Purpose: this map will allows to get a directory object from a name.
imported PresentationDirectory;
imported DataMapIteratorOfPresentationDirectory;
---Purpose: this map will allows to get a directory object from a name.
private pointer DocumentPointer to Document from CDM;
private class Reference;
imported ListOfReferences;
imported ListIteratorOfListOfReferences;
deferred class Application;
imported MetaDataLookUpTable;
imported DataMapIteratorOfMetaDataLookUpTable;
---Category: reusable classes
imported DocumentHasher;
imported MapOfDocument;
imported MapIteratorOfMapOfDocument;
imported ListOfDocument;
imported ListIteratorOfListOfDocument;
end CDM;

View File

@@ -1,74 +0,0 @@
-- Created on: 1997-10-22
-- 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.
---Copy: Matra Datavision 1997
deferred class Application from CDM inherits Transient from Standard
uses Document from CDM,
MetaData from CDM,
Reference from CDM,
MessageDriver from CDM,
Manager from Resource,
ExtendedString from TCollection
is
Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard)
returns Document from CDM
is deferred private;
DocumentVersion(me: mutable; aMetaData: MetaData from CDM)
returns Integer from Standard
is deferred private;
---Purpose: returns -1 if the metadata has no modification counter.
SetDocumentVersion(me; aDocument: Document from CDM; aMetaData: MetaData from CDM)
is protected;
SetReferenceCounter(me:mutable ; aDocument: Document from CDM; aReferenceCounter: Integer from Standard)
is protected;
Resources(me: mutable)
returns Manager from Resource
is deferred;
---Purpose: the manager returned by this virtual method will be
-- used to search for Format`.Retrieval resource items.
--
MessageDriver(me: mutable) returns MessageDriver from CDM
is virtual;
---Purpose: By default returns a NullMessageDriver;
BeginOfUpdate(me:mutable; aDocument: Document from CDM)
is virtual;
---Purpose: this method is called before the update of a document.
-- By default, writes in MessageDriver().
EndOfUpdate(me:mutable; aDocument: Document from CDM; Status: Boolean from Standard; ErrorString: ExtendedString from TCollection)
is virtual;
---Purpose: this method is called affter the update of a document.
-- By default, writes in MessageDriver().
Write(me: mutable; aString: ExtString from Standard);
---Purpose: writes the string in the application MessagerDriver.
friends
class Reference from CDM,
class MetaData from CDM
end Application from CDM;

View File

@@ -14,14 +14,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDM_Application.ixx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <CDM_MessageDriver.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_NullMessageDriver.hxx>
#include <CDM_Reference.hxx>
#include <Resource_Manager.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
//=======================================================================
//function : SetDocumentVersion
//purpose :
//=======================================================================
void CDM_Application::SetDocumentVersion
(const Handle(CDM_Document)& aDocument,
const Handle(CDM_MetaData)& aMetaData) const

View File

@@ -0,0 +1,97 @@
// Created on: 1997-10-22
// 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 _CDM_Application_HeaderFile
#define _CDM_Application_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_ExtString.hxx>
class CDM_Reference;
class CDM_MetaData;
class CDM_Document;
class Resource_Manager;
class CDM_MessageDriver;
class TCollection_ExtendedString;
class CDM_Application;
DEFINE_STANDARD_HANDLE(CDM_Application, Standard_Transient)
class CDM_Application : public Standard_Transient
{
public:
//! the manager returned by this virtual method will be
//! used to search for Format`.Retrieval resource items.
Standard_EXPORT virtual Handle(Resource_Manager) Resources() = 0;
//! By default returns a NullMessageDriver;
Standard_EXPORT virtual Handle(CDM_MessageDriver) MessageDriver();
//! this method is called before the update of a document.
//! By default, writes in MessageDriver().
Standard_EXPORT virtual void BeginOfUpdate (const Handle(CDM_Document)& aDocument);
//! this method is called affter the update of a document.
//! By default, writes in MessageDriver().
Standard_EXPORT virtual void EndOfUpdate (const Handle(CDM_Document)& aDocument, const Standard_Boolean Status, const TCollection_ExtendedString& ErrorString);
//! writes the string in the application MessagerDriver.
Standard_EXPORT void Write (const Standard_ExtString aString);
friend class CDM_Reference;
friend class CDM_MetaData;
DEFINE_STANDARD_RTTI(CDM_Application,Standard_Transient)
protected:
Standard_EXPORT void SetDocumentVersion (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData) const;
Standard_EXPORT void SetReferenceCounter (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceCounter);
private:
Standard_EXPORT virtual Handle(CDM_Document) Retrieve (const Handle(CDM_MetaData)& aMetaData, const Standard_Boolean UseStorageConfiguration) = 0;
//! returns -1 if the metadata has no modification counter.
Standard_EXPORT virtual Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& aMetaData) = 0;
};
#endif // _CDM_Application_HeaderFile

View File

@@ -1,22 +0,0 @@
-- Created on: 2001-08-30
-- Created by: Alexander GRIGORIEV
-- Copyright (c) 2001-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 COutMessageDriver from CDM inherits MessageDriver from CDM
---Purpose: aMessageDriver for output to COUT (only ASCII strings)
is
Write (me:mutable; aString: ExtString from Standard);
end COutMessageDriver from CDM;

View File

@@ -13,13 +13,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDM_COutMessageDriver.ixx>
#include <CDM_COutMessageDriver.hxx>
#include <Standard_PCharacter.hxx>
#include <Standard_Type.hxx>
//=======================================================================
//function : Write
//purpose :
//=======================================================================
void CDM_COutMessageDriver::Write (const Standard_ExtString aString)
{
// Find the length of the input string

View File

@@ -0,0 +1,61 @@
// Created on: 2001-08-30
// Created by: Alexander GRIGORIEV
// Copyright (c) 2001-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 _CDM_COutMessageDriver_HeaderFile
#define _CDM_COutMessageDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <CDM_MessageDriver.hxx>
#include <Standard_ExtString.hxx>
class CDM_COutMessageDriver;
DEFINE_STANDARD_HANDLE(CDM_COutMessageDriver, CDM_MessageDriver)
//! aMessageDriver for output to COUT (only ASCII strings)
class CDM_COutMessageDriver : public CDM_MessageDriver
{
public:
Standard_EXPORT void Write (const Standard_ExtString aString);
DEFINE_STANDARD_RTTI(CDM_COutMessageDriver,CDM_MessageDriver)
protected:
private:
};
#endif // _CDM_COutMessageDriver_HeaderFile

View File

@@ -0,0 +1,30 @@
// Created on: 1997-05-06
// Created by: Jean-Louis Frenkel, Remi Lequette
// 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 _CDM_CanCloseStatus_HeaderFile
#define _CDM_CanCloseStatus_HeaderFile
enum CDM_CanCloseStatus
{
CDM_CCS_OK,
CDM_CCS_NotOpen,
CDM_CCS_UnstoredReferenced,
CDM_CCS_ModifiedReferenced,
CDM_CCS_ReferenceRejection
};
#endif // _CDM_CanCloseStatus_HeaderFile

View File

@@ -1,532 +0,0 @@
-- Created on: 1997-07-30
-- 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 Document from CDM
inherits Transient from Standard
---Purpose: An applicative document is an instance of a class inheriting CDM_Document.
-- These documents have the following properties:
-- - they can have references to other documents.
-- - the modifications of a document are propagated to the referencing
-- documents.
-- - a document can be stored in different formats, with or
-- without a persistent model.
-- - the drivers for storing and retrieving documents are
-- plugged in when necessary.
-- - a document has a modification counter. This counter is
-- incremented when the document is modified. When a document
-- is stored, the current counter value is memorized as the
-- last storage version of the document. A document is
-- considered to be modified when the counter value is
-- different from the storage version. Once the document is
-- saved the storage version and the counter value are
-- identical. The document is now not considered to be
-- modified.
-- - a reference is a link between two documents. A reference has two
-- components: the "From Document" and the "To Document". When
-- a reference is created, an identifier of the reference is generated.
-- This identifier is unique in the scope of the From Document and
-- is conserved during storage and retrieval. This means that the
-- referenced document will be always accessible through this
-- identifier.
-- - a reference memorizes the counter value of the To Document when
-- the reference is created. The From Document is considered to
-- be up to date relative to the To Document when the
-- reference counter value is equal to the To Document counter value.
-- - retrieval of a document having references does not imply
-- the retrieving of the referenced documents.
uses
Reference from CDM,
ReferenceIterator from CDM,
ExtendedString from TCollection,MetaData from CDM, Application from CDM,
ListOfReferences from CDM, SequenceOfExtendedString from TColStd,
GUID from Standard,Manager from Resource,CanCloseStatus from CDM
raises NoSuchObject from Standard,Failure from Standard,DomainError from Standard
is
Initialize;
---Category: virtual methods
Destroy(me: mutable) is virtual protected;
---C++: alias ~
Update(me: mutable; aToDocument: Document from CDM; aReferenceIdentifier: Integer from Standard; aModifContext: Address from Standard)
---Purpose: The Update method will be called once for each
-- reference, but it should not perform any computation,
-- to avoid multiple computation of a same document.
is virtual;
Update(me:mutable; ErrorString: out ExtendedString from TCollection)
returns Boolean from Standard
---Purpose: This method Update will be called
-- to signal the end of the modified references list.
-- The document should be recomputed and
-- UpdateFromDocuments should be called. Update should
-- returns True in case of success, false otherwise. In
-- case of Failure, additional information can be given in
-- ErrorString.
is virtual;
StorageFormat(me)
returns ExtendedString from TCollection
---Purpose: The Storage Format is the key which is used to determine in the
-- application resources the storage driver plugin, the file
-- extension and other data used to store the document.
is deferred;
Extensions(me; Extensions: out SequenceOfExtendedString from TColStd)
is virtual;
---Purpose: by default empties the extensions.
--
GetAlternativeDocument(me: mutable; aFormat: ExtendedString from TCollection;
anAlternativeDocument: out Document from CDM)
returns Boolean from Standard
---Purpose: This method can be redefined to extract another document in
-- a different format. For example, to extract a Shape
-- from an applicative document.
is virtual;
---Category: Reference management.
--
CreateReference(me: mutable; anOtherDocument: Document from CDM)
returns Integer from Standard;
---Purpose: Creates a reference from this document to {anOtherDocument}.
-- Returns a reference identifier. This reference identifier
-- is unique in the document and will not be used for the
-- next references, even after the storing of the document.
-- If there is already a reference between the two documents,
-- the reference is not created, but its reference identifier
-- is returned.
RemoveReference(me: mutable; aReferenceIdentifier: Integer from Standard);
---Purpose: Removes the reference between the From Document and the
-- To Document identified by a reference identifier.
RemoveAllReferences(me: mutable);
---Purpose: Removes all references having this document for From Document.
Document(me; aReferenceIdentifier: Integer from Standard)
returns Document from CDM
---Purpose: Returns the To Document of the reference identified by
-- aReferenceIdentifier. If the ToDocument is stored and
-- has not yet been retrieved, this method will retrieve it.
raises NoSuchObject from Standard;
IsInSession(me; aReferenceIdentifier: Integer from Standard)
returns Boolean from Standard
---Purpose: returns True if the To Document of the reference
-- identified by aReferenceIdentifier is in session, False
-- if it corresponds to a not yet retrieved document.
raises NoSuchObject from Standard;
IsStored(me; aReferenceIdentifier: Integer from Standard)
returns Boolean from Standard
---Purpose: returns True if the To Document of the reference
-- identified by aReferenceIdentifier has already been stored,
-- False otherwise.
raises NoSuchObject from Standard;
Name(me; aReferenceIdentifier: Integer from Standard)
returns ExtendedString from TCollection
---Purpose: returns the name of the metadata of the To Document of
-- the reference identified by aReferenceIdentifier.
raises DomainError from Standard;
---Warning: if the corresponding document is not stored.
UpdateFromDocuments(me; aModifContext: Address from Standard);
---Purpose: call virtual method Update on all referencing
-- documents. This method keeps the list of the --
-- documents to process.It may be the starting of an
-- update -- cycle. If not, the reentrant calls made by
-- Update method (without argument) will append the
-- referencing documents to the list and call the Update method
-- (with arguments). Only the first call to UpdateFromDocuments
-- generate call to Update().
ToReferencesNumber(me)
returns Integer from Standard;
---Purpose: returns the number of references having this document as
-- From Document.
FromReferencesNumber(me)
returns Integer from Standard;
---Purpose: returns the number of references having this document as
-- To Document.
ShallowReferences(me; aDocument: Document from CDM)
returns Boolean from Standard;
---Purpose: returns True is this document references aDocument;
--
DeepReferences(me; aDocument: Document from CDM)
returns Boolean from Standard;
---Purpose: returns True is this document references aDocument;
--
CopyReference(me: mutable; aFromDocument: Document from CDM; aReferenceIdentifier: Integer from Standard)
returns Integer from Standard;
---Purpose: Copies a reference to this document. This method
-- avoid retrieval of referenced document. The arguments
-- are the original document and a valid reference
-- identifier Returns the local identifier.
--
---Category: Modifications Counter management.
IsReadOnly(me) returns Boolean from Standard;
---Purpose: indicates that this document cannot be modified.
IsReadOnly(me; aReferenceIdentifier: Integer from Standard)
returns Boolean from Standard;
---Purpose: indicates that the referenced document cannot be modified,
SetIsReadOnly(me: mutable);
UnsetIsReadOnly(me: mutable);
Modify(me: mutable);
---Purpose: Indicates that this document has been modified.
-- This method increments the modification counter.
--
Modifications(me) returns Integer from Standard;
---Purpose: returns the current modification counter.
UnModify(me: mutable);
IsUpToDate(me; aReferenceIdentifier: Integer from Standard)
returns Boolean from Standard;
---Purpose: returns true if the modification counter found in the given
-- reference is equal to the actual modification counter of
-- the To Document. This method is able to deal with a reference
-- to a not retrieved document.
SetIsUpToDate(me: mutable; aReferenceIdentifier: Integer from Standard);
---Purpose: Resets the modification counter in the given reference
-- to the actual modification counter of its To Document.
-- This method should be called after the application has updated
-- this document.
SetComment(me: mutable; aComment: ExtendedString from TCollection);
---Purpose: associates a comment with this document.
AddComment(me: mutable; aComment: ExtendedString from TCollection);
---Purpose: appends a comment into comments of this document.
SetComments(me: mutable; aComments: SequenceOfExtendedString from TColStd);
---Purpose: associates a comments with this document.
Comments(me; aComments: out SequenceOfExtendedString from TColStd);
---Purpose: returns the associated comments through <aComments>.
-- Returns empty sequence if no comments are associated.
Comment(me) returns ExtString from Standard;
---Purpose: returns the first of associated comments. By defaut
-- the comment is an empty string.
---Category: presentation methods. The presentation is an alphanumeric string.
-- In a given session a presentation cannot be given to two differents
-- documents.
Presentation(me: mutable) returns ExtString from Standard;
---Purpose: Returns an alphanumeric string identifying this document
-- in a unique manner in the current process. The presentation
-- may change when the document is stored.
-- Tries to get the 'FileFormat`.Presentation resource
-- This item is used to give a default presentation
-- to the document.
FindFromPresentation(myclass; aPresentation: ExtendedString from TCollection)
returns Document from CDM
---Purpose: returns the document having the given alphanumeric presentation.
raises NoSuchObject from Standard;
FindPresentation(myclass; aPresentation: ExtendedString from TCollection)
returns Boolean from Standard;
---Purpose: indicates whether a document having the given presentation
-- does exist.
---Category: database related methods
IsStored(me) returns Boolean from Standard;
StorageVersion(me) returns Integer from Standard;
---Purpose: returns the value of the modification counter at the
-- time of storage. By default returns 0.
SetMetaData(me: mutable; aMetaData: MetaData from CDM);
---Purpose: associates database information to a document which
-- has been stored. The name of the document is now the
-- name which has beenused to store the data.
UnsetIsStored(me: mutable);
MetaData(me) returns MetaData from CDM
raises NoSuchObject from Standard;
Folder(me) returns ExtendedString from TCollection
raises NoSuchObject from Standard;
---Warning: if the object is not stored;
---Category: methods to define where to store the document, the name
-- under which it has to be stored and some other metadatas.
SetRequestedFolder(me: mutable; aFolder: ExtendedString from TCollection);
---Purpose: defines the folder in which the object should be stored.
RequestedFolder(me) returns ExtendedString from TCollection
raises NoSuchObject from Standard;
HasRequestedFolder(me) returns Boolean from Standard;
SetRequestedName(me: mutable; aName: ExtendedString from TCollection);
---Purpose: defines the name under which the object should be stored.
RequestedName(me:mutable) returns ExtendedString from TCollection;
---Purpose: determines under which the document is going to be
-- store. By default the name of the document wil be --
-- used. If the document has no name its presentation
-- will be used.
SetRequestedPreviousVersion(me: mutable; aPreviousVersion: ExtendedString from TCollection);
UnsetRequestedPreviousVersion(me: mutable);
HasRequestedPreviousVersion(me) returns Boolean from Standard;
RequestedPreviousVersion(me) returns ExtendedString from TCollection
raises NoSuchObject from Standard;
SetRequestedComment(me: mutable; aComment: ExtendedString from TCollection);
---Purpose: defines the Comment with which the object should be stored.
RequestedComment(me) returns ExtendedString from TCollection;
---Category: resource reading methods
--
--
--
--
-- Resources are read once at the creation of the document
-- until LoadResources is called again.
--
--
LoadResources(me: mutable);
---Purpose: read (or rereads) the following resource.
StorageResource(me: mutable) returns Manager from Resource
is private;
---Purpose: the manager returned by this method will be
-- used to search for the following resource items.
FindFileExtension(me: mutable) returns Boolean from Standard;
FileExtension(me: mutable) returns ExtendedString from TCollection;
---Purpose: gets the Desktop.Domain.Application.`FileFormat`.FileExtension resource.
FindDataType(me: mutable) returns Boolean from Standard;
DataType(me: mutable) returns ExtendedString from TCollection;
---Purpose: this datatype will be used if the DBMS deals with this concept
---Purpose: gets the `FileFormat`.DataType resource.
-- concept.
FindVersionDataType(me: mutable) returns Boolean from Standard;
VersionDataType(me: mutable) returns ExtendedString from TCollection;
---Purpose: this datatype will be used if the DBMS deals with this concept
---Purpose: gets the `FileFormat`.VersionDataType resource.
--
FindDescription(me: mutable) returns Boolean from Standard;
Description(me: mutable) returns ExtendedString from TCollection;
---Purpose: gets the `FileFormat`.Description resource.
FindDomain(me: mutable) returns Boolean from Standard;
Domain(me: mutable) returns ExtendedString from TCollection;
---Purpose: gets the `FileFormat`.Domain resource.
FindStoragePlugin(me: mutable) returns Boolean from Standard;
StoragePlugin(me: mutable) returns GUID from Standard;
---Category: Miscellaneous methods
IsModified(me) returns Boolean from Standard;
---Purpose: returns true if the version is greater than the
-- storage version
---Category: print method
Print(me; anOStream: in out OStream from Standard)
returns OStream from Standard;
---C++: return &
---C++: alias "Standard_OStream& operator << (Standard_OStream& anOStream);"
---Category: activation controll
IsOpened(me) returns Boolean from Standard;
Open(me: mutable; anApplication: Application from CDM);
CanClose(me) returns CanCloseStatus from CDM;
---Purpose:
--Returns CDM_CCS_OK true if it is possible to close the document.
-- Otherwise, returns:
-- CDM_CSS_NotOpen if the document has not been opened
-- CDM_CCS_UnstoredReferenced if the document is not stored if it
-- is referenced.
-- CDM_CSS_ModifiedReferenced if the document has been modified,
-- if it is referenced, since it has been stored.
-- CDM_CCS_ReferenceRejection if one of the referencing documents
-- does not allow the closing of the document.
Close(me: mutable);
Application(me) returns Application from CDM
raises Failure from Standard;
---C++: return const &
---Warning: exception if the document is not open
CanCloseReference(me; aDocument: Document from CDM;
aReferenceIdentifier: Integer from Standard)
returns Boolean from Standard
is virtual;
---Purpose: A referenced document may indicate through this
-- virtual method that it does not allow the closing of
-- aDocument which it references through the reference
-- aReferenceIdentifier. By default returns Standard_True;;
CloseReference(me: mutable; aDocument: Document from CDM;
aReferenceIdentifier: Integer from Standard)
is virtual;
---Purpose: A referenced document may update its internal
-- data structure when {aDocument} which it references
-- through the reference {aReferenceIdentifier} is being closed.
-- By default this method does nothing.
IsOpened(me; aReferenceIdentifier: Integer from Standard)
returns Boolean from Standard;
---Purpose: returns true if the document corresponding to the
-- given reference has been retrieved and opened.
-- Otherwise returns false. This method does not retrieve
-- the referenced document
---Category: private methods;
--
Reference(me; aReferenceIdentifier: Integer from Standard)
returns Reference from CDM
is private;
ComputePresentation(me: mutable)
is private;
UnvalidPresentation(me: mutable)
is private;
CreateReference(me: mutable; aMetaData: MetaData from CDM; aReferenceIdentifier: Integer from Standard; anApplication: Application from CDM; aToDocumentVersion: Integer from Standard; UseStorageConfiguration: Boolean from Standard);
CreateReference(me: mutable; aMetaData: MetaData from CDM; anApplication: Application from CDM; aDocumentVersion: Integer from Standard; UseStorageConfiguration: Boolean from Standard)
returns Integer from Standard;
AddToReference(me: mutable; aReference: Reference from CDM)
is private;
AddFromReference(me: mutable; aReference: Reference from CDM)
is private;
RemoveFromReference(me: mutable; aReferenceIdentifier: Integer from Standard)
is private;
SetModifications(me: mutable; Modifications: Integer from Standard)
is private;
ReferenceCounter(me) returns Integer from Standard;
SetReferenceCounter(me: mutable; aReferenceCounter: Integer from Standard)
is private;
---Category: obsolete methods
Update(me: mutable)
is virtual;
---Purpose: the following method should be used instead:
--
-- Update(me:mutable; ErrorString: out ExtendedString from TCollection)
-- returns Boolean from Standard
fields
myComments: SequenceOfExtendedString from TColStd;
myPresentation: ExtendedString from TCollection;
myValidPresentation: Boolean from Standard;
myFromReferences: ListOfReferences from CDM;
myToReferences: ListOfReferences from CDM;
myVersion: Integer from Standard;
myActualReferenceIdentifier: Integer from Standard;
myStorageVersion: Integer from Standard;
myMetaData: MetaData from CDM;
myRequestedComment: ExtendedString from TCollection;
myRequestedFolder: ExtendedString from TCollection;
myRequestedFolderIsDefined: Boolean from Standard;
myRequestedName: ExtendedString from TCollection;
myRequestedNameIsDefined: Boolean from Standard;
myRequestedPreviousVersionIsDefined: Boolean from Standard;
myRequestedPreviousVersion: ExtendedString from TCollection;
---Category: resources.
myFileExtension,myDataType,myVersionDataType,myDescription,myDomain,myDefaultPresentation: ExtendedString from TCollection;
myFileExtensionWasFound,myDataTypeWasFound,myVersionDataTypeWasFound,myDescriptionWasFound,myDomainWasFound,myStoragePluginWasFound,myDefaultPresentationWasFound: Boolean from Standard;
myResourcesAreLoaded: Boolean from Standard is protected;
myStoragePlugin: GUID from Standard;
myApplication: Application from CDM;
friends
class Reference from CDM,
class ReferenceIterator from CDM,
class Application from CDM
end Document from CDM;

View File

@@ -16,22 +16,26 @@
// Modified by rmi, Tue Nov 18 08:17:41 1997
#include <CDM_Document.ixx>
#include <Standard_NullObject.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_ProgramError.hxx>
#include <CDM_PresentationDirectory.hxx>
#include <CDM_NamesDirectory.hxx>
#include <CDM_ListOfDocument.hxx>
#include <CDM_ListIteratorOfListOfDocument.hxx>
#include <UTL.hxx>
#include <CDM_Application.hxx>
#include <CDM_DataMapIteratorOfMetaDataLookUpTable.hxx>
#include <CDM_Document.hxx>
#include <CDM_ListIteratorOfListOfDocument.hxx>
#include <CDM_ListOfDocument.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_NamesDirectory.hxx>
#include <CDM_PresentationDirectory.hxx>
#include <CDM_Reference.hxx>
#include <CDM_ReferenceIterator.hxx>
#include <Resource_Manager.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_Failure.hxx>
#include <Standard_GUID.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <UTL.hxx>
static CDM_PresentationDirectory& getPresentations() {
static CDM_PresentationDirectory thePresentations;

454
src/CDM/CDM_Document.hxx Normal file
View File

@@ -0,0 +1,454 @@
// Created on: 1997-07-30
// 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 _CDM_Document_HeaderFile
#define _CDM_Document_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_Boolean.hxx>
#include <CDM_ListOfReferences.hxx>
#include <Standard_Integer.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Address.hxx>
#include <Standard_ExtString.hxx>
#include <Standard_OStream.hxx>
#include <CDM_CanCloseStatus.hxx>
class CDM_MetaData;
class CDM_Application;
class Standard_NoSuchObject;
class Standard_Failure;
class Standard_DomainError;
class CDM_Reference;
class CDM_ReferenceIterator;
class TCollection_ExtendedString;
class Resource_Manager;
class Standard_GUID;
class CDM_Document;
DEFINE_STANDARD_HANDLE(CDM_Document, Standard_Transient)
//! An applicative document is an instance of a class inheriting CDM_Document.
//! These documents have the following properties:
//! - they can have references to other documents.
//! - the modifications of a document are propagated to the referencing
//! documents.
//! - a document can be stored in different formats, with or
//! without a persistent model.
//! - the drivers for storing and retrieving documents are
//! plugged in when necessary.
//! - a document has a modification counter. This counter is
//! incremented when the document is modified. When a document
//! is stored, the current counter value is memorized as the
//! last storage version of the document. A document is
//! considered to be modified when the counter value is
//! different from the storage version. Once the document is
//! saved the storage version and the counter value are
//! identical. The document is now not considered to be
//! modified.
//! - a reference is a link between two documents. A reference has two
//! components: the "From Document" and the "To Document". When
//! a reference is created, an identifier of the reference is generated.
//! This identifier is unique in the scope of the From Document and
//! is conserved during storage and retrieval. This means that the
//! referenced document will be always accessible through this
//! identifier.
//! - a reference memorizes the counter value of the To Document when
//! the reference is created. The From Document is considered to
//! be up to date relative to the To Document when the
//! reference counter value is equal to the To Document counter value.
//! - retrieval of a document having references does not imply
//! the retrieving of the referenced documents.
class CDM_Document : public Standard_Transient
{
public:
//! The Update method will be called once for each
//! reference, but it should not perform any computation,
//! to avoid multiple computation of a same document.
Standard_EXPORT virtual void Update (const Handle(CDM_Document)& aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Address aModifContext);
//! This method Update will be called
//! to signal the end of the modified references list.
//! The document should be recomputed and
//! UpdateFromDocuments should be called. Update should
//! returns True in case of success, false otherwise. In
//! case of Failure, additional information can be given in
//! ErrorString.
Standard_EXPORT virtual Standard_Boolean Update (TCollection_ExtendedString& ErrorString);
//! The Storage Format is the key which is used to determine in the
//! application resources the storage driver plugin, the file
//! extension and other data used to store the document.
Standard_EXPORT virtual TCollection_ExtendedString StorageFormat() const = 0;
//! by default empties the extensions.
Standard_EXPORT virtual void Extensions (TColStd_SequenceOfExtendedString& Extensions) const;
//! This method can be redefined to extract another document in
//! a different format. For example, to extract a Shape
//! from an applicative document.
Standard_EXPORT virtual Standard_Boolean GetAlternativeDocument (const TCollection_ExtendedString& aFormat, Handle(CDM_Document)& anAlternativeDocument);
//! Creates a reference from this document to {anOtherDocument}.
//! Returns a reference identifier. This reference identifier
//! is unique in the document and will not be used for the
//! next references, even after the storing of the document.
//! If there is already a reference between the two documents,
//! the reference is not created, but its reference identifier
//! is returned.
Standard_EXPORT Standard_Integer CreateReference (const Handle(CDM_Document)& anOtherDocument);
//! Removes the reference between the From Document and the
//! To Document identified by a reference identifier.
Standard_EXPORT void RemoveReference (const Standard_Integer aReferenceIdentifier);
//! Removes all references having this document for From Document.
Standard_EXPORT void RemoveAllReferences();
//! Returns the To Document of the reference identified by
//! aReferenceIdentifier. If the ToDocument is stored and
//! has not yet been retrieved, this method will retrieve it.
Standard_EXPORT Handle(CDM_Document) Document (const Standard_Integer aReferenceIdentifier) const;
//! returns True if the To Document of the reference
//! identified by aReferenceIdentifier is in session, False
//! if it corresponds to a not yet retrieved document.
Standard_EXPORT Standard_Boolean IsInSession (const Standard_Integer aReferenceIdentifier) const;
//! returns True if the To Document of the reference
//! identified by aReferenceIdentifier has already been stored,
//! False otherwise.
Standard_EXPORT Standard_Boolean IsStored (const Standard_Integer aReferenceIdentifier) const;
//! returns the name of the metadata of the To Document of
//! the reference identified by aReferenceIdentifier.
Standard_EXPORT TCollection_ExtendedString Name (const Standard_Integer aReferenceIdentifier) const;
//! call virtual method Update on all referencing
//! documents. This method keeps the list of the --
//! documents to process.It may be the starting of an
//! update -- cycle. If not, the reentrant calls made by
//! Update method (without argument) will append the
//! referencing documents to the list and call the Update method
//! (with arguments). Only the first call to UpdateFromDocuments
//! generate call to Update().
Standard_EXPORT void UpdateFromDocuments (const Standard_Address aModifContext) const;
//! returns the number of references having this document as
//! From Document.
Standard_EXPORT Standard_Integer ToReferencesNumber() const;
//! returns the number of references having this document as
//! To Document.
Standard_EXPORT Standard_Integer FromReferencesNumber() const;
//! returns True is this document references aDocument;
Standard_EXPORT Standard_Boolean ShallowReferences (const Handle(CDM_Document)& aDocument) const;
//! returns True is this document references aDocument;
Standard_EXPORT Standard_Boolean DeepReferences (const Handle(CDM_Document)& aDocument) const;
//! Copies a reference to this document. This method
//! avoid retrieval of referenced document. The arguments
//! are the original document and a valid reference
//! identifier Returns the local identifier.
Standard_EXPORT Standard_Integer CopyReference (const Handle(CDM_Document)& aFromDocument, const Standard_Integer aReferenceIdentifier);
//! indicates that this document cannot be modified.
Standard_EXPORT Standard_Boolean IsReadOnly() const;
//! indicates that the referenced document cannot be modified,
Standard_EXPORT Standard_Boolean IsReadOnly (const Standard_Integer aReferenceIdentifier) const;
Standard_EXPORT void SetIsReadOnly();
Standard_EXPORT void UnsetIsReadOnly();
//! Indicates that this document has been modified.
//! This method increments the modification counter.
Standard_EXPORT void Modify();
//! returns the current modification counter.
Standard_EXPORT Standard_Integer Modifications() const;
Standard_EXPORT void UnModify();
//! returns true if the modification counter found in the given
//! reference is equal to the actual modification counter of
//! the To Document. This method is able to deal with a reference
//! to a not retrieved document.
Standard_EXPORT Standard_Boolean IsUpToDate (const Standard_Integer aReferenceIdentifier) const;
//! Resets the modification counter in the given reference
//! to the actual modification counter of its To Document.
//! This method should be called after the application has updated
//! this document.
Standard_EXPORT void SetIsUpToDate (const Standard_Integer aReferenceIdentifier);
//! associates a comment with this document.
Standard_EXPORT void SetComment (const TCollection_ExtendedString& aComment);
//! appends a comment into comments of this document.
Standard_EXPORT void AddComment (const TCollection_ExtendedString& aComment);
//! associates a comments with this document.
Standard_EXPORT void SetComments (const TColStd_SequenceOfExtendedString& aComments);
//! returns the associated comments through <aComments>.
//! Returns empty sequence if no comments are associated.
Standard_EXPORT void Comments (TColStd_SequenceOfExtendedString& aComments) const;
//! returns the first of associated comments. By defaut
//! the comment is an empty string.
Standard_EXPORT Standard_ExtString Comment() const;
//! Returns an alphanumeric string identifying this document
//! in a unique manner in the current process. The presentation
//! may change when the document is stored.
//! Tries to get the 'FileFormat`.Presentation resource
//! This item is used to give a default presentation
//! to the document.
Standard_EXPORT Standard_ExtString Presentation();
//! returns the document having the given alphanumeric presentation.
Standard_EXPORT static Handle(CDM_Document) FindFromPresentation (const TCollection_ExtendedString& aPresentation);
//! indicates whether a document having the given presentation
//! does exist.
Standard_EXPORT static Standard_Boolean FindPresentation (const TCollection_ExtendedString& aPresentation);
Standard_EXPORT Standard_Boolean IsStored() const;
//! returns the value of the modification counter at the
//! time of storage. By default returns 0.
Standard_EXPORT Standard_Integer StorageVersion() const;
//! associates database information to a document which
//! has been stored. The name of the document is now the
//! name which has beenused to store the data.
Standard_EXPORT void SetMetaData (const Handle(CDM_MetaData)& aMetaData);
Standard_EXPORT void UnsetIsStored();
Standard_EXPORT Handle(CDM_MetaData) MetaData() const;
Standard_EXPORT TCollection_ExtendedString Folder() const;
//! defines the folder in which the object should be stored.
Standard_EXPORT void SetRequestedFolder (const TCollection_ExtendedString& aFolder);
Standard_EXPORT TCollection_ExtendedString RequestedFolder() const;
Standard_EXPORT Standard_Boolean HasRequestedFolder() const;
//! defines the name under which the object should be stored.
Standard_EXPORT void SetRequestedName (const TCollection_ExtendedString& aName);
//! determines under which the document is going to be
//! store. By default the name of the document wil be --
//! used. If the document has no name its presentation
//! will be used.
Standard_EXPORT TCollection_ExtendedString RequestedName();
Standard_EXPORT void SetRequestedPreviousVersion (const TCollection_ExtendedString& aPreviousVersion);
Standard_EXPORT void UnsetRequestedPreviousVersion();
Standard_EXPORT Standard_Boolean HasRequestedPreviousVersion() const;
Standard_EXPORT TCollection_ExtendedString RequestedPreviousVersion() const;
//! defines the Comment with which the object should be stored.
Standard_EXPORT void SetRequestedComment (const TCollection_ExtendedString& aComment);
Standard_EXPORT TCollection_ExtendedString RequestedComment() const;
//! read (or rereads) the following resource.
Standard_EXPORT void LoadResources();
Standard_EXPORT Standard_Boolean FindFileExtension();
//! gets the Desktop.Domain.Application.`FileFormat`.FileExtension resource.
Standard_EXPORT TCollection_ExtendedString FileExtension();
Standard_EXPORT Standard_Boolean FindDataType();
//! this datatype will be used if the DBMS deals with this concept
//! gets the `FileFormat`.DataType resource.
//! concept.
Standard_EXPORT TCollection_ExtendedString DataType();
Standard_EXPORT Standard_Boolean FindVersionDataType();
//! this datatype will be used if the DBMS deals with this concept
//! gets the `FileFormat`.VersionDataType resource.
Standard_EXPORT TCollection_ExtendedString VersionDataType();
Standard_EXPORT Standard_Boolean FindDescription();
//! gets the `FileFormat`.Description resource.
Standard_EXPORT TCollection_ExtendedString Description();
Standard_EXPORT Standard_Boolean FindDomain();
//! gets the `FileFormat`.Domain resource.
Standard_EXPORT TCollection_ExtendedString Domain();
Standard_EXPORT Standard_Boolean FindStoragePlugin();
Standard_EXPORT Standard_GUID StoragePlugin();
//! returns true if the version is greater than the
//! storage version
Standard_EXPORT Standard_Boolean IsModified() const;
Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const;
Standard_OStream& operator << (Standard_OStream& anOStream);
Standard_EXPORT Standard_Boolean IsOpened() const;
Standard_EXPORT void Open (const Handle(CDM_Application)& anApplication);
Standard_EXPORT CDM_CanCloseStatus CanClose() const;
Standard_EXPORT void Close();
Standard_EXPORT const Handle(CDM_Application)& Application() const;
//! A referenced document may indicate through this
//! virtual method that it does not allow the closing of
//! aDocument which it references through the reference
//! aReferenceIdentifier. By default returns Standard_True;;
Standard_EXPORT virtual Standard_Boolean CanCloseReference (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceIdentifier) const;
//! A referenced document may update its internal
//! data structure when {aDocument} which it references
//! through the reference {aReferenceIdentifier} is being closed.
//! By default this method does nothing.
Standard_EXPORT virtual void CloseReference (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceIdentifier);
//! returns true if the document corresponding to the
//! given reference has been retrieved and opened.
//! Otherwise returns false. This method does not retrieve
//! the referenced document
Standard_EXPORT Standard_Boolean IsOpened (const Standard_Integer aReferenceIdentifier) const;
Standard_EXPORT void CreateReference (const Handle(CDM_MetaData)& aMetaData, const Standard_Integer aReferenceIdentifier, const Handle(CDM_Application)& anApplication, const Standard_Integer aToDocumentVersion, const Standard_Boolean UseStorageConfiguration);
Standard_EXPORT Standard_Integer CreateReference (const Handle(CDM_MetaData)& aMetaData, const Handle(CDM_Application)& anApplication, const Standard_Integer aDocumentVersion, const Standard_Boolean UseStorageConfiguration);
Standard_EXPORT Standard_Integer ReferenceCounter() const;
//! the following method should be used instead:
//!
//! Update(me:mutable; ErrorString: out ExtendedString from TCollection)
//! returns Boolean from Standard
Standard_EXPORT virtual void Update();
friend class CDM_Reference;
friend class CDM_ReferenceIterator;
friend class CDM_Application;
DEFINE_STANDARD_RTTI(CDM_Document,Standard_Transient)
protected:
Standard_EXPORT CDM_Document();
Standard_EXPORT virtual void Destroy();
~CDM_Document()
{
Destroy();
}
Standard_Boolean myResourcesAreLoaded;
private:
//! the manager returned by this method will be
//! used to search for the following resource items.
Standard_EXPORT Handle(Resource_Manager) StorageResource();
Standard_EXPORT Handle(CDM_Reference) Reference (const Standard_Integer aReferenceIdentifier) const;
Standard_EXPORT void ComputePresentation();
Standard_EXPORT void UnvalidPresentation();
Standard_EXPORT void AddToReference (const Handle(CDM_Reference)& aReference);
Standard_EXPORT void AddFromReference (const Handle(CDM_Reference)& aReference);
Standard_EXPORT void RemoveFromReference (const Standard_Integer aReferenceIdentifier);
Standard_EXPORT void SetModifications (const Standard_Integer Modifications);
Standard_EXPORT void SetReferenceCounter (const Standard_Integer aReferenceCounter);
TColStd_SequenceOfExtendedString myComments;
TCollection_ExtendedString myPresentation;
Standard_Boolean myValidPresentation;
CDM_ListOfReferences myFromReferences;
CDM_ListOfReferences myToReferences;
Standard_Integer myVersion;
Standard_Integer myActualReferenceIdentifier;
Standard_Integer myStorageVersion;
Handle(CDM_MetaData) myMetaData;
TCollection_ExtendedString myRequestedComment;
TCollection_ExtendedString myRequestedFolder;
Standard_Boolean myRequestedFolderIsDefined;
TCollection_ExtendedString myRequestedName;
Standard_Boolean myRequestedNameIsDefined;
Standard_Boolean myRequestedPreviousVersionIsDefined;
TCollection_ExtendedString myRequestedPreviousVersion;
TCollection_ExtendedString myFileExtension;
TCollection_ExtendedString myDataType;
TCollection_ExtendedString myVersionDataType;
TCollection_ExtendedString myDescription;
TCollection_ExtendedString myDomain;
TCollection_ExtendedString myDefaultPresentation;
Standard_Boolean myFileExtensionWasFound;
Standard_Boolean myDataTypeWasFound;
Standard_Boolean myVersionDataTypeWasFound;
Standard_Boolean myDescriptionWasFound;
Standard_Boolean myDomainWasFound;
Standard_Boolean myStoragePluginWasFound;
Standard_Boolean myDefaultPresentationWasFound;
Standard_GUID myStoragePlugin;
Handle(CDM_Application) myApplication;
};
#endif // _CDM_Document_HeaderFile

View File

@@ -0,0 +1,23 @@
// Created on: 1997-05-06
// Created by: Jean-Louis Frenkel, Remi Lequette
// 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 _CDM_DocumentPointer_HeaderFile
#define _CDM_DocumentPointer_HeaderFile
class CDM_Document;
typedef CDM_Document* CDM_DocumentPointer;
#endif // _CDM_DocumentPointer_HeaderFile

View File

@@ -1,24 +0,0 @@
-- Created on: 1998-10-29
-- 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.
deferred class MessageDriver from CDM inherits Transient from Standard
is
Write(me: mutable; aString: ExtString from Standard)
is deferred;
end MessageDriver from CDM;

View File

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

View File

@@ -0,0 +1,62 @@
// Created on: 1998-10-29
// 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 _CDM_MessageDriver_HeaderFile
#define _CDM_MessageDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
#include <Standard_ExtString.hxx>
class CDM_MessageDriver;
DEFINE_STANDARD_HANDLE(CDM_MessageDriver, Standard_Transient)
class CDM_MessageDriver : public Standard_Transient
{
public:
Standard_EXPORT virtual void Write (const Standard_ExtString aString) = 0;
DEFINE_STANDARD_RTTI(CDM_MessageDriver,Standard_Transient)
protected:
private:
};
#endif // _CDM_MessageDriver_HeaderFile

View File

@@ -1,120 +0,0 @@
-- Created on: 1997-10-22
-- 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 MetaData from CDM inherits Transient from Standard
uses ExtendedString from TCollection,Document from CDM,MetaDataLookUpTable from CDM, DocumentPointer from CDM,
Application from CDM
raises NoSuchObject from Standard
is
Create(aFolder,aName, aPath: ExtendedString from TCollection;
aFileName: ExtendedString from TCollection; ReadOnly:Boolean from Standard)
returns MetaData from CDM is private;
Create(aFolder,aName, aPath, aVersion: ExtendedString from TCollection;
aFileName: ExtendedString from TCollection; ReadOnly:Boolean from Standard)
returns MetaData from CDM is private;
LookUp(myclass; aFolder,aName, aPath: ExtendedString from TCollection;
aFileName: ExtendedString from TCollection; ReadOnly:Boolean from Standard)
returns MetaData from CDM;
LookUp(myclass; aFolder,aName, aPath, aVersion: ExtendedString from TCollection; aFileName: ExtendedString from TCollection; ReadOnly:Boolean from Standard)
returns MetaData from CDM;
IsRetrieved(me) returns Boolean from Standard;
Document(me) returns Document from CDM;
Folder(me) returns ExtendedString from TCollection;
---Purpose: returns the folder in which the meta-data has to be created
-- or has to be found.
--
Name(me) returns ExtendedString from TCollection;
---Purpose: returns the name under which the meta-data has to be created
-- or has to be found.
--
Version(me) returns ExtendedString from TCollection
---Purpose: returns the version under which the meta-data has to be found.
-- Warning: raises NoSuchObject from Standard if no Version has been defined
raises NoSuchObject from Standard;
HasVersion(me) returns Boolean from Standard;
---Purpose: indicates that the version has to be taken into account when
-- searching the corresponding meta-data.
FileName(me) returns ExtendedString from TCollection;
---Category: programming facility
--
Print(me; anOStream: in out OStream from Standard)
returns OStream from Standard;
---C++: return &
---C++: alias "Standard_OStream& operator << (Standard_OStream& anOStream);"
--
Path(me) returns ExtendedString from TCollection;
---Category: methods to modify the metadata.
--
SetDocument(me: mutable; aDocument: Document from CDM)
is private;
UnsetDocument(me: mutable);
LookUpTable(myclass) returns MetaDataLookUpTable from CDM
is private;
---C++: return const&
--
DocumentVersion(me: mutable; anApplication: Application from CDM) returns Integer from Standard
is private;
IsReadOnly(me) returns Boolean from Standard;
SetIsReadOnly(me: mutable);
UnsetIsReadOnly(me: mutable);
fields
myIsRetrieved: Boolean from Standard;
myDocument: DocumentPointer from CDM;
myFolder: ExtendedString from TCollection;
myName: ExtendedString from TCollection;
myVersion: ExtendedString from TCollection;
myHasVersion: Boolean from Standard;
myFileName: ExtendedString from TCollection;
myPath: ExtendedString from TCollection;
myDocumentVersion: Integer from Standard;
myIsReadOnly: Boolean from Standard;
friends SetMetaData from class Document from CDM(me: mutable; aMetaData: MetaData from CDM),
class Reference from CDM,
SetDocumentVersion from class Application from CDM(me; aDocument: Document from CDM; aMetaData: MetaData from CDM)
end MetaData from CDM;

View File

@@ -14,8 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDM_MetaData.ixx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_MetaDataLookUpTable.hxx>
#include <CDM_Reference.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
static CDM_MetaDataLookUpTable& getLookUpTable(){
static CDM_MetaDataLookUpTable theLookUpTable;

139
src/CDM/CDM_MetaData.hxx Normal file
View File

@@ -0,0 +1,139 @@
// Created on: 1997-10-22
// 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 _CDM_MetaData_HeaderFile
#define _CDM_MetaData_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <CDM_DocumentPointer.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Transient.hxx>
#include <CDM_Document.hxx>
#include <CDM_Application.hxx>
#include <Standard_OStream.hxx>
#include <CDM_MetaDataLookUpTable.hxx>
class Standard_NoSuchObject;
class CDM_Reference;
class CDM_Document;
class TCollection_ExtendedString;
class CDM_Application;
class CDM_MetaData;
DEFINE_STANDARD_HANDLE(CDM_MetaData, Standard_Transient)
class CDM_MetaData : public Standard_Transient
{
public:
Standard_EXPORT static Handle(CDM_MetaData) LookUp (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly);
Standard_EXPORT static Handle(CDM_MetaData) LookUp (const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aVersion, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly);
Standard_EXPORT Standard_Boolean IsRetrieved() const;
Standard_EXPORT Handle(CDM_Document) Document() const;
//! returns the folder in which the meta-data has to be created
//! or has to be found.
Standard_EXPORT TCollection_ExtendedString Folder() const;
//! returns the name under which the meta-data has to be created
//! or has to be found.
Standard_EXPORT TCollection_ExtendedString Name() const;
//! returns the version under which the meta-data has to be found.
//! Warning: raises NoSuchObject from Standard if no Version has been defined
Standard_EXPORT TCollection_ExtendedString Version() const;
//! indicates that the version has to be taken into account when
//! searching the corresponding meta-data.
Standard_EXPORT Standard_Boolean HasVersion() const;
Standard_EXPORT TCollection_ExtendedString FileName() const;
Standard_EXPORT Standard_OStream& Print (Standard_OStream& anOStream) const;
Standard_OStream& operator << (Standard_OStream& anOStream);
Standard_EXPORT TCollection_ExtendedString Path() const;
Standard_EXPORT void UnsetDocument();
Standard_EXPORT Standard_Boolean IsReadOnly() const;
Standard_EXPORT void SetIsReadOnly();
Standard_EXPORT void UnsetIsReadOnly();
friend class CDM_Reference;
friend
//! associates database information to a document which
//! has been stored. The name of the document is now the
//! name which has beenused to store the data.
Standard_EXPORT void CDM_Document::SetMetaData (const Handle(CDM_MetaData)& aMetaData);
friend
Standard_EXPORT void CDM_Application::SetDocumentVersion (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData) const;
DEFINE_STANDARD_RTTI(CDM_MetaData,Standard_Transient)
protected:
private:
Standard_EXPORT CDM_MetaData(const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly);
Standard_EXPORT CDM_MetaData(const TCollection_ExtendedString& aFolder, const TCollection_ExtendedString& aName, const TCollection_ExtendedString& aPath, const TCollection_ExtendedString& aVersion, const TCollection_ExtendedString& aFileName, const Standard_Boolean ReadOnly);
Standard_EXPORT void SetDocument (const Handle(CDM_Document)& aDocument);
Standard_EXPORT static const CDM_MetaDataLookUpTable& LookUpTable();
Standard_EXPORT Standard_Integer DocumentVersion (const Handle(CDM_Application)& anApplication);
Standard_Boolean myIsRetrieved;
CDM_DocumentPointer myDocument;
TCollection_ExtendedString myFolder;
TCollection_ExtendedString myName;
TCollection_ExtendedString myVersion;
Standard_Boolean myHasVersion;
TCollection_ExtendedString myFileName;
TCollection_ExtendedString myPath;
Standard_Integer myDocumentVersion;
Standard_Boolean myIsReadOnly;
};
#endif // _CDM_MetaData_HeaderFile

View File

@@ -0,0 +1,25 @@
// Created on: 1997-05-06
// Created by: Jean-Louis Frenkel, Remi Lequette
// 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 _CDM_NamesDirectory_HeaderFile
#define _CDM_NamesDirectory_HeaderFile
#include <TColStd_DataMapOfStringInteger.hxx>
typedef TColStd_DataMapOfStringInteger CDM_NamesDirectory;
#endif // _CDM_NamesDirectory_HeaderFile

View File

@@ -1,27 +0,0 @@
-- Created on: 1998-10-29
-- 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.
class NullMessageDriver from CDM inherits MessageDriver from CDM
---Purpose: a MessageDriver that writes nowhere.
is
Create returns NullMessageDriver from CDM;
Write(me: mutable; aString: ExtString from Standard);
end NullMessageDriver from CDM;

View File

@@ -14,8 +14,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDM_NullMessageDriver.ixx>
#include <CDM_NullMessageDriver.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
CDM_NullMessageDriver::CDM_NullMessageDriver() {}
void CDM_NullMessageDriver::Write(const Standard_ExtString /*aString*/) {

View File

@@ -0,0 +1,64 @@
// Created on: 1998-10-29
// 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 _CDM_NullMessageDriver_HeaderFile
#define _CDM_NullMessageDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <CDM_MessageDriver.hxx>
#include <Standard_ExtString.hxx>
class CDM_NullMessageDriver;
DEFINE_STANDARD_HANDLE(CDM_NullMessageDriver, CDM_MessageDriver)
//! a MessageDriver that writes nowhere.
class CDM_NullMessageDriver : public CDM_MessageDriver
{
public:
Standard_EXPORT CDM_NullMessageDriver();
Standard_EXPORT void Write (const Standard_ExtString aString);
DEFINE_STANDARD_RTTI(CDM_NullMessageDriver,CDM_MessageDriver)
protected:
private:
};
#endif // _CDM_NullMessageDriver_HeaderFile

View File

@@ -1,93 +0,0 @@
-- Created on: 1997-10-22
-- 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.
private class Reference from CDM inherits Transient from Standard
uses Document from CDM, DocumentPointer from CDM, Application from CDM, MetaData from CDM
is
Create(aFromDocument: Document from CDM; aToDocument: Document from CDM; aReferenceIdentifier: Integer from Standard; aToDocumentVersion: Integer from Standard)
returns Reference from CDM
is private;
Create(aFromDocument: Document from CDM; aMetaData: MetaData from CDM; aReferenceIdentifier: Integer from Standard; anApplication: Application from CDM; aToDocumentVersion: Integer from Standard; UseStorageConfiguration: Boolean from Standard)
returns Reference from CDM
is private;
FromDocument(me: mutable) returns Document from CDM;
ToDocument(me: mutable) returns Document from CDM;
ReferenceIdentifier(me: mutable) returns Integer from Standard;
---Category: methods to modifiy the reference.
Update(me: mutable; aMetaData: MetaData from CDM)
is private;
IsUpToDate(me) returns Boolean from Standard
is private;
---Purpose: compares the actual document version with the
-- document version at the creation of the reference
SetIsUpToDate(me: mutable)
is private;
UnsetToDocument(me: mutable; aMetaData: MetaData from CDM; anApplication: Application from CDM) is private;
IsOpened(me) returns Boolean from Standard is private;
---Purpose: returns true if the ToDocument has been retrieved
-- and opened.
DocumentVersion(me) returns Integer from Standard;
IsReadOnly(me) returns Boolean from Standard;
Document(me) returns Document from CDM
is private;
MetaData(me) returns MetaData from CDM
is private;
Application(me) returns Application from CDM
is private;
UseStorageConfiguration(me) returns Boolean from Standard
is private;
IsInSession(me) returns Boolean from Standard
is private;
IsStored(me) returns Boolean from Standard
is private;
fields
myToDocument: Document from CDM;
myFromDocument: DocumentPointer from CDM;
myReferenceIdentifier: Integer from Standard;
myApplication: Application from CDM;
myMetaData: MetaData from CDM;
myDocumentVersion: Integer from Standard;
myUseStorageConfiguration: Boolean from Standard;
friends class Document from CDM
end Reference from CDM;

View File

@@ -14,8 +14,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDM_Reference.ixx>
#include <CDM_Application.hxx>
#include <CDM_Document.hxx>
#include <CDM_MetaData.hxx>
#include <CDM_Reference.hxx>
#include <Standard_Type.hxx>
CDM_Reference::CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_Document)& aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Integer aToDocumentVersion):
myToDocument(aToDocument),

113
src/CDM/CDM_Reference.hxx Normal file
View File

@@ -0,0 +1,113 @@
// Created on: 1997-10-22
// 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 _CDM_Reference_HeaderFile
#define _CDM_Reference_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <CDM_DocumentPointer.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Transient.hxx>
class CDM_Document;
class CDM_Application;
class CDM_MetaData;
class CDM_Reference;
DEFINE_STANDARD_HANDLE(CDM_Reference, Standard_Transient)
class CDM_Reference : public Standard_Transient
{
public:
Standard_EXPORT Handle(CDM_Document) FromDocument();
Standard_EXPORT Handle(CDM_Document) ToDocument();
Standard_EXPORT Standard_Integer ReferenceIdentifier();
Standard_EXPORT Standard_Integer DocumentVersion() const;
Standard_EXPORT Standard_Boolean IsReadOnly() const;
friend class CDM_Document;
DEFINE_STANDARD_RTTI(CDM_Reference,Standard_Transient)
protected:
private:
Standard_EXPORT CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_Document)& aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Integer aToDocumentVersion);
Standard_EXPORT CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_MetaData)& aMetaData, const Standard_Integer aReferenceIdentifier, const Handle(CDM_Application)& anApplication, const Standard_Integer aToDocumentVersion, const Standard_Boolean UseStorageConfiguration);
Standard_EXPORT void Update (const Handle(CDM_MetaData)& aMetaData);
//! compares the actual document version with the
//! document version at the creation of the reference
Standard_EXPORT Standard_Boolean IsUpToDate() const;
Standard_EXPORT void SetIsUpToDate();
Standard_EXPORT void UnsetToDocument (const Handle(CDM_MetaData)& aMetaData, const Handle(CDM_Application)& anApplication);
//! returns true if the ToDocument has been retrieved
//! and opened.
Standard_EXPORT Standard_Boolean IsOpened() const;
Standard_EXPORT Handle(CDM_Document) Document() const;
Standard_EXPORT Handle(CDM_MetaData) MetaData() const;
Standard_EXPORT Handle(CDM_Application) Application() const;
Standard_EXPORT Standard_Boolean UseStorageConfiguration() const;
Standard_EXPORT Standard_Boolean IsInSession() const;
Standard_EXPORT Standard_Boolean IsStored() const;
Handle(CDM_Document) myToDocument;
CDM_DocumentPointer myFromDocument;
Standard_Integer myReferenceIdentifier;
Handle(CDM_Application) myApplication;
Handle(CDM_MetaData) myMetaData;
Standard_Integer myDocumentVersion;
Standard_Boolean myUseStorageConfiguration;
};
#endif // _CDM_Reference_HeaderFile

View File

@@ -1,43 +0,0 @@
-- Created on: 1997-08-04
-- 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 ReferenceIterator from CDM
uses Document from CDM, ListIteratorOfListOfReferences from CDM
is
Create(aDocument: Document from CDM);
More(me) returns Boolean from Standard;
Next(me: in out);
Document(me) returns Document from CDM;
ReferenceIdentifier(me) returns Integer from Standard;
DocumentVersion(me) returns Integer from Standard;
---Purpose: returns the Document Version in the reference.
fields
myIterator: ListIteratorOfListOfReferences from CDM;
end ReferenceIterator from CDM;

View File

@@ -14,9 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <CDM_ReferenceIterator.ixx>
#include <CDM_Reference.hxx>
#include <CDM_Document.hxx>
#include <CDM_Reference.hxx>
#include <CDM_ReferenceIterator.hxx>
CDM_ReferenceIterator::CDM_ReferenceIterator(const Handle(CDM_Document)& aDocument):myIterator(aDocument->myToReferences){}

View File

@@ -0,0 +1,75 @@
// Created on: 1997-08-04
// 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 _CDM_ReferenceIterator_HeaderFile
#define _CDM_ReferenceIterator_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <CDM_ListIteratorOfListOfReferences.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
class CDM_Document;
class CDM_ReferenceIterator
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT CDM_ReferenceIterator(const Handle(CDM_Document)& aDocument);
Standard_EXPORT Standard_Boolean More() const;
Standard_EXPORT void Next();
Standard_EXPORT Handle(CDM_Document) Document() const;
Standard_EXPORT Standard_Integer ReferenceIdentifier() const;
//! returns the Document Version in the reference.
Standard_EXPORT Standard_Integer DocumentVersion() const;
protected:
private:
CDM_ListIteratorOfListOfReferences myIterator;
};
#endif // _CDM_ReferenceIterator_HeaderFile

View File

@@ -1,11 +1,30 @@
CDM_PresentationDirectory.hxx
CDM_DataMapIteratorOfPresentationDirectory.hxx
CDM_ListOfReferences.hxx
CDM_ListIteratorOfListOfReferences.hxx
CDM_MetaDataLookUpTable.hxx
CDM_Application.cxx
CDM_Application.hxx
CDM_CanCloseStatus.hxx
CDM_COutMessageDriver.cxx
CDM_COutMessageDriver.hxx
CDM_DataMapIteratorOfMetaDataLookUpTable.hxx
CDM_DataMapIteratorOfPresentationDirectory.hxx
CDM_Document.cxx
CDM_Document.hxx
CDM_DocumentHasher.hxx
CDM_MapOfDocument.hxx
CDM_MapIteratorOfMapOfDocument.hxx
CDM_ListOfDocument.hxx
CDM_DocumentPointer.hxx
CDM_ListIteratorOfListOfDocument.hxx
CDM_ListIteratorOfListOfReferences.hxx
CDM_ListOfDocument.hxx
CDM_ListOfReferences.hxx
CDM_MapIteratorOfMapOfDocument.hxx
CDM_MapOfDocument.hxx
CDM_MessageDriver.cxx
CDM_MessageDriver.hxx
CDM_MetaData.cxx
CDM_MetaData.hxx
CDM_MetaDataLookUpTable.hxx
CDM_NamesDirectory.hxx
CDM_NullMessageDriver.cxx
CDM_NullMessageDriver.hxx
CDM_PresentationDirectory.hxx
CDM_Reference.cxx
CDM_Reference.hxx
CDM_ReferenceIterator.cxx
CDM_ReferenceIterator.hxx