APIs are changed so that you can use them in a cpp-style.

std::shared_ptr is required.