Continue porting python interface code to c++.