Adding Rege C++ implementation

slightly changed cAutoSim.cpp to make the project able to compile.