Automatic class registration in C++ is a common task, and a commonly asked question here on StackOverflow:
Register an object creator in object factory
Somehow r
Writing Java code in C++ rarely works well. All those heap allocations are probably what's killing performance (as they would in Java, but Java startup is so slow that nobody would notice). Use static objects, and don't put a Registrar
object into each generated class; that's just a waste of time and space.