File indexing completed on 2025-01-18 10:05:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _TDF_DerivedAttribute_HeaderFile
0015 #define _TDF_DerivedAttribute_HeaderFile
0016
0017 #include <NCollection_List.hxx>
0018 #include <TDF_Attribute.hxx>
0019
0020 class TCollection_AsciiString;
0021
0022
0023
0024
0025 #define DEFINE_DERIVED_ATTRIBUTE(Class, Base) \
0026 DEFINE_STANDARD_RTTIEXT(Class, Base); \
0027 Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0028
0029
0030
0031 #define IMPLEMENT_DERIVED_ATTRIBUTE(Class, Base) \
0032 IMPLEMENT_STANDARD_RTTIEXT(Class, Base) \
0033 static Handle(TDF_Attribute) TDF_DERIVED_New##Class() { return new Class(); } \
0034 static TDF_DerivedAttribute::NewDerived TDF_DERIVED_##Class( \
0035 TDF_DerivedAttribute::Register(TDF_DERIVED_New##Class)); \
0036 Handle(TDF_Attribute) Class::NewEmpty() const { return TDF_DERIVED_##Class(); } \
0037
0038
0039
0040
0041 #define IMPLEMENT_DERIVED_ATTRIBUTE_WITH_TYPE(Class, Base, NameSpace, TypeName) \
0042 IMPLEMENT_STANDARD_RTTIEXT(Class, Base) \
0043 static Handle(TDF_Attribute) TDF_DERIVED_New##Class() { return new Class(); } \
0044 static TDF_DerivedAttribute::NewDerived TDF_DERIVED_##Class( \
0045 TDF_DerivedAttribute::Register(TDF_DERIVED_New##Class, NameSpace, TypeName)); \
0046 Handle(TDF_Attribute) Class::NewEmpty() const { return TDF_DERIVED_##Class(); } \
0047
0048
0049
0050
0051 class TDF_DerivedAttribute
0052 {
0053 public:
0054
0055 typedef Handle(TDF_Attribute) (*NewDerived) ();
0056
0057
0058 Standard_EXPORT static NewDerived Register (NewDerived theNewAttributeFunction,
0059 Standard_CString theNameSpace = NULL,
0060 Standard_CString theTypeName = NULL);
0061
0062
0063 Standard_EXPORT static Handle(TDF_Attribute) Attribute (Standard_CString theType);
0064
0065
0066 Standard_EXPORT static const TCollection_AsciiString& TypeName (Standard_CString theType);
0067
0068
0069 Standard_EXPORT static void Attributes (NCollection_List<Handle(TDF_Attribute)>& theList);
0070
0071 };
0072
0073 #endif