Re: [Cppcms-users] Plugins and templates
Brought to you by:
artyom-beilis
|
From: Julian P. <ju...@wh...> - 2010-08-20 08:01:47
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 20.08.2010 08:46, schrieb Artyom:
>>
>> Would it be possible to register a view at runtime?
>>
>
> Not sure. It would required making views loading
> and unloading be thread safe
At least for my case thread safety for loading and unloading views
wouldn't be a problem, because my plugins are loaded sequentially for my
Plugin registration class not being thread safe either.
And wouldn't a simple thread lock suffice to allow only one call to the
views_pool loading system at a time? I think boost features already some
implementations in its thread part, you could integrate that to booster
as well if it isn't integrated yet.
> and make the interaction
> with actual DLL quite complicated.
What about a solution that would employ another factory here, a factory
for the view classes. So I could simply create a factory instance for
each view I want to register from my DSO.
Then my plugin would issue a request of this form in its constructor:
cppcms::views_pool::static_instance().extend_view("skin","view
name",booster::shared_ptr<viewfactory>)
Where the viewfactory pointed to by the shared_ptr would generate
instances of
cppcms::view_pool::view_builder<skin::view_class,content::master>
So interaction should be simplified.
> However, I do not really like the views_pool implementation so it
> is likely to be updated and may be this feature including unloading views
> may be implemented
>
>
> You may open feature request in bug tracking system
>
I'll do that later this day.
Julian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJMbjZhAAoJENidYKvYQHlQGC0P/j7Bb9chCKO6YHze9cNxUzYM
JhxQr8OjCS1kp7VyanN9dCsV2u8mHHoKylnOSdFlDoYKodGqo1azpqBDXuKbIKKl
g5VxpHIubknmApUp9RGQYU8bvqYrHfrc/v+F6ajxFCf+nxU4YGSa7reWdvrTsR7l
kt5yAjDuxUdf+O04DDUkQIQUZA0JmVPqnG2X28cklT5g54qnNIksvuuTw7gfgZ7b
/Vcu93sgJOOmQv5v51XF7LUH9h0IjTpxc2evO+FJyVEghEMsyJlelPnyWW88fh3K
pdqCv7KKOh+fMhtfjHSWHPJENpSe/Sy8pvdEOj2yvlIrJADPOLuxCgcJ9AJr4ThN
ulefQ+Cs2aOPk6IapX2A/i/pkA+Ugg4pUP5n+bnlg7J1Sz1tTrNo8C3uE+LfLn0H
3R7MlIVoKcH/T6tahZBy+mcxsZjg4zyIYDmmEOKN0tp1qGvLJGmTYWWuglUIQobw
EoeqWOiZ/CcJ/YlZvBA8NSssHtAZxbk8FS+i5h9wJUk1HdhkR/iuXQ7FnKnVuXez
MLy/NFiS45PetA9xYPlPAhN6KkWcOe7w168U30QdKw8sGOuzLxYn0+ERB4d0ZDuf
kWDNP9IFqE2kZ/+DknFZyiQfCoT45wQHYfS8wDwTjVw2jQdTUdlNEBf9B6Zt5vtI
6/16BFhTI4H0MtONfK6l
=Whjs
-----END PGP SIGNATURE-----
|