0031785: [REGRESSION] Application Framework - application crashes on reading XBF document in background thread

Class CDF_Session is removed.

Integrated previously but not described:

0029195: OCAF - ensure thread safety for different documents.

Static local variables are eliminated in PCDM package.
Global documents metadata look-up table and directory of opened documents are removed.
Look-up table is maintained now as field in instances of the CDM_Application class.
Methods providing iteration by components are removed from class CDF_Store; signature of methods returned Standard_ExtString is changed to return Handle(TCollection_HExtendedString).
Support of different "Presentations" of documents is eliminated.
This commit is contained in:
abv
2020-09-22 15:24:54 +03:00
committed by bugmaster
parent 0e57793fc6
commit 8a39adb7d8
33 changed files with 230 additions and 479 deletions

View File

@@ -53,9 +53,10 @@ void PCDM_ReferenceIterator::LoadReferences(const Handle(CDM_Document)& aDocumen
const Handle(CDM_MetaData)& aMetaData,
const Handle(CDM_Application)& anApplication,
const Standard_Boolean UseStorageConfiguration) {
for (Init(aMetaData);More();Next()) {
aDocument->CreateReference(MetaData(UseStorageConfiguration),ReferenceIdentifier(),
anApplication,DocumentVersion(),UseStorageConfiguration);
for (Init(aMetaData);More();Next())
{
aDocument->CreateReference(MetaData(anApplication->MetaDataLookUpTable(),UseStorageConfiguration),
ReferenceIdentifier(),anApplication,DocumentVersion(),UseStorageConfiguration);
}
}
@@ -96,7 +97,9 @@ void PCDM_ReferenceIterator::Next() {
//purpose :
//=======================================================================
Handle(CDM_MetaData) PCDM_ReferenceIterator::MetaData(const Standard_Boolean ) const {
Handle(CDM_MetaData) PCDM_ReferenceIterator::MetaData(CDM_MetaDataLookUpTable& theLookUpTable,
const Standard_Boolean ) const
{
TCollection_ExtendedString theFolder,theName;
TCollection_ExtendedString theFile=myReferences(myIterator).FileName();
@@ -140,8 +143,9 @@ Handle(CDM_MetaData) PCDM_ReferenceIterator::MetaData(const Standard_Boolean ) c
theName = UTL::Name(p); theName+= UTL::Extension(p);
#endif // _WIN32
return CDM_MetaData::LookUp(theFolder,theName,theFile,theFile,UTL::IsReadOnly(theFile));
return CDM_MetaData::LookUp(theLookUpTable, theFolder, theName, theFile, theFile, UTL::IsReadOnly(theFile));
}
//=======================================================================
//function : ReferenceIdentifier
//purpose :

View File

@@ -21,15 +21,13 @@
#include <Standard_Type.hxx>
#include <PCDM_SequenceOfReference.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Boolean.hxx>
#include <CDM_MetaDataLookUpTable.hxx>
class Message_Messenger;
class CDM_Document;
class CDM_MetaData;
class CDM_Application;
class PCDM_ReferenceIterator;
DEFINE_STANDARD_HANDLE(PCDM_ReferenceIterator, Standard_Transient)
@@ -64,18 +62,18 @@ private:
Standard_EXPORT virtual void Next();
Standard_EXPORT virtual Handle(CDM_MetaData) MetaData (const Standard_Boolean UseStorageConfiguration) const;
Standard_EXPORT virtual Handle(CDM_MetaData) MetaData (CDM_MetaDataLookUpTable& theLookUpTable,
const Standard_Boolean UseStorageConfiguration) const;
Standard_EXPORT virtual Standard_Integer ReferenceIdentifier() const;
//! returns the version of the document in the reference
Standard_EXPORT virtual Standard_Integer DocumentVersion() const;
private:
PCDM_SequenceOfReference myReferences;
Standard_Integer myIterator;
Handle(Message_Messenger) myMessageDriver;
};