|
| template<class T > |
| bool | is_derived_from () const noexcept |
| | Test exact identity or membership in the object's RTTI base chain. More...
|
| |
| template<class T > |
| bool | is () const noexcept |
| | Compare the object's dynamic class identifier with T's identifier. More...
|
| |
| bool | is (string_view svClassName) const noexcept |
| | Compare against the class name selected by the naming strategy. More...
|
| |
| bool | is (const class_id &id) const noexcept |
| | Compare against the object's dynamic class identifier. More...
|
| |
| virtual bool | is_derived_from_id (const class_id &id) const noexcept |
| | Test an identifier against the object's dynamic RTTI hierarchy. More...
|
| |
| virtual qx::basic_string_view< char_type > | get_class_name () const noexcept |
| | Get the name of the object's most-derived registered RTTI type. More...
|
| |
| virtual qx::basic_string_view< char > | get_class_name_cstring () const noexcept |
| | Get the name of the object's most-derived registered RTTI type. More...
|
| |
| virtual qx::basic_string_view< wchar_t > | get_class_name_wstring () const noexcept |
| | Get the name of the object's most-derived registered RTTI type. More...
|
| |
| virtual class_id | get_class_id () const noexcept |
| | Get the identifier of the object's most-derived registered RTTI type. More...
|
| |
| virtual std::span< const class_id > | get_inheritance_sequence () const =0 |
| | Get the registered inheritance chain in base-to-derived order. More...
|
| |
template<class naming_strategy_t = rtti_naming_strategy_class_name>
class qx::rtti_root< naming_strategy_t >
Polymorphic base for qx class identity and inheritance queries.
Derive an RTTI hierarchy from this type and use QX_RTTI_CLASS in each derived class to supply its identity and extend the inheritance chain. This system does not require compiler RTTI.
Static queries describe the type declaring them; virtual queries describe the object's most-derived registered type. is<T>() checks exact identity, while is_derived_from<T>() also accepts base types.
The naming strategy affects class names, not class identifiers. Names may be empty or shared by several types. The protected destructor prevents deleting an object directly through an rtti_root pointer.
- Template Parameters
-
| naming_strategy_t | - strategy providing get_name(string_view) to transform the compiler-generated type signature into a class name |
- See also
- rtti_naming_strategy.h
- Author
- Khrapov
- Date
- 10.09.2021
Definition at line 68 of file rtti.h.