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

Revive IMPLEMENT_STANDARD_RTTIEXT macro; two variants of DEFINE_STANDARD_RTTI macro (...EXT and ..._INLINE)

This commit is contained in:
abv
2015-11-28 08:10:27 +03:00
parent 79104795a1
commit 305d92d7bf
2 changed files with 18 additions and 2 deletions

View File

@@ -36,6 +36,5 @@ class Standard_Type;
#define IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
#define IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
#define IMPLEMENT_STANDARD_TYPE_END(C1)
#define IMPLEMENT_STANDARD_RTTIEXT(C1,C2)
#endif

View File

@@ -27,13 +27,30 @@
//! Helper macro to be included in definition of the classes inheriting
//! Standard_Transient to enable use of OCCT RTTI and smart pointers (handles).
#define DEFINE_STANDARD_RTTI(Class,Base) \
//!
//! Inline version, does not require IMPLEMENT_STANDARD_RTTIEXT but
//! leading to increase of size of binaries.
#define DEFINE_STANDARD_RTTI_INLINE(Class,Base) \
public: \
typedef Base base_type; \
static const char* get_type_name () { return #Class; } \
virtual const Handle(Standard_Type)& DynamicType() const Standard_OVERRIDE \
{ return STANDARD_TYPE(Class); }
//! Helper macro to be included in definition of the classes inheriting
//! Standard_Transient to enable use of OCCT RTTI and smart pointers (handles).
//!
//! Out-of-line version, requires IMPLEMENT_STANDARD_RTTIEXT.
#define DEFINE_STANDARD_RTTIEXT(Class,Base) \
public: \
typedef Base base_type; \
static const char* get_type_name () { return #Class; } \
virtual const Handle(Standard_Type)& DynamicType() const Standard_OVERRIDE;
//! Defines implementation of DynamicType() function
#define IMPLEMENT_STANDARD_RTTIEXT(Class,Base) \
const Handle(Standard_Type)& Class::DynamicType() const { return STANDARD_TYPE(Class); }
// forward declaration of type_instance class
namespace opencascade {
template <typename T>