Added c++ interface and test code.