Unix Programming - C++ Plugins

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2005 > C++ Plugins





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author C++ Plugins
pmatos

2005-03-15, 5:59 pm

Hi all,

What's the best way to develop a C++ plugin-aware software?
My idea is to provide an abstract class as an interface for the plugin
developer which compiles its program as a dynamic library and then the
main program works it with dlopen/dlsym/dlclose. Any other solution
(higher level solution)?

Cheers,

Paulo Matos

Bjorn Reese

2005-03-15, 5:59 pm

pmatos wrote:

> What's the best way to develop a C++ plugin-aware software?
> My idea is to provide an abstract class as an interface for the plugin
> developer which compiles its program as a dynamic library and then the
> main program works it with dlopen/dlsym/dlclose. Any other solution
> (higher level solution)?


The above solution is fine provided you can decide what C++ compiler,
and its version, is used for both the application and the plugins.

If you cannot, and this is typically the case, then you have to write
your interface in C to avoid problems with name mangling, and you must
make sure that no exceptions are thrown across the boundary between
the application and the plugin.

--
mail1dotstofanetdotdk
pip

2005-03-15, 5:59 pm

"pmatos" <pocm@sat.inesc-id.pt> writes:

> What's the best way to develop a C++ plugin-aware software? My idea
> is to provide an abstract class as an interface for the plugin
> developer which compiles its program as a dynamic library and then
> the main program works it with dlopen/dlsym/dlclose. Any other
> solution (higher level solution)?


This solution means tying your developers in with a particular
compiler/libs. Depending on your situation you might want to think
about embedding a Python or, dare I say it...Perl interpreter in your
app.

Cheers,

Pip
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com