D
digz
Hello,
Apologies if this is the wrong group for this question. I want to
design an interface , where for a custom functionality , the client
writes a new class with the function implementation and then puts the
name of the Class as a configuration parameter or something and then
the main program loads the new class like a module and the client can
now write code using the new Functions. I suppose this problem has
been solved before , if so what is the best way to do this .
Thanks
Digz
Example :
I have already provided him with
printInt.cc :
struct printInt {
void operator ()(int i)
{ Print(i); }
Now the user wants to write a class and start using the implementation
in the class
printDbl.cc which is
struct printDbl{
void operator ()(double i)
{ Print(i); }
int main()
{
Config* c = readConfig();
For name in c->classNames():
Load( name ) ;
printDbl pd;
pd(1.0);
}
Apologies if this is the wrong group for this question. I want to
design an interface , where for a custom functionality , the client
writes a new class with the function implementation and then puts the
name of the Class as a configuration parameter or something and then
the main program loads the new class like a module and the client can
now write code using the new Functions. I suppose this problem has
been solved before , if so what is the best way to do this .
Thanks
Digz
Example :
I have already provided him with
printInt.cc :
struct printInt {
void operator ()(int i)
{ Print(i); }
Now the user wants to write a class and start using the implementation
in the class
printDbl.cc which is
struct printDbl{
void operator ()(double i)
{ Print(i); }
int main()
{
Config* c = readConfig();
For name in c->classNames():
Load( name ) ;
printDbl pd;
pd(1.0);
}