Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

plugin.hpp File Reference

#include <s11n.net/s11n/plugin/path_finder.hpp>
#include <s11n.net/s11n/plugin/plugin_config.hpp>

Go to the source code of this file.

Namespaces

namespace  s11n
namespace  s11n::plugin

Defines

#define plugin_PLUGIN_HPP_INCLUDED   1

Functions

path_finder & path ()
 The shared lookup path for plugins.
std::string find (const std::string &basename)
 Returns path().find( basename ).
std::string open (const std::string &basename)
 Uses find(basename) to search for a file and, if successful, opens it using a platforms-specific DLL opener.
std::string dll_error ()
 Called immediately after open() fails, it returns a platforms-specific error string.


Define Documentation

#define plugin_PLUGIN_HPP_INCLUDED   1
 

Definition at line 2 of file plugin.hpp.


Function Documentation

std::string dll_error  ) 
 

Called immediately after open() fails, it returns a platforms-specific error string.

On platforms using libdl or libltdl, this function returns the result of calling dlerror() or lt_dlerror(), respectively. On Windows platforms it always returns an empty string (anyone now how to get such error strings from Windows?).

Calling this twice in a row will, without calling open() in between always cause an empty string to be returned on the second call. See the man pages for dlerror() or lt_dlerror() for more details on this, though this function also behaves that way under Win32.

std::string find const std::string &  basename  ) 
 

Returns path().find( basename ).

std::string open const std::string &  basename  ) 
 

Uses find(basename) to search for a file and, if successful, opens it using a platforms-specific DLL opener.

It does not manipulate the DLL except to open it. The handle to the DLL is lost: it will be closed by the OS when the application exits. (The reasons for this are documented in the paper entitled "Classloading in C++", available from http://s11n.net/papers/.)

Returns the path to the DLL, or an empty string on error. There is currently no way of knowing what the error might have been.

The path() is used to find the DLL. If basename is an absolute path to an existing file, it will be used as-is, which means that a client-specified path_finder object may be used to find DLLs, and then pass them to this function to do the platform-specific work of opening the DLL.

path_finder& path  ) 
 

The shared lookup path for plugins.

It is initialized to contain a path and list of extensions defined in plugin_config.hpp.


Generated on Thu Sep 29 20:01:15 2005 for libs11n-1.1.3-dev by  doxygen 1.4.1