OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Standard_Type.hxx File Reference
    #include <Standard.hxx>
    #include <Standard_Handle.hxx>
    #include <Standard_Transient.hxx>
    #include <Standard_OStream.hxx>
    #include <typeinfo>
    #include <typeindex>
    #include <type_traits>

    Data Structures

    class  Standard_Type
     This class provides legacy interface (type descriptor) to run-time type information (RTTI) for OCCT classes inheriting from Standard_Transient. More...

    Namespaces

    namespace  occ
     Modern namespace for Open CASCADE Technology (OCCT 8.0+).

    Macros

    #define OCCT_CHECK_BASE_CLASS(Class, Base)
    #define STANDARD_TYPE(theType)
     Helper macro to get instance of a type descriptor for a class in a legacy way.
    #define DEFINE_STANDARD_RTTI_INLINE(Class, Base)
     Helper macro to be included in definition of the classes inheriting Standard_Transient to enable use of OCCT RTTI.
    #define DEFINE_STANDARD_RTTIEXT(Class, Base)
     Helper macro to be included in definition of the classes inheriting Standard_Transient to enable use of OCCT RTTI.
    #define IMPLEMENT_STANDARD_RTTIEXT(Class, Base)
     Defines implementation of type descriptor and DynamicType() function.

    Functions

    Standard_OStreamoperator<< (Standard_OStream &theStream, const occ::handle< Standard_Type > &theType)
     Operator printing type descriptor to stream.
    template<class T>
    bool occ::is_kind (const Standard_Transient *theObject)
     Check if object is of type T or inherits from T.
    template<class T, class TBase>
    bool occ::is_kind (const handle< TBase > &theObject)
     Check if object is of type T or inherits from T (handle version).
    template<class T>
    bool occ::is_instance (const Standard_Transient *theObject)
     Check if object is exactly of type T (not a derived type).
    template<class T, class TBase>
    bool occ::is_instance (const handle< TBase > &theObject)
     Check if object is exactly of type T (handle version).
    template<class T>
    const handle< Standard_Type > & occ::type_of ()
     Get the type descriptor for type T. Equivalent to STANDARD_TYPE(T) but with template syntax.

    Macro Definition Documentation

    ◆ DEFINE_STANDARD_RTTI_INLINE

    #define DEFINE_STANDARD_RTTI_INLINE ( Class,
    Base )
    Value:
    public: \
    typedef Base base_type; \
    static constexpr const char* get_type_name() \
    { \
    OCCT_CHECK_BASE_CLASS(Class, Base); \
    return #Class; \
    } \
    static const occ::handle<Standard_Type>& get_type_descriptor() \
    { \
    static const occ::handle<Standard_Type> THE_TYPE_INSTANCE = \
    Standard_Type::Register(typeid(Class), \
    get_type_name(), \
    sizeof(Class), \
    Base::get_type_descriptor()); \
    return THE_TYPE_INSTANCE; \
    } \
    virtual const occ::handle<Standard_Type>& DynamicType() const override \
    { \
    return get_type_descriptor(); \
    }
    opencascade::handle< T > handle
    Intrusive smart pointer template for Standard_Transient descendants. This is an alias to opencascade:...
    Definition Standard_Handle.hxx:421

    Helper macro to be included in definition of the classes inheriting Standard_Transient to enable use of OCCT RTTI.

    Inline version, does not require IMPLEMENT_STANDARD_RTTIEXT, but when used for big hierarchies of classes may cause considerable increase of size of binaries.

    ◆ DEFINE_STANDARD_RTTIEXT

    #define DEFINE_STANDARD_RTTIEXT ( Class,
    Base )
    Value:
    public: \
    typedef Base base_type; \
    static constexpr const char* get_type_name() \
    { \
    OCCT_CHECK_BASE_CLASS(Class, Base); \
    return #Class; \
    } \
    Standard_EXPORT static const occ::handle<Standard_Type>& get_type_descriptor(); \
    Standard_EXPORT virtual const occ::handle<Standard_Type>& DynamicType() const override;

    Helper macro to be included in definition of the classes inheriting Standard_Transient to enable use of OCCT RTTI.

    Out-of-line version, requires IMPLEMENT_STANDARD_RTTIEXT.

    ◆ IMPLEMENT_STANDARD_RTTIEXT

    #define IMPLEMENT_STANDARD_RTTIEXT ( Class,
    Base )
    Value:
    OCCT_CHECK_BASE_CLASS(Class, Base) \
    const occ::handle<Standard_Type>& Class::get_type_descriptor() \
    { \
    static const occ::handle<Standard_Type> THE_TYPE_INSTANCE = \
    Standard_Type::Register(typeid(Class), \
    get_type_name(), \
    sizeof(Class), \
    Class::base_type::get_type_descriptor()); \
    return THE_TYPE_INSTANCE; \
    } \
    const occ::handle<Standard_Type>& Class::DynamicType() const \
    { \
    return STANDARD_TYPE(Class); \
    }
    #define OCCT_CHECK_BASE_CLASS(Class, Base)
    Definition Standard_Type.hxx:30
    #define STANDARD_TYPE(theType)
    Helper macro to get instance of a type descriptor for a class in a legacy way.
    Definition Standard_Type.hxx:36

    Defines implementation of type descriptor and DynamicType() function.

    ◆ OCCT_CHECK_BASE_CLASS

    #define OCCT_CHECK_BASE_CLASS ( Class,
    Base )
    Value:
    static_assert(std::is_base_of<Base, Class>::value && !std::is_same<Base, Class>::value, \
    "OCCT RTTI definition is incorrect: " #Base " is not base class of " #Class);

    ◆ STANDARD_TYPE

    #define STANDARD_TYPE ( theType)
    Value:
    theType::get_type_descriptor()

    Helper macro to get instance of a type descriptor for a class in a legacy way.

    Function Documentation

    ◆ operator<<()

    Standard_OStream & operator<< ( Standard_OStream & theStream,
    const occ::handle< Standard_Type > & theType )
    inline

    Operator printing type descriptor to stream.