Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.ada

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2009, 08:36 AM
Steven Shack
Guest
 
Posts: n/a
Default Loadable module in Ada.

I'd like to create a loadable module in an Ada program. I've searched
around, but can't
seem to find any examples of this. Say I've got some calculation or a
driver and I'd like to have
multiple different versions of it with the same interface. I'd like to
be able to load and replace
these modules at runtime.

In C I'd do this with pic code, dlsym and function pointers. I can't
seem to find the equivalent
in Ada. Can anyone help me out?

Thanks


Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 12-03-2009, 09:00 AM
xavier grave
Guest
 
Posts: n/a
Default Re: Loadable module in Ada.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven Shack a écrit :
> I'd like to create a loadable module in an Ada program. I've searched
> around, but can't
> seem to find any examples of this. Say I've got some calculation or a
> driver and I'd like to have
> multiple different versions of it with the same interface. I'd like to
> be able to load and replace
> these modules at runtime.
>
> In C I'd do this with pic code, dlsym and function pointers. I can't
> seem to find the equivalent
> in Ada. Can anyone help me out?
>
> Thanks
>
>

Hi,

I have done something that seems to fit with your need.
Here is a link where you will find a tgz file compiling/running under
Linux using dlsym. It is based on an abstract class that your plugin
should inherit of.

http://dl.free.fr/pWQwqMpVK

Be very careful about the elaboration code when you do some "with" of
other package. One on the "best" policy is to be the more restrictive
that you can with the packages you "with" (pragma Pure and so on...)

Hope it will help...
xavier


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksXjEwACgkQVIZi0A5BZF4LwQCfVGP1MA2sfQ RRzvLoiCN8s1Oc
dQkAoKwEqm+RGqPc6UmhAMu2d2tqwnEG
=cLPw
-----END PGP SIGNATURE-----
Reply With Quote
  #3 (permalink)  
Old 12-03-2009, 09:49 AM
Steven Shack
Guest
 
Posts: n/a
Default Re: Loadable module in Ada.

Thank you very much. This shows me exactly how to do what I want.
I was hoping for a pure ada solution, but if I have to do dlsym I'm
fine with that.
I already know dlsym so it's not a problem.

On 2009-12-03 02:00:44 -0800, xavier grave <xavier.grave@ipno.in2p3.fr> said:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Steven Shack a écrit :
>> I'd like to create a loadable module in an Ada program. I've searched
>> around, but can't
>> seem to find any examples of this. Say I've got some calculation or a
>> driver and I'd like to have
>> multiple different versions of it with the same interface. I'd like to
>> be able to load and replace
>> these modules at runtime.
>>
>> In C I'd do this with pic code, dlsym and function pointers. I can't
>> seem to find the equivalent
>> in Ada. Can anyone help me out?
>>
>> Thanks
>>
>>

> Hi,
>
> I have done something that seems to fit with your need.
> Here is a link where you will find a tgz file compiling/running under
> Linux using dlsym. It is based on an abstract class that your plugin
> should inherit of.
>
> http://dl.free.fr/pWQwqMpVK
>
> Be very careful about the elaboration code when you do some "with" of
> other package. One on the "best" policy is to be the more restrictive
> that you can with the packages you "with" (pragma Pure and so on...)
>
> Hope it will help...
> xavier
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAksXjEwACgkQVIZi0A5BZF4LwQCfVGP1MA2sfQ RRzvLoiCN8s1Oc
> dQkAoKwEqm+RGqPc6UmhAMu2d2tqwnEG
> =cLPw
> -----END PGP SIGNATURE-----



Reply With Quote
  #4 (permalink)  
Old 12-03-2009, 12:40 PM
Mark Lorenzen
Guest
 
Posts: n/a
Default Re: Loadable module in Ada.

On 3 Dec., 10:36, Steven Shack <stevensh...@stevenshack.com> wrote:
> I'd like to create a loadable module in an Ada program. I've searched
> around, but can't
> seem to find any examples of this. Say I've got some calculation or a
> driver and I'd like to have
> multiple different versions of it with the same interface. I'd like to
> be able to load and replace
> these modules at runtime.
>
> In C I'd do this with pic code, dlsym and function pointers. I can't
> seem to find the equivalent
> in Ada. Can anyone help me out?
>
> Thanks


I'm not sure what you mean by loadable module, but if you mean dynamic
linking at run-time, you should take a look at this very interesting
article:
http://www.adacore.com/wp-content/up...g_with_ada.pdf

Note that you will of course still need support from the OS, so there
is no pure Ada
solution, just as there is no pure C solution (the dl* system calls
just happen to
have a C API).

- Mark
Reply With Quote
  #5 (permalink)  
Old 12-03-2009, 07:06 PM
Pascal Obry
Guest
 
Posts: n/a
Default Re: Loadable module in Ada.

Steven,

Look at the Gwiad module:

http://code.google.com/p/gwiad/

$ git clone git://repo.or.cz/gwiad.git

It is a framework using whatever OS services underneath based on Ada
interface.

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

Reply With Quote
 
Reply

Popular Tags in the Forum
ada, loadable, module

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Purchase Order using WIN32OLE Hu Newsgroup comp.lang.xharbour 1 12-09-2009 11:20 AM
sandbox python via module loader timprepscius Newsgroup comp.lang.python 0 11-23-2009 07:22 PM
Including a module in an included module. Prince Nez Newsgroup comp.lang.ruby 3 08-18-2009 11:46 AM
Program Fails When Parameter Fixed Constants are Changed (F77) ?? monir Newsgroup comp.lang.fortran 104 04-22-2009 09:14 PM
Re: Some test fail on my new Python 2.6 Sorin Schwimmer Newsgroup comp.lang.python 0 04-08-2009 03:42 AM



All times are GMT. The time now is 11:24 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.