Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:17

0001 // Copyright (c) 1998-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _Storage_Macros_HeaderFile
0016 #define _Storage_Macros_HeaderFile 1
0017 #include <Storage_SolveMode.hxx>
0018 
0019 // PROTOTYPES
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 // Read_TypeSelection
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 // SchemaKnownTypes
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 // ADD_TypeSelection
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