Yes. RTTI.
Be careful, though, such coding style is always slow in any language.
I hope you know that. The overhead is quite considerable (again: in any language!).
Supported by IInvocable together with RTTI.
It is slow because it requires a look-up mechanism at run-time.