|
From: Frank V. C. <fr...@co...> - 2000-09-30 00:34:58
|
Christophe Prud'homme wrote:
>
> I think that we should rely on libtool for the default implementation.
>
> I mean that the library to be loaded may have the following
> name "plugin" and the real name(built internally) is "libplugin.la" which
> is a file generated by libtool. this file contains informations about
> dependencies.
>
> Loading a .so is ok but the dependencies won't be met automatically so you
> have to do it "by hand" which is boring and ugly.
>
> >From my experience of loading c++ libraries, you provide a c function with
> "C" external linking:
> the developper of the library "plugin" has to provide something like
>
> extern "C" {
> void* init_plugin()
> {
> return new plugin;
> }
> }
>
> Moreover what about library destruction?
> what if the library loader is destroyed while some libraries are still loaded?
> will we use some kind of reference counting to keep track of the libraries
> which are loaded
> - +1 when the library sends a message that the object has been created
> successfully
> - -1 if destroyed
> that is we should implement some kind of event notification system
> (mediator/observer?)
>
> thoughts?
The ld takes care of reference counting.
>
> As you may have noticed, I am willing to do the default library
> implementation :). I would like to have it working as quickly as possible.
Yes, but what of the type information? This was the purpose of the meta
class, and more importantly, the Library Load abstraction. Work with me
on the metaclass, it will be a much more rewarding and flexible
framework.
--
Frank V. Castellucci
http://corelinux.sourceforge.net
OOA/OOD/C++ Standards and Guidelines for Linux
http://PythPat.sourceforge.net
Pythons Pattern Package
|