I need to develop an application with lots of version variations. In fact it is not even an application, but rather a framwork to create other apps by selecting modules to use.
Hence, I need to be able to include/exclude modules to/from compilation. This is no big deal, I can use compiler #defines. However, I cannot find a way to somehow register included set of modules. I.e. I want a list of included modules to be accessible via some library class.
On desktop I would write in modules source files static section something like:
why do not use "dynamically loaded" DLLs and define your own protocol to register your modules ?
This is a "pre-ECOM" solution that works well on Symbian OS 6.1.
Hmm... Because size requirements are very tight. This is for production testing and we are likely to include only subset of Symbian, just to test the hardware and/or drivers. Therefore I would like to use Symbian services as little as possible.
Thank you for opinion, I will reconcider DLL option
You can use singletons as bridges to your modules and your code will look like #ifdef __SOMETHING //create bridge singleton #endif #ifdef __SOMTHINGELSE //create other singleton #endif
In singleton you can obtain the entry point to you modules and in the code simply check if there is already an instance of the singleton. If yes....use the module if not drop it
Lucian, currently I am also coming to this decision. Unfortunately it has drawbacks also..
The whole ifdef script has to be in some central library file and I'll have to modify it whenever I develop a new module. And the nature of the project is such, that different modules are likely to be developed by different people in a long period of time..
I am thinking if I can allow this. Unfortunately I can't see any better solution now.
P.S. Actually Eric's solution also required that central module new of all the possible DLLs. If I understood him correctly
Lucian, currently I am also coming to this decision. Unfortunately it has drawbacks also..
The whole ifdef script has to be in some central library file and I'll have to modify it whenever I develop a new module. And the nature of the project is such, that different modules are likely to be developed by different people in a long period of time..
I am thinking if I can allow this. Unfortunately I can't see any better solution now.
P.S. Actually Eric's solution also required that central module new of all the possible DLLs. If I understood him correctly
If you don't want to change the central library you can store the configurations in a config file. Something like: LIB1_EXIST = TRUE|FALSE a.s.o. You'll read the file at start up and instead of using ifdef construction use if (lib1_exist_read_fromfile) //create singleton bridge
You'll can virtually change through this file the libraries that you are using and don't have to change/recompile the central module
Forum posts: 78
Compilable Symbian Code Examples
Forum posts: 2133
This is a "pre-ECOM" solution that works well on Symbian OS 6.1.
Eric
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 78
This is a "pre-ECOM" solution that works well on Symbian OS 6.1.
Hmm... Because size requirements are very tight. This is for production testing and we are likely to include only subset of Symbian, just to test the hardware and/or drivers. Therefore I would like to use Symbian services as little as possible.
Thank you for opinion, I will reconcider DLL option
Compilable Symbian Code Examples
Forum posts: 982
#ifdef __SOMETHING
//create bridge singleton
#endif
#ifdef __SOMTHINGELSE
//create other singleton
#endif
In singleton you can obtain the entry point to you modules and in the code simply check if there is already an instance of the singleton. If yes....use the module if not drop it
Lucian
pirosl
Forum posts: 78
Unfortunately it has drawbacks also..
The whole ifdef script has to be in some central library file and I'll have to modify it whenever I develop a new module. And the nature of the project is such, that different modules are likely to be developed by different people in a long period of time..
I am thinking if I can allow this. Unfortunately I can't see any better solution now.
P.S.
Actually Eric's solution also required that central module new of all the possible DLLs. If I understood him correctly
Compilable Symbian Code Examples
Forum posts: 2133
No, you can lookup all the *.dll files in a specified directory and then dynamically load each DLL you find using RLibrary::Load() method.
Eric
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 982
Unfortunately it has drawbacks also..
The whole ifdef script has to be in some central library file and I'll have to modify it whenever I develop a new module. And the nature of the project is such, that different modules are likely to be developed by different people in a long period of time..
I am thinking if I can allow this. Unfortunately I can't see any better solution now.
P.S.
Actually Eric's solution also required that central module new of all the possible DLLs. If I understood him correctly
If you don't want to change the central library you can store the configurations in a config file.
Something like: LIB1_EXIST = TRUE|FALSE a.s.o. You'll read the file at start up and instead of using ifdef construction use
if (lib1_exist_read_fromfile)
//create singleton bridge
You'll can virtually change through this file the libraries that you are using and don't have to change/recompile the central module
Lucian
pirosl