My application consists of several components, inheriting from an abstract base class. Except this the two member functions which each component overwrites, no component has any public declarations.
class Component()
{
public:
virtual void Init() = 0;
virtual void Update() = 0;
};
Since there are no other public methods or members, does it make sense to create header files? Could that save compilation time or is there another way to do so?
If you do not use the class outside a single CPP file, you do not need a header. Otherwise, you can avoid writing a header file at your own risk: the potential losses (inconsistent re-declarations of the base class) far outweigh the potential wins (speeding up the compile time). The readability of the overall project is going to suffer as well – other readers of your project will expect to see a header there, and would be surprised to see multiple copies in different files.