api:cpp: add singleton base class