Hi folks,
I am writing a application in which different components will be added
with time. Each component in each own C++ source , header file. I want
each component to have a generic interface (functions).
Each component will have a unique namespace to encapsulate the generic
functions to the component. My question is this: Is it possible for the
main routine that processes these components to dynamically solve the
namespace before calling the appropriate function ?
Example: Every component will have a GetID() function.
Component 1 (comp1.cpp)
---------------------------------------
namespace comp_one
{
long GetID(void);
}
Component 2 (comp2.cpp)
---------------------------------------
namespace comp_two
{
long GetID(void);
}
MAIN routine (main.cpp)
------------------------------------
// scan through settings file
MaxComps = read from ini file;
for (int i=1;i<MaxComps;i++)
{
< Namespace i >::GetID();
// do something ...
}
// continue
Reagrds
joe