PLaSK library
|
Represent set of dynamically loaded library. More...
#include <plask/utils/dynlib/manager.hpp>
Public Types | |
typedef DynamicLibrarySet::const_iterator | iterator |
Type of iterator over loaded libraries. | |
typedef DynamicLibrarySet::const_iterator | const_iterator |
Type of iterator over loaded libraries. | |
Public Member Functions | |
DynamicLibraries ()=default | |
DynamicLibraries (const DynamicLibraries &)=delete | |
DynamicLibraries & | operator= (const DynamicLibraries &)=delete |
DynamicLibraries (DynamicLibraries &&)=default | |
DynamicLibraries & | operator= (DynamicLibraries &&)=default |
const_iterator | begin () const |
Allow to iterate over opened library included in this set. | |
const_iterator | end () const |
Allow to iterate over opened library included in this set. | |
const DynamicLibrary & | load (const std::string &file_name, unsigned flags=0) |
Load dynamic library and add it to this or throw exception if it's not possible. | |
void | close (const DynamicLibrary &to_close) |
Close given library if it is in this set. | |
void | closeAll () |
Close all holded libraries. | |
Static Public Member Functions | |
static DynamicLibraries & | defaultSet () |
Return default set of dynamic libraries (this set is deleted, so all libraries in it are closed, on program exit). | |
static const DynamicLibrary & | defaultLoad (const std::string &file_name, unsigned flags=0) |
Load dynamic library and add it to default set or throw exception if it's not possible. | |
static void | defaultClose (const DynamicLibrary &to_close) |
Close given library if it is in default set. | |
static void | defaultCloseAll () |
Close all libraries holded in default set. | |
Represent set of dynamically loaded library.
Close held libraries in destructor.
It also contains one static, singleton instance available by defaultSet(). This set is especially useful to load libraries which should be closed on program exit (see defaultLoad method).
Definition at line 30 of file manager.hpp.
typedef DynamicLibrarySet::const_iterator plask::DynamicLibraries::const_iterator |
Type of iterator over loaded libraries.
Definition at line 44 of file manager.hpp.
typedef DynamicLibrarySet::const_iterator plask::DynamicLibraries::iterator |
Type of iterator over loaded libraries.
Definition at line 41 of file manager.hpp.
|
default |
|
delete |
|
default |
|
inline |
Allow to iterate over opened library included in this set.
Definition at line 56 of file manager.hpp.
void plask::DynamicLibraries::close | ( | const DynamicLibrary & | to_close | ) |
Close given library if it is in this set.
to_close | library to close |
Definition at line 26 of file manager.cpp.
void plask::DynamicLibraries::closeAll | ( | ) |
Close all holded libraries.
Definition at line 30 of file manager.cpp.
|
inlinestatic |
Close given library if it is in default set.
to_close | library to close |
Definition at line 103 of file manager.hpp.
|
inlinestatic |
Close all libraries holded in default set.
Definition at line 106 of file manager.hpp.
|
inlinestatic |
Load dynamic library and add it to default set or throw exception if it's not possible.
Loaded library will be closed on program exit or can also be explicitly closed by defaultClose(const DynamicLibrary& to_close) method.
file_name | name of file with library to load |
flags | flags which describe configuration of open/close process, one or more (or-ed) flags from DynamicLibrary::Flags set |
Definition at line 97 of file manager.hpp.
|
static |
Return default set of dynamic libraries (this set is deleted, so all libraries in it are closed, on program exit).
Definition at line 34 of file manager.cpp.
|
inline |
Allow to iterate over opened library included in this set.
Definition at line 62 of file manager.hpp.
const DynamicLibrary & plask::DynamicLibraries::load | ( | const std::string & | file_name, |
unsigned | flags = 0 |
||
) |
Load dynamic library and add it to this or throw exception if it's not possible.
Loaded library will be closed by destructor of this or can also be explicitly closed by close(const DynamicLibrary& to_close) method.
file_name | name of file with library to load |
flags | flags which describe configuration of open/close process, one or more (or-ed) flags from DynamicLibrary::Flags set |
Definition at line 22 of file manager.cpp.
|
delete |
|
default |