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

@@ -18,7 +18,6 @@
#include <CDF_Directory.hxx>
#include <CDF_DirectoryIterator.hxx>
#include <CDF_Session.hxx>
#include <CDF_Store.hxx>
#include <PCDM_RetrievalDriver.hxx>
#include <PCDM_StorageDriver.hxx>
@@ -46,12 +45,10 @@ IMPLEMENT_STANDARD_RTTIEXT(TDocStd_Application,CDF_Application)
TDocStd_Application::TDocStd_Application()
: myIsDriverLoaded (Standard_True)
{
AddToSession();
if(myMetaDataDriver.IsNull())
myIsDriverLoaded = Standard_False;
}
//=======================================================================
//function : IsDriverLoaded
//purpose :
@@ -156,9 +153,7 @@ void TDocStd_Application::WritingFormats(TColStd_SequenceOfAsciiString &theForma
Standard_Integer TDocStd_Application::NbDocuments() const
{
if (!CDF_Session::Exists())
throw Standard_DomainError("TDocStd_Application::NbDocuments");
return this->myDirectory->Length();
return myDirectory->Length();
}
//=======================================================================
@@ -168,8 +163,6 @@ Standard_Integer TDocStd_Application::NbDocuments() const
void TDocStd_Application::GetDocument(const Standard_Integer index,Handle(TDocStd_Document)& aDoc) const
{
if (!CDF_Session::Exists())
throw Standard_DomainError("TDocStd_Application::NbDocuments");
CDF_DirectoryIterator it (myDirectory);
Standard_Integer current = 0;
for (;it.MoreDocument();it.NextDocument()) {
@@ -601,19 +594,6 @@ void TDocStd_Application::OnCommitTransaction (const Handle(TDocStd_Document)&)
// nothing to do on this level
}
//
void TDocStd_Application::AddToSession()
{
Handle(CDF_Session) S = CDF_Session::Create();
S->AddApplication(this, OSD_Thread::Current());
}
Standard_Boolean TDocStd_Application::RemoveFromSession()
{
Handle(CDF_Session) aSession = CDF_Session::Create();
return aSession->RemoveApplication(OSD_Thread::Current());
}
//=======================================================================
//function : DumpJson
//purpose :

View File

@@ -283,20 +283,12 @@ public:
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
//! Remove this application from the current session
Standard_EXPORT Standard_Boolean RemoveFromSession();
DEFINE_STANDARD_RTTIEXT(TDocStd_Application, CDF_Application)
protected:
Handle(Resource_Manager) myResources;
Standard_Boolean myIsDriverLoaded;
private:
//! Add this application to the current session (register in internal container)
void AddToSession();
};
#endif // _TDocStd_Application_HeaderFile