Reflection

IOPC2 uses GCCXML to obtain the metamodel description. GCCXML is a XML output extension to GCC. GCCXML uses GCC to parse the input source code and then dumps all declarations into a XML file, which can be easily parsed by other programs. IOPC2 uses the generated XML file to gain knowledge of the structure of classes in the processed source code. This information is then made accessible via reflection interface provided with the library. User applications can then query the class metamodel and use it in a way similar to applications written in reflective languages. The reflection mechanism used in IOPC2 is outlined in the following picture:

Diagram

The process is flexible and customisable. Developers can integrate it with their favourite IDEs or build systems. IOPC2 project contains an example of seamless IDE integration, see the iopcsp_make.sh script in the repository and the iopcsp_compile.sh script in the Eclipse CDT examples. This way the build process is almost transparent and users do not need to take any additional steps to make the reflection work.