File indexing completed on 2025-01-18 10:02:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BinMDataStd_HeaderFile
0017 #define _BinMDataStd_HeaderFile
0018
0019 #include <Standard_GUID.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022
0023 #include <BinObjMgt_Persistent.hxx>
0024 #include <TDocStd_FormatVersion.hxx>
0025
0026 class BinMDF_ADriverTable;
0027 class Message_Messenger;
0028
0029
0030 class BinMDataStd
0031 {
0032 public:
0033
0034 DEFINE_STANDARD_ALLOC
0035
0036
0037
0038 Standard_EXPORT static void AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable, const Handle(Message_Messenger)& aMsgDrv);
0039
0040 template<class T>
0041 static void SetAttributeID(const BinObjMgt_Persistent& theSource, const Handle(T)& anAtt, const Standard_Integer aDocFormatVersion)
0042 {
0043 Standard_Boolean ok = Standard_True;
0044 if(aDocFormatVersion >= TDocStd_FormatVersion_VERSION_10) {
0045 const Standard_Integer& aPos = theSource.Position();
0046 Standard_GUID aGuid;
0047 ok = theSource >> aGuid;
0048 if (!ok) {
0049 theSource.SetPosition(aPos);
0050 anAtt->SetID(T::GetID());
0051 ok = Standard_True;
0052 } else {
0053 anAtt->SetID(aGuid);
0054 }
0055 } else
0056 anAtt->SetID(T::GetID());
0057 }
0058
0059 };
0060
0061 #endif