rttr icon indicating copy to clipboard operation
rttr copied to clipboard

Best way to find "directly" inherited types?

Open dand-oss opened this issue 6 years ago • 2 comments
trafficstars

Lets say we need the "tree" of inheritance to display in a gui or generate wrappers (non cpp) mirroring a class hierarchy

get_base_classes() returns ALL classes, as does get_derived_classes() is_base_of() and is_derived_from() both consider ALL types inherited

What it the best way to find the types "directly" inherited using the RTTR public API?

Ex struct a {} ; struct b : a {}; struct c {} ;

struct d : c, b {};

We want to return range of types "c, b" for stuct d rather than "a, b, c" as get_base_classes() provides

dand-oss avatar May 20 '19 00:05 dand-oss

Sorry, but at the moment there is no such function to get this information. I have to provide such function similar to this like get_properties(filter_item)

acki-m avatar May 21 '19 20:05 acki-m

PR #237 - add rttr:type::get_direct_base_classes()

dand-oss avatar May 22 '19 00:05 dand-oss