I have a 3P header file which I use, and I have made a wrapper around it. I want my client code to just access the wrapper and not the classes inside the parent header file or even be aware that the 3P header file classes exist. Is there someway I can achieve this?
ThirdPartyLibrary.h
class P3
{
std::string str;
int integer;
// getter functions
};
Wrapper.h
#include "ThirdPartyLibrary.h"
class WrapperClass
{
P3 pobj;
// return members of P3
};
Client.cpp
#include "Wrapper.h"
int main()
{
Wrapper obj; // Allowed
P3 obj2; // Shouldn't be allowed
return 0;
}