add cpp version adapter pattern