File indexing completed on 2026-07-01 08:32:11
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 DEFINE_STANDARD_ALLOC
0034
0035
0036 Standard_EXPORT static void AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
0037 const Handle(Message_Messenger)& aMsgDrv);
0038
0039 template <class T>
0040 static void SetAttributeID(const BinObjMgt_Persistent& theSource,
0041 const Handle(T)& anAtt,
0042 const Standard_Integer aDocFormatVersion)
0043 {
0044 Standard_Boolean ok = Standard_True;
0045 if (aDocFormatVersion >= TDocStd_FormatVersion_VERSION_10)
0046 {
0047 const Standard_Integer& aPos = theSource.Position();
0048 Standard_GUID aGuid;
0049 ok = theSource >> aGuid;
0050 if (!ok)
0051 {
0052 theSource.SetPosition(aPos);
0053 anAtt->SetID(T::GetID());
0054 ok = Standard_True;
0055 }
0056 else
0057 {
0058 anAtt->SetID(aGuid);
0059 }
0060 }
0061 else
0062 anAtt->SetID(T::GetID());
0063 }
0064 };
0065
0066 #endif