openenergysolutions / modbus-cpp

Modbus TCP master library in modern C++
https://aegis4ics.github.io/modbus-cpp/
Apache License 2.0
2 stars 0 forks source link

Only use forward declares when implementation hiding is a goal? #8

Closed jadamcrain closed 6 years ago

jadamcrain commented 6 years ago

Use of forward declares seems to be non-productive in a number of places, e.g. IModbusManager. The forward-declared classes have to be included when compiling anyway in almost all situations, which then requires the user to manually include additional files which makes the library harder to use.

I suspect aggressive forward declarations are used ATM with the goal of reducing compile times? It may make more sense to use forward declares in non-public headers, but use includes in public headers to ease library usage.

Another possible way to mitigate this issue would be to have a global "Modbus.h" file that includes all required public headers.

emgre commented 6 years ago

Done in #12.