I'm a Java guy that is still learning some of the items with C++.
I'm designing my own board that will have an option of a wifi connection or a wired connection All for calling some simple restful web service.
I would like to define an interface (java term) or header file with different implementations of the code. For example, I would have a function/method to "callRestService(some parameters);
I would like to use a pragma statement (e.g. #ifdef) to link in one of the two implementations.
this seems a bit strange to me. From what i'm seeing in the examples is TWO header files; each with a different impl. My question was to have 1 header file with different impl. In the Java world, this would be an interface, then typically a factory to load the correct impl at run-time. I was was hoping to do this at link time with C.
So if I'm reading this correct, I should just create different header files.