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

0025812: Replace dynamic loading mechanism of OCAF persistence with dynamic-link one

Fields to store cached instances of reader and writer drivers for each format are added in CDF_Application.
Method DefineFormat() is added in TDocStd_Application, allowing defining format completely by single call, including drivers to be used for persistence.
All OCAF driver packages provide static method DefineFormat() that defines standard OCAF persistence format supported by corresponding package; these methods are called in DRAW to enable all persistence by default.

DRAW commands (except TObj-specific ones) now use single instance of OCAF Application, returned by DDocStd::GetApplication(). Other instances are eliminated, as well as method DDocStd::Find(const Handle(TDocStd_Application)&).
Method MessageDriver() and relevant field are moved to TDocStd_Application from its descendants.

Method CDF_Application::ReaderFromFormat() is made virtual to allow its redefinition in descendants.
Creation of storage driver is moved from PCDM::StorageDriver() to new virtual method CDF_Application::WriterFromFormat().
The code loading driver as plugin is retained in both these methods for compatibility.

Test command OCC24925 is converted to use virtual methods instead of defining plugin resource.

Migration table for old OCAF types is hard-coded in Storage_Schema::CheckTypeMigration().

Removed obsolete and unused items:
- FWOSPlugin library (driver is created directly)
- Methods in classes CDM_Document dealing with unused parameters of format
- DRAW command OCC23010 for testing non-reproducible issue #23010
- Methods PCDM::StorageDriver(), PCDM::FindStorageDriver()
- Method Formats() from CDF_Application and descendants
- Methods LoadExtensions and SchemaName from PCDM_StorageDriver
- Method Plugin::AdditionalPluginMap()
- Method BinLDrivers_DocumentStorageDriver::SchemaName()
- Method CDF_Application::DefaultExtension(), Reader(), FindReader(), FindReaderFromFormat()
- Method CDF_Store::Check()
This commit is contained in:
abv
2016-06-20 06:53:14 +03:00
parent 8072aba1ae
commit 6fe96f8416
221 changed files with 1001 additions and 8896 deletions

View File

@@ -16,41 +16,9 @@
//AGV 15/10/01 : Add XmlOcaf support; add MessageDriver support
#include <AppStd_Application.hxx>
#include <CDM_COutMessageDriver.hxx>
#include <CDM_MessageDriver.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AppStd_Application,TDocStd_Application)
//=======================================================================
//function : AppStd_Application
//purpose :
//=======================================================================
AppStd_Application::AppStd_Application()
{
myMessageDriver = new CDM_COutMessageDriver;
}
//=======================================================================
//function : MessageDriver
//purpose :
//=======================================================================
Handle(CDM_MessageDriver) AppStd_Application::MessageDriver ()
{
return myMessageDriver;
}
//=======================================================================
//function : Formats
//purpose :
//=======================================================================
void AppStd_Application::Formats(TColStd_SequenceOfExtendedString& theFormats)
{
theFormats.Append("XmlOcaf");
theFormats.Append("BinOcaf");
}
//=======================================================================
//function : ResourcesName
//purpose :

View File

@@ -28,46 +28,15 @@ class CDM_MessageDriver;
class AppStd_Application;
DEFINE_STANDARD_HANDLE(AppStd_Application, TDocStd_Application)
//! Legacy class defining resources name for standard OCAF documents
class AppStd_Application : public TDocStd_Application
{
public:
Standard_EXPORT AppStd_Application();
Standard_EXPORT virtual Handle(CDM_MessageDriver) MessageDriver() Standard_OVERRIDE;
//! returns supported format for application documents.
Standard_EXPORT virtual void Formats (TColStd_SequenceOfExtendedString& theFormats) Standard_OVERRIDE;
public:
//! returns the file name which contains application
//! resources
Standard_EXPORT Standard_CString ResourcesName() Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AppStd_Application,TDocStd_Application)
protected:
private:
Handle(CDM_MessageDriver) myMessageDriver;
};
#endif // _AppStd_Application_HeaderFile