File indexing completed on 2025-01-18 10:05:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Storage_Schema_HeaderFile
0018 #define _Storage_Schema_HeaderFile
0019
0020 #include <Storage_BaseDriver.hxx>
0021 #include <Storage_InternalData.hxx>
0022 #include <Storage_MapOfCallBack.hxx>
0023 #include <TCollection_AsciiString.hxx>
0024 #include <TColStd_HSequenceOfAsciiString.hxx>
0025
0026 class Storage_CallBack;
0027
0028
0029 class Storage_Schema;
0030 DEFINE_STANDARD_HANDLE(Storage_Schema, Standard_Transient)
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 class Storage_Schema : public Standard_Transient
0057 {
0058
0059 public:
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 Standard_EXPORT Storage_Schema();
0075
0076
0077 Standard_EXPORT void SetVersion (const TCollection_AsciiString& aVersion);
0078
0079
0080 Standard_EXPORT TCollection_AsciiString Version() const;
0081
0082
0083 Standard_EXPORT void SetName (const TCollection_AsciiString& aSchemaName);
0084
0085
0086 Standard_EXPORT TCollection_AsciiString Name() const;
0087
0088
0089
0090
0091
0092
0093
0094 Standard_EXPORT void Write (const Handle(Storage_BaseDriver)& s, const Handle(Storage_Data)& aData) const;
0095
0096
0097 Standard_EXPORT static TCollection_AsciiString ICreationDate();
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110 Standard_EXPORT static Standard_Boolean CheckTypeMigration (const TCollection_AsciiString& theTypeName, TCollection_AsciiString& theNewName);
0111
0112
0113 Standard_EXPORT void AddReadUnknownTypeCallBack (const TCollection_AsciiString& aTypeName, const Handle(Storage_CallBack)& aCallBack);
0114
0115
0116 Standard_EXPORT void RemoveReadUnknownTypeCallBack (const TCollection_AsciiString& aTypeName);
0117
0118
0119
0120 Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) InstalledCallBackList() const;
0121
0122
0123 Standard_EXPORT void ClearCallBackList();
0124
0125
0126
0127
0128 Standard_EXPORT void UseDefaultCallBack();
0129
0130
0131 Standard_EXPORT void DontUseDefaultCallBack();
0132
0133
0134 Standard_EXPORT Standard_Boolean IsUsingDefaultCallBack() const;
0135
0136
0137
0138
0139 Standard_EXPORT void SetDefaultCallBack (const Handle(Storage_CallBack)& f);
0140
0141
0142
0143 Standard_EXPORT void ResetDefaultCallBack();
0144
0145
0146
0147 Standard_EXPORT Handle(Storage_CallBack) DefaultCallBack() const;
0148
0149 void WritePersistentObjectHeader(const Handle(Standard_Persistent)& sp, const Handle(Storage_BaseDriver)& theDriver)
0150 {
0151 theDriver->WritePersistentObjectHeader(sp->_refnum, sp->_typenum);
0152 }
0153
0154 void WritePersistentReference(const Handle(Standard_Persistent)& sp, const Handle(Storage_BaseDriver)& theDriver)
0155 {
0156 theDriver->PutReference(sp.IsNull() ? 0 : sp->_refnum);
0157 }
0158
0159 Standard_EXPORT Standard_Boolean AddPersistent (const Handle(Standard_Persistent)& sp, const Standard_CString tName) const;
0160
0161 Standard_EXPORT Standard_Boolean PersistentToAdd (const Handle(Standard_Persistent)& sp) const;
0162
0163 DEFINE_STANDARD_RTTIEXT(Storage_Schema,Standard_Transient)
0164
0165 protected:
0166
0167 Standard_Boolean HasTypeBinding(const TCollection_AsciiString& aTypeName) const
0168 {
0169 return Storage_Schema::ICurrentData()->InternalData()->myTypeBinding.IsBound(aTypeName);
0170 }
0171
0172 Standard_EXPORT void BindType (const TCollection_AsciiString& aTypeName, const Handle(Storage_CallBack)& aCallBack) const;
0173
0174 Standard_EXPORT Handle(Storage_CallBack) TypeBinding (const TCollection_AsciiString& aTypeName) const;
0175
0176
0177
0178 private:
0179
0180 Standard_EXPORT void Clear() const;
0181
0182 Standard_EXPORT static void ISetCurrentData (const Handle(Storage_Data)& dData);
0183
0184 Standard_EXPORT static Handle(Storage_Data)& ICurrentData();
0185
0186 Storage_MapOfCallBack myCallBack;
0187 Standard_Boolean myCallBackState;
0188 Handle(Storage_CallBack) myDefaultCallBack;
0189 TCollection_AsciiString myName;
0190 TCollection_AsciiString myVersion;
0191 };
0192
0193 #endif