|
From: Christophe Prud'h. <pru...@MI...> - 2000-09-29 20:17:54
|
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?
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.
regards
C.
--
Christophe Prud'homme |
MIT, 77, Mass Ave, Rm 3-243 | The first thing we do, let's kill
Cambridge MA 02139 | all the lawyers.
Tel (Office) : (00 1) (617) 253 0229 | -- Wm. Shakespeare,
Fax (Office) : (00 1) (617) 258 8559 | "Henry VI", Part IV
http://augustine.mit.edu/~prudhomm |
Following the hacker spirit
|