gomd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gomd-devel] Re: Dynamic class loader: example


From: Matthias Rechenburg
Subject: [gomd-devel] Re: Dynamic class loader: example
Date: Sun, 30 Mar 2003 12:38:39 +0200
User-agent: KMail/1.4.3

Hey JP,

On Samstag 29 März 2003 22:56, Gian Paolo Ghilardi wrote:
> Hi all.
>
> I've read some docs to understand how to instance a class from a library in
> Linux.
> BTW: Linux's lib loading functions are "pure" C functions and, obviously,
> dont' understand what's a class... :)))
>
> I hope you all like this simple example of dynamic class loading.

"yes",
and again "yes" ! :) perfect !
This is a good framework. please commit to the cvs
(i did not tested them it yet but i went over the files and it
looks very ok to me)

Now we just need to impletment the getload function to
- read the gomd-configuration from the config-file 
  (maybe we should do this once at construction time and put
  it in a global variable/struct)
- post a reqest to the configured gomd socket
- get the returned value
- and return it (or an error happened)

and after that we can create all other methods 
(or at least the most of them) in a similar way.

>
> The package contains 3 files:
>
> - main.cpp    (main code: contains the calls to Linux's library loader)
> - libgomd.cpp (is the class loaded at runtime)
> - lgomd.hpp (an header used by both main.cpp and libgomd.cpp: so the main
> app knows what to load!)
>
> How to compile:
> - main.cpp:        g++ main.cpp -o testlib.app -ldl
> - libgomd.cpp:   g++ libgomd.cpp -o libgomd.so -shared

yep, just put it in the libgomd Makefile
..... and we need also to link the libgomd to the commoncpp lib
because it will use similar methods from commoncpp to connect
to the gomd socket.

>
> How to execute
> - ./testlib.app [nodeId]
>
>
> Obviously the two binaries must be in the same directory... :)
>
> Reference links:
> - http://www.linuxjournal.com/article.php?sid=3687
> - http://www.jdkoftinoff.com/linux1.html
> -
> http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/other-formats/pdf/C++-dlop
>e n.pdf

all bookmarked.

>
> I need you comments... :)

here you got them. Many thanks JP !

>
> Bye.
>
> <rejected>

all the best for you all,

Matt
-- 
E-mail  :  address@hidden
www     : http://www.openmosixview.com
an openMosix-cluster management GUI

The feature you'd like to have is probably already installed on your
Linux system.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]