Re: [Cppcms-users] dynamic shared views
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-09-05 04:44:46
|
----- Original Message ----- > From: kpeo <sla...@ya...> > To: cpp...@li... > Cc: > Sent: Sunday, September 4, 2011 9:20 PM > Subject: [Cppcms-users] dynamic shared views > > Artyom, > > Is there way in engine of dynamically loading additional shared libs with view? > I.e. i know how to load shared library and call some class function in it, but > if i want to extend current view with pluggable one at runtime - whether > it's possible with current version? > > Regards, > kpeo > Actually it is possible even with current version. All view that is linked to executable is automatically registered (using global constructor) to the central singleton class that holds all views and unregistered when unloaded. So it is just enough to link the view to the plugin's shared object or load it as shared object of the view and you get it. Currently the code behind all this stuff is quite ugly and is going to be rewritten - code cleanup (it is the 1st or the 2nd task in the list) but the behavior would remain the same. And then it will be properly documented. The only restriction is that each view should have a separate name to prevent collide with each other. Artyom |