Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Introspection techniques, similar to python

Are there introspection techniques in C++ like those in python?

For example: I want to get more information about a specific object without going through the header file or referring back to cpp reference.

Am I asking a proper question, or moving the wrong direction here?

Update:

Based on the below answers, this answer is related to my question: How can I add reflection to a C++ application?

like image 607
securecurve Avatar asked May 14 '13 17:05

securecurve


1 Answers

C++ has a built in RTTI system, though it's for the most part horribly worthless. As a result custom introspection used instead.

Introspection in C++ is implemented with two main methods: preprocesing step where you scan cpp files and create a database/generate CPP code; use templating. I wrote some articles on the templating technique here.

If you're more interested in just using introspection rather than implementing it, I suggest looking up clReflect, or you can try cpfg.

like image 133
RandyGaul Avatar answered Sep 28 '22 16:09

RandyGaul