There is an header file with a struct having a function pointer as one of the members. I am trying to pass a private function from one of the derived abstract class to the function pointer in the struct. How can I do that? 1. I do not want a class header. I want only the struct in the header. 2. Instantiating abstract classes also requires implementaion of virtual methods. Can that be avoided?
//Channel_U.h
namespace MFW
{
class Channel_U : public Channel
{
public:
tOData theOutData;
private:
void ProcessFuncInput(tAnalogChannel * pAC);
void Process_Null(tAnalogChannel * pAC);
};
}
//table.h
namespace MFW
{
typedef void (*tAnalogProcessFunc)(t_AnalogChannel * pAC);
typedef struct _tableEntry_
{
int gain;
void (*processFunc)(t_AnalogChannel *);
tAnalogProcessFunc procFunc;
}table
static const table configTable[] =
{
.processFunc = Process_Null, //HERE
.gain = 0,
.procFunc = ProcessFuncInput//HERE
};
}
I tried instantiating the class object and callign the function which led to errors:
'Process_Null' was not declared in this scope
'ProcessFuncInput' was not declared in this scope