Recent

Author Topic: [Solved] RTTI headache  (Read 804 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 1739
  • Compiler Developer
Re: [Solved] RTTI headache
« Reply #15 on: February 25, 2020, 09:56:06 am »
Did you read all of my message? You even quoted it: I stressed that retrieving is the problem currently. As long as you can get a pointer to the function or method you can call it, but you need to roll your own way to get the pointer currently.
Ah, you said:
Quote
It's retrieving non-published functions which is not implemented currently.
So I assumed retrieving public/published functions wouldn't be a problem and wanted to get an example.

Between published and public there is the small, but in this case very important difference of RTTI that is available for the former, but not for the later (at least as of now; that will change with Extended RTTI). So when I say published I really mean published and not public.

But I take it, from your response, you can't get the code-pointer to public functions from an unknown class via RTTI.
(and that was what I was referring to when I said "Getting to a public function is a lot harder.")

But as long as you have some type registry and the method is published one can use that.

B.T.W. If the TMyObject.DoTest is known... just casting it in code would be easier for TS anyway.

Oh definitely. But one might one to prepare the code for what is to come in the future. ;)

 

TinyPortal © 2005-2018