Reflection in c++
-
Hi I wanted to produce a mechanism like Reflection in c++ (without using dot net framework).can i do that..? How..? Is there any framework available to achieve this mechanism? Or simple i will provide a class name in a string to a function that function will return me a new object of that class. is it possible in simple C++ (Not using MFC or dot net). If yes please let me know also. Thanks in advance Ravi
-
Hi I wanted to produce a mechanism like Reflection in c++ (without using dot net framework).can i do that..? How..? Is there any framework available to achieve this mechanism? Or simple i will provide a class name in a string to a function that function will return me a new object of that class. is it possible in simple C++ (Not using MFC or dot net). If yes please let me know also. Thanks in advance Ravi
It's possible to emulate the effects of reflection and there are several attempts to provide this on the net. A few starters are http://cppxmlobj.sourceforge.net/index.html[^] and https://sourceforge.net/projects/reflection/[^] - have a look through google for more.
-
Hi I wanted to produce a mechanism like Reflection in c++ (without using dot net framework).can i do that..? How..? Is there any framework available to achieve this mechanism? Or simple i will provide a class name in a string to a function that function will return me a new object of that class. is it possible in simple C++ (Not using MFC or dot net). If yes please let me know also. Thanks in advance Ravi
-
Hi I wanted to produce a mechanism like Reflection in c++ (without using dot net framework).can i do that..? How..? Is there any framework available to achieve this mechanism? Or simple i will provide a class name in a string to a function that function will return me a new object of that class. is it possible in simple C++ (Not using MFC or dot net). If yes please let me know also. Thanks in advance Ravi
I am also not familiar with Reflection. However if all you want to do is to produce a new class object based on the string passed into a function, one of the factory methods would work fine. For achieving your simple aim, the Builder method or the Abstract Factory should suffice. I believe that there are various cool methods already on CodeProject on these subjects.