mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Revive IMPLEMENT_STANDARD_RTTIEXT macro; two variants of DEFINE_STANDARD_RTTI macro (...EXT and ..._INLINE)
This commit is contained in:
@@ -36,6 +36,5 @@ class Standard_Type;
|
|||||||
#define IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
|
#define IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
|
||||||
#define IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
|
#define IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
|
||||||
#define IMPLEMENT_STANDARD_TYPE_END(C1)
|
#define IMPLEMENT_STANDARD_TYPE_END(C1)
|
||||||
#define IMPLEMENT_STANDARD_RTTIEXT(C1,C2)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -27,13 +27,30 @@
|
|||||||
|
|
||||||
//! Helper macro to be included in definition of the classes inheriting
|
//! Helper macro to be included in definition of the classes inheriting
|
||||||
//! Standard_Transient to enable use of OCCT RTTI and smart pointers (handles).
|
//! 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: \
|
public: \
|
||||||
typedef Base base_type; \
|
typedef Base base_type; \
|
||||||
static const char* get_type_name () { return #Class; } \
|
static const char* get_type_name () { return #Class; } \
|
||||||
virtual const Handle(Standard_Type)& DynamicType() const Standard_OVERRIDE \
|
virtual const Handle(Standard_Type)& DynamicType() const Standard_OVERRIDE \
|
||||||
{ return STANDARD_TYPE(Class); }
|
{ 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
|
// forward declaration of type_instance class
|
||||||
namespace opencascade {
|
namespace opencascade {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Reference in New Issue
Block a user