I have an abstract base class.
I have a bunch of member functions in it which are not private nor static nor templates, just normal public member functions.
And I noticed that I have to define any these public normal functions that *are being called in the definition of other functions even if those functions are not being run by any code in main.
And what calls more my attention is that in any case if the class is abstract, why should actually be any function forcefully defined if the class itself is not going to be instantiated any way??
This is the firs question I post here, so sorry if I am not explaining myself well or doing something wrong.
Thanks in advance for your help!
Here is a shortened version of the class I am talking about:
#ifndef PROCESS_H_INCLUDED
#define PROCESS_H_INCLUDED
#include <iostream>
#include <memory>
using std::weak_ptr;
using std::shared_ptr;
class Process;
typedef shared_ptr<Process> shProcess;
typedef weak_ptr<Process> wProcess;
class Process
{
friend class ProcessManager;
public:
inline void AttachChild(shProcess shChild);
/*
FOR EXAMPLE I CAN LEFT THE FUNCTION ABOVE WITHOUT BEING DEFINE, BUT I HAVE
TO DEFINE THE FUNCTION BELOW OR I GET A COMPILER ERROR
COULD IT BE BECAUSE EVEN IF THIS CLASS IS ABSTRACT I AM USING IT AS A
PARAMETER OF OTHER FUNCTIONS FOR POLIMORPHIC PURPOSES?
*/
shProcess RemoveChild(void){return shProcess();}//reliases ownership of the child
shProcess PeekChild(void){return m_shChild;} //doesn´t release ownership of the child
};
#endif //PROCESS_H_INCLUDED