|
ltmm::loader< ThreadPolicy > Class Template Reference#include <ltmm/loader.hh>
Inheritance diagram for ltmm::loader< ThreadPolicy >: Detailed Descriptiontemplate<typename ThreadPolicy = single_thread>
Class to load dynamic libraries.
|
ThreadPolicy | A policy object that says how to lock structures in a multi-threaded environment. Per default it is ltmm::single_thread, but see alse that class for more documentation. |
Definition at line 138 of file loader.hh.
Preloading | |
void | preload (symbol &s) |
static symbol_map & | preloaded () |
Public Types | |
typedef ThreadPolicy | thread_policy_type |
typedef handle< thread_policy_type > | handle_type |
typedef backend< thread_policy_type > | backend_type |
typedef std::map< std::string, symbol_list > | symbol_map |
Public Member Functions | |
handle_type * | next_handle (handle_type *h) |
backend_type * | next_backend (backend_type *h) |
Loading and unloading libraries | |
handle_type & | load (const std::string &filename) |
void | unload (handle_type &h) |
The user-defined search path | |
void | addto_search_path (const std::string &dir) |
std::string | search_path (const std::string &path) |
std::string | search_path () const |
Iteration on handles | |
handle_iterator | begin_handle () |
handle_iterator | end_handle () |
Backend handling and iteration | |
void | insert_backend (backend_type &b) |
void | insert_backend (const backend_iterator &i, backend_type &b) |
void | remove_backend (backend_iterator &b) |
void | remove_backend (const std::string &name) |
backend_iterator | find_backend (const std::string &name) |
backend_iterator | begin_backend () |
backend_iterator | end_backend () |
Static Public Member Functions | |
static loader & | instance () |
Protected Member Functions | |
loader () | |
virtual | ~loader () |
Protected Attributes | |
lt_dlcaller_id | _id |
Static Protected Attributes | |
static loader * | _instance = 0 |
static thread_policy_type | _lock |
static symbol_map | _preloaded |
Classes | |
class | backend_iterator |
Forward iterator over backends in list. More... | |
class | guard |
Guard class. More... | |
class | handle_iterator |
Forward iterator over handles in list. More... |
|
Type of backends.
|
|
Type of handles.
|
|
The type of the map of symbol lists.
|
|
The type of thread locks.
|
|
Constructor. The constructor is protected, so that the client code can only access the loader via the singleton interface.
Definition at line 454 of file loader.hh. References ltmm::loader< ThreadPolicy >::_id, lt_dlcaller_register(), lt_dlinit(), and lt_dlmutex_register(). Here is the call graph for this function: |
|
Destructor. The destructor is protected, so that the client code can only access the loader via the singleton interface. Definition at line 473 of file loader.hh. References ltmm::loader< ThreadPolicy >::_instance, and lt_dlexit(). Here is the call graph for this function: |
|
Add a directory to user-defined library search path.
Definition at line 540 of file loader.hh. References ltmm::loader< ThreadPolicy >::_lock, and lt_dladdsearchdir(). Here is the call graph for this function: |
|
Get a forward iterator pointing to the first element in the backend list.
Definition at line 814 of file loader.hh. References ltmm::loader< ThreadPolicy >::next_backend(). Here is the call graph for this function: |
|
Return an iterator pointing at start of handle list.
Definition at line 687 of file loader.hh. References ltmm::loader< ThreadPolicy >::next_handle(). Here is the call graph for this function: |
|
Get a forward iterator pointing to just afte the end of the backend list.
Definition at line 825 of file loader.hh. Referenced by ltmm::loader< ThreadPolicy >::find_backend(), ltmm::loader< ThreadPolicy >::insert_backend(), and ltmm::loader< ThreadPolicy >::remove_backend(). |
|
return an iterator pointing just after end of list.
|
|
Find a backend loader.
Definition at line 889 of file loader.hh. References ltmm::loader< ThreadPolicy >::end_backend(), lt_dlloader_data(), and lt_dlloader_find(). Here is the call graph for this function: |
|
Insert after an iterator position.
Definition at line 844 of file loader.hh. References ltmm::loader< ThreadPolicy >::backend_iterator::_current, ltmm::backend< ThreadPolicy >::_place, lt_user_dlloader::dlloader_data, lt_user_dlloader::dlloader_exit, ltmm::loader< ThreadPolicy >::end_backend(), lt_user_dlloader::find_sym, lt_dlloader_add(), lt_dlloader_find(), lt_user_dlloader::module_close, lt_user_dlloader::module_open, ltmm::backend< ThreadPolicy >::name(), ltmm::backend< ThreadPolicy >::prefix(), and lt_user_dlloader::sym_prefix. Here is the call graph for this function: |
|
Add a backend to the list of loaders.
Definition at line 835 of file loader.hh. References ltmm::loader< ThreadPolicy >::end_backend(). Here is the call graph for this function: |
|
Get the static (singleton) object.
Definition at line 482 of file loader.hh. References ltmm::loader< ThreadPolicy >::_instance, and ltmm::loader< ThreadPolicy >::_lock. |
|
Load a dynamic library. If the same module is loaded several times, the same handle is returned. See also class description.
Definition at line 496 of file loader.hh. References ltmm::loader< ThreadPolicy >::_id, ltmm::loader< ThreadPolicy >::_lock, lt_dlcaller_get_data(), lt_dlcaller_set_data(), lt_dlgetinfo(), lt_dlopenext(), lt_ptr, and lt_dlinfo::ref_count. Here is the call graph for this function: |
|
Static member function used by backend_iterator.
Definition at line 708 of file loader.hh. References ltmm::backend< ThreadPolicy >::_place, lt_dlloader_data(), and lt_dlloader_next(). Referenced by ltmm::loader< ThreadPolicy >::begin_backend(), and ltmm::loader< ThreadPolicy >::backend_iterator::operator++(). Here is the call graph for this function: |
|
Static member function used by handle_iterator.
Definition at line 592 of file loader.hh. References ltmm::handle< ThreadPolicy >::_handle, ltmm::loader< ThreadPolicy >::_id, lt_dlcaller_get_data(), and lt_dlhandle_next(). Referenced by ltmm::loader< ThreadPolicy >::begin_handle(), and ltmm::loader< ThreadPolicy >::handle_iterator::operator++(). Here is the call graph for this function: |
|
Add a symbol to the preloaded symbols.
Definition at line 940 of file loader.hh. References lt_dlsymlist::address, lt_dlpreload(), ltmm::symbol::name(), lt_dlsymlist::name, and ltmm::symbol::ptr(). Here is the call graph for this function: |
|
Get (and set internally) list of preloaded symbols.
Note, that it is important that the program is linked with the
Definition at line 909 of file loader.hh. References ltmm::loader< ThreadPolicy >::_lock, ltmm::loader< ThreadPolicy >::_preloaded, lt_dlsymlist::address, lt_dlpreload_default(), lt_preloaded_symbols, and lt_dlsymlist::name. Here is the call graph for this function: |
|
Remove a backend from the list.
Definition at line 878 of file loader.hh. References lt_dlloader_remove(). Here is the call graph for this function: |
|
Remove a backend from the list.
Definition at line 868 of file loader.hh. References ltmm::loader< ThreadPolicy >::backend_iterator::_current, ltmm::loader< ThreadPolicy >::end_backend(), and ltmm::backend< ThreadPolicy >::name(). Here is the call graph for this function: |
|
Get the user-defined library search path.
Definition at line 559 of file loader.hh. References ltmm::loader< ThreadPolicy >::_lock, and lt_dlgetsearchpath(). Here is the call graph for this function: |
|
Set the user-defined library search path.
Definition at line 549 of file loader.hh. References ltmm::loader< ThreadPolicy >::_lock, lt_dlgetsearchpath(), and lt_dlsetsearchpath(). Here is the call graph for this function: |
|
Unload a library.
Decrement the reference count on the module
Definition at line 526 of file loader.hh. References ltmm::handle< ThreadPolicy >::_handle, ltmm::loader< ThreadPolicy >::_id, ltmm::loader< ThreadPolicy >::_lock, lt_dlcaller_set_data(), lt_dlclose(), lt_ptr, and ltmm::handle< ThreadPolicy >::reference_count(). Here is the call graph for this function: |
|
Caller ID to resolve user data in modules.
Definition at line 169 of file loader.hh. Referenced by ltmm::loader< ThreadPolicy >::load(), ltmm::loader< ThreadPolicy >::loader(), ltmm::loader< ThreadPolicy >::next_handle(), and ltmm::loader< ThreadPolicy >::unload(). |
|
Static (singleton) instance.
Definition at line 951 of file loader.hh. Referenced by ltmm::loader< ThreadPolicy >::instance(), and ltmm::loader< ThreadPolicy >::~loader(). |
|
Static lock.
Definition at line 955 of file loader.hh. Referenced by ltmm::loader< ThreadPolicy >::addto_search_path(), ltmm::loader< ThreadPolicy >::instance(), ltmm::loader< ThreadPolicy >::load(), ltmm::loader< ThreadPolicy >::preloaded(), ltmm::loader< ThreadPolicy >::search_path(), and ltmm::loader< ThreadPolicy >::unload(). |
|
Map of preloaded symbols.
Definition at line 958 of file loader.hh. Referenced by ltmm::loader< ThreadPolicy >::preloaded(). |