C++ version of G2E