add cpp version stat singleton pattern