mercredi 10 avril 2019

How to workaround missing package access modifier in C++?

Let there be several WebAPIs giving access to similar data structures. I want to design a library offering classes for the data structures and an ABC for the WebAPIs. Each WebAPI is represented by an internal subclass which can be instanciated by the client using a factory method.

Now I have difficulties coming up with a slim and clean design. The problem I have is that notifications are received async in the WebAPI subclasses, which can't access the data structures private members. Java would perfectly solve this with the package access modifier. But how would I solve this in C++ without ugly hacks and a lot of boilerplate code?

Aucun commentaire:

Enregistrer un commentaire