I am talking about This. Now, my problem is that I have an interface header file which I really don't like to do any implementation in. Can a class derived from a base class declared in that header adopt this idiom? Because as far as I understood, I have to define the (protected) copy constructor for the base class which means that I have to do string (char*) copies. And I don't want to include any headers in my interface header file because of this. Any ideas?
EDIT:
class PluginFunction
{
public:
explicit PluginFunction(){}
virtual ~PluginFunction(){}
virtual int GetFunctionID() const = 0;
virtual const char* GetFunctionName() const = 0;
virtual bool EvalFunction(int&, RNode*, int){return true;}
virtual bool EvalFunction(double&, RNode*, int){return true;}
virtual bool EvalFunction(char*&, RNode*, int){return true;}
virtual PluginFunction* Clone();
protected:
explicit PluginFunction(const PluginFunction&)
{
//I dont want to strcpy :( which will have to include some header.
//Or I'll just iterate the buffer myself :).
}
private:
PluginFunction& operator=(const PluginFunction&);
int i_ID;
char* z_Name;
};