hello folks,
i keep hitting the situation where i have a class that naturally has
some data, but has two modes of use.
say for example we have ...
class ProblemClass {
int m_Data;
};
now, i want to provide a public interface to the user, so i add a get
method.
what happens when i have another class that wants to use ProblemClass,
behind the scenes, unbeknownst to the user? I can't make the api that
class wants to use public as well, because then the user can play with
it.
i end up with a public api, and a protected api, and the behind the
scenes class gets declared a friend, or i have friend methods on some
class.
is there a clean way to say, here is some data, A can access it via api
A, and B and access it by api B?