Good Evening,
Im new to C++ but I was under the impression it was a no go to Define functions within header files.
I've been looking at some open source code and it seems a class has been defined within a header file and not split into .h / .cpp.
class Action
{
public:
virtual ~Action() {}
virtual string GetName() { return "Action"; }
virtual void RequestUpdate(ActionContext* context) {}
virtual void Do(ActionContext* context, double value) {}
virtual void Touch(ActionContext* context, double value) {}
virtual double GetCurrentNormalizedValue(ActionContext* context) { return 0.0; }
virtual double GetCurrentDBValue(ActionContext* context) { return 0.0; }
int GetPanMode(MediaTrack* track)
{
double pan1, pan2 = 0.0;
int panMode = 0;
DAW::GetTrackUIPan(track, &pan1, &pan2, &panMode);
return panMode;
}
};
There seem to be many other header files defining functions in the same project. Am I missing something here?