Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to find "directly" inherited types? #236

Open
dand-oss opened this issue May 20, 2019 · 2 comments
Open

Best way to find "directly" inherited types? #236

dand-oss opened this issue May 20, 2019 · 2 comments

Comments

@dand-oss
Copy link
Contributor

dand-oss commented May 20, 2019

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

@acki-m
Copy link
Contributor

acki-m commented May 21, 2019

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)

@dand-oss
Copy link
Contributor Author

dand-oss commented May 22, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants