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 #ifndef _Storage_Macros_HeaderFile
0016 #define _Storage_Macros_HeaderFile 1
0017 #include <Storage_SolveMode.hxx>
0018
0019
0020 #define Storage_DECLARE_SCHEMA_METHODS(schema) public: \
0021 Standard_EXPORT Handle(Storage_CallBack) CallBackSelection(const TCollection_AsciiString&) const; \
0022 Standard_EXPORT Handle(Storage_CallBack) AddTypeSelection(const Handle(Standard_Persistent)&) const; \
0023 Standard_EXPORT const TColStd_SequenceOfAsciiString& SchemaKnownTypes() const;
0024
0025
0026
0027 #define Storage_BEGIN_READ_SELECTION(schema) \
0028 Handle(Storage_CallBack) schema::CallBackSelection(const TCollection_AsciiString& rt) const \
0029 { \
0030 Handle(Standard_Persistent) p; \
0031 Handle(Storage_CallBack) cback;
0032
0033 #define Storage_READ_SELECTION(schema,classe,callback) if (strcmp(rt.ToCString(),#classe) == 0) { \
0034 cback = new callback ; \
0035 return cback; \
0036 }
0037
0038 #define Storage_END_READ_SELECTION(schema) cback = ResolveUnknownType(rt,p,Storage_WriteSolve); \
0039 return cback; \
0040 }
0041
0042
0043
0044 #define Storage_BEGIN_SCHEMA_TYPES(schema) const TColStd_SequenceOfAsciiString& schema::SchemaKnownTypes() const \
0045 { \
0046 static TColStd_SequenceOfAsciiString aSeq; \
0047 static Standard_Boolean jsuidjaalai = Standard_False; \
0048 if (!jsuidjaalai) { \
0049 jsuidjaalai = Standard_True;
0050
0051 #define Storage_SCHEMA_TYPES(classe) aSeq.Append(#classe);
0052 #define Storage_END_SCHEMA_TYPES(schema) } return aSeq; \
0053 }
0054
0055
0056
0057
0058 #define Storage_BEGIN_ADD_TYPES(schema) Handle(Storage_CallBack) schema::AddTypeSelection(const Handle(Standard_Persistent)& p) const \
0059 { \
0060 Handle(Storage_CallBack) cback; \
0061 if (!p.IsNull()) { \
0062 const Handle(Standard_Type)& t = p->DynamicType(); \
0063 static TCollection_AsciiString theTypeName;\
0064 theTypeName = t->Name(); \
0065 if (HasTypeBinding(theTypeName)) { \
0066 cback = TypeBinding(theTypeName); \
0067 cback->Add(p,this); \
0068 return cback; \
0069 }
0070
0071 #define Storage_ADD_TYPES(schema,classe,callback) if (t == STANDARD_TYPE(classe)) { \
0072 cback = new callback ; \
0073 BindType(theTypeName,cback); \
0074 cback->Add(p,this); \
0075 return cback; \
0076 }
0077
0078 #define Storage_END_ADD_TYPES(schema) cback = ResolveUnknownType(theTypeName,p,Storage_AddSolve); \
0079 if (!cback.IsNull()) { \
0080 cback->Add(p,this); \
0081 } \
0082 return cback; \
0083 } \
0084 return cback; \
0085 }
0086 #endif