File indexing completed on 2026-09-09 09:17:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _Storage_Macros_HeaderFile
0016 #define _Storage_Macros_HeaderFile 1
0017 #include <Storage_SolveMode.hxx>
0018
0019
0020 #define Storage_DECLARE_SCHEMA_METHODS(schema) \
0021 public: \
0022 Standard_EXPORT Handle(Storage_CallBack) CallBackSelection(const TCollection_AsciiString&) \
0023 const; \
0024 Standard_EXPORT Handle(Storage_CallBack) AddTypeSelection(const Handle(Standard_Persistent)&) \
0025 const; \
0026 Standard_EXPORT const TColStd_SequenceOfAsciiString& SchemaKnownTypes() const;
0027
0028
0029
0030 #define Storage_BEGIN_READ_SELECTION(schema) \
0031 Handle(Storage_CallBack) schema::CallBackSelection(const TCollection_AsciiString& rt) const \
0032 { \
0033 Handle(Standard_Persistent) p; \
0034 Handle(Storage_CallBack) cback;
0035
0036 #define Storage_READ_SELECTION(schema, classe, callback) \
0037 if (strcmp(rt.ToCString(), #classe) == 0) \
0038 { \
0039 cback = new callback; \
0040 return cback; \
0041 }
0042
0043 #define Storage_END_READ_SELECTION(schema) \
0044 cback = ResolveUnknownType(rt, p, Storage_WriteSolve); \
0045 return cback; \
0046 }
0047
0048
0049
0050 #define Storage_BEGIN_SCHEMA_TYPES(schema) \
0051 const TColStd_SequenceOfAsciiString& schema::SchemaKnownTypes() const \
0052 { \
0053 static TColStd_SequenceOfAsciiString aSeq; \
0054 static Standard_Boolean jsuidjaalai = Standard_False; \
0055 if (!jsuidjaalai) \
0056 { \
0057 jsuidjaalai = Standard_True;
0058
0059 #define Storage_SCHEMA_TYPES(classe) aSeq.Append(#classe);
0060 #define Storage_END_SCHEMA_TYPES(schema) \
0061 } \
0062 return aSeq; \
0063 }
0064
0065
0066
0067
0068 #define Storage_BEGIN_ADD_TYPES(schema) \
0069 Handle(Storage_CallBack) schema::AddTypeSelection(const Handle(Standard_Persistent)& p) const \
0070 { \
0071 Handle(Storage_CallBack) cback; \
0072 if (!p.IsNull()) \
0073 { \
0074 const Handle(Standard_Type)& t = p->DynamicType(); \
0075 static TCollection_AsciiString theTypeName; \
0076 theTypeName = t->Name(); \
0077 if (HasTypeBinding(theTypeName)) \
0078 { \
0079 cback = TypeBinding(theTypeName); \
0080 cback->Add(p, this); \
0081 return cback; \
0082 }
0083
0084 #define Storage_ADD_TYPES(schema, classe, callback) \
0085 if (t == STANDARD_TYPE(classe)) \
0086 { \
0087 cback = new callback; \
0088 BindType(theTypeName, cback); \
0089 cback->Add(p, this); \
0090 return cback; \
0091 }
0092
0093 #define Storage_END_ADD_TYPES(schema) \
0094 cback = ResolveUnknownType(theTypeName, p, Storage_AddSolve); \
0095 if (!cback.IsNull()) \
0096 { \
0097 cback->Add(p, this); \
0098 } \
0099 return cback; \
0100 } \
0101 return cback; \
0102 }
0103 #endif