Re: Static variables reset inside CFPlugin code
Re: Static variables reset inside CFPlugin code
- Subject: Re: Static variables reset inside CFPlugin code
- From: Grandinetti Philip <email@hidden>
- Date: Mon, 02 Jan 2012 09:47:52 -0500
Sorry Jens,
I read too quickly. The app is for the physical and engineering sciences, and will perform a least squares fit of experimental data to different physical models. The models for the experimental data will be in the plugins, and the user will likely only need to the load a few of the plugin models. In the host app (actually in one of it's static libraries dedicated to handling SI Units) is a static variable pointing to a singleton library (CFMutableSet) with a growing set of SI units available in the main app (and plugins). The units are flyweights, so I don't want multiple copies floating around the program.
So, I can't really define the static variable pointing to my library in the plugin. It needs to be defined in the library that handles all the SI units.
Is it still possible to tell the linker to export the static variable pointing to my SI Units library in such a situation?
Thanks again,
Philip
On Jan 1, 2012, at 9:49 PM, Jens Alfke wrote:
>
> On Jan 1, 2012, at 2:21 PM, Grandinetti Philip wrote:
>
>> Your suggestions make sense, although...
>> option (a) doesn't work for me, since the static variables are being used before the plugin is loaded.
>
> They're not options, they're steps. You need to do all of them.
>
> If you can't put the variable in the plugin, I _think_ you can put it in the app, then export it from the app and link the plugin against the app. Apps don't normally export symbols, but I think you can set this up.
>
> Maybe you could explain what the plugin does and why it and the app need to share a variable?
>
> —Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden