Run Time Type Info - are the type names of all classes defined in a unit stored in the RTTI?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Run Time Type Info - are the type names of all classes defined in a unit stored in the RTTI?

Dennis
Programmatically, I want to make a list of all Classes defined in the unit.
Is this info stored in the RTTI or anywhere else?

Thanks in advance.

Dennis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Run Time Type Info - are the type names of all classes defined in a unit stored in the RTTI?

Sven Barth-2

Am 01.03.2017 11:53 schrieb "Dennis" <[hidden email]>:
>
> Programmatically, I want to make a list of all Classes defined in the unit.
> Is this info stored in the RTTI or anywhere else?

This info is not yet available, but will be in the future.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Run Time Type Info - are the type names of all classes defined in a unit stored in the RTTI?

Dennis Poon


Sven Barth wrote:

>
> Am 01.03.2017 11:53 schrieb "Dennis" <[hidden email]
> <mailto:[hidden email]>>:
> >
> > Programmatically, I want to make a list of all Classes defined in
> the unit.
> > Is this info stored in the RTTI or anywhere else?
>
> This info is not yet available, but will be in the future.
>

Thanks.

Ideally, with this feature, in the initialization section of the unit, I
can 'register' all the classes defined in the unit into a
dictionary<String, TClass>.
That way, when loading objects from file, I can use the dictionary to
lookup the actual TClass with the stored Classname, to recreate the
object stored.

Dennis
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Run Time Type Info - are the type names of all classes defined in a unit stored in the RTTI?

Sven Barth-2

Am 02.03.2017 06:30 schrieb "Dennis Poon" <[hidden email]>:
>
>
>
> Sven Barth wrote:
>
>>
>> Am 01.03.2017 11:53 schrieb "Dennis" <[hidden email] <mailto:[hidden email]>>:
>> >
>> > Programmatically, I want to make a list of all Classes defined in the unit.
>> > Is this info stored in the RTTI or anywhere else?
>>
>> This info is not yet available, but will be in the future.
>>
>
> Thanks.
>
> Ideally, with this feature, in the initialization section of the unit, I can 'register' all the classes defined in the unit into a dictionary<String, TClass>.
> That way, when loading objects from file, I can use the dictionary to lookup the actual TClass with the stored Classname, to recreate the object stored.

For now you'll simply have to do it manually for each class...

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal