Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ runtime knowledge of classes

Tags:

c++

class

runtime

I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded.

Is there a way to determine what classes have been compiled, at run-time preferably, so that I can remove the linking and instead provide dynamically loadable libraries instead.

like image 943
X-Istence Avatar asked Mar 31 '26 01:03

X-Istence


1 Answers

Are you looking for C++ runtime class registration? I found this link (backup).

That would probably accomplish what you want, I am not sure about the dynamically loaded modules and whether or not you can register them using the same method.

like image 146
Denice Avatar answered Apr 02 '26 13:04

Denice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!