Indeed, it should be done in SAI, not C++.