static means that there is only one instance of type shared between all function calls. It will be created when first required.
I could make it something like:
1 2 3 4
|
std::string get_id()
{
return "C_name";
}
|
But it would include creation of variable each call, so for sake of efficiency I made it static.
I added const to variable itself and to return type because I do not want for outside code to change this string.
I added const as qualifier of member function to make it avaliable on constant class instances.
Override means that this function should override some virtual function from parent class. It will generate error if it would not. It saves you from accdental errors when derived class does not actually override parent class function.
For example if I would write
virtual const std::string& get_id()
, I will not override parent class function because of missing const-qualifier. However if I add overide to the end, compiler will threat this as error, allowing me to see and fix my mistake.