1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- manual

Restored possibility to have out-of-line implementation of DynamicCast() and STANDART_TYPE():
- Macro STANDARD_TYPE() now resolves to function get_type_descriptor() of the class
- Macro DEFINE_STANDARD_RTTI is replaced by two variants:
  - DEFINE_STANDARD_RTTI_INLINE works as before, defining DynamicCast() and get_type_descriptor() as inline functions
  - DEFINE_STANDARD_RTTIEXT declares DynamicCast() and get_type_descriptor() as exported
- Macro IMPLEMENT_STANDARD_RTTIEXT provides definition of DynamicCast() and get_type_descriptor() for a class

Upgrade script amended to replace DEFINE_STANDARD_RTTI by pair of DEFINE_STANDARD_RTTIEXT / IMPLEMENT_STANDARD_RTTIEXT if source file with the same name as header is found in the same folder, and by DEFINE_STANDARD_RTTI_INLINE if either source is not found or class is defined in the source (i.e. not in header)

Upgrade tool improved to recognize include statements with path prefix, like #include <occt/gp_Pnt.hxx>
Code corrected to eliminate warnings reported by upgrade tool.
Template of CXX file for testing upgrade tool added.

Documentation of upgrade procedure updated.
This commit is contained in:
abv
2015-11-30 07:49:48 +03:00
parent 6595eee796
commit f5f4ebd07b
23 changed files with 277 additions and 76 deletions

View File

@@ -240,7 +240,7 @@ public:
virtual const char* Name() const { return "Transient_Root"; }
virtual Standard_Transient* CreateParent() const { return new Standard_Transient; }
virtual Standard_Transient* Clone() const { return new Transient_Root; }
DEFINE_STANDARD_RTTI(Transient_Root, Standard_Transient)
DEFINE_STANDARD_RTTI_INLINE(Transient_Root,Standard_Transient)
};
DEFINE_STANDARD_HANDLE(Transient_Root, Standard_Transient)
@@ -252,11 +252,9 @@ public:\
virtual const char* Name() const Standard_OVERRIDE { return #theClass; } \
virtual Standard_Transient* CreateParent() const Standard_OVERRIDE { return new theParent(); } \
virtual Standard_Transient* Clone() const Standard_OVERRIDE { return new theClass(); } \
DEFINE_STANDARD_RTTI(theClass, theParent) \
DEFINE_STANDARD_RTTI_INLINE(theClass,theParent) \
};\
DEFINE_STANDARD_HANDLE (theClass, theParent) \
IMPLEMENT_STANDARD_HANDLE (theClass, theParent) \
IMPLEMENT_STANDARD_RTTIEXT(theClass, theParent)
DEFINE_STANDARD_HANDLE (theClass, theParent)
#define QA_NAME(theNum) qaclass ## theNum ## _ ## 50
#define QA_HANDLE_NAME(theNum) Handle(qaclass ## theNum ## _ ## 50)