the accessor pattern in c++