Shared Library Refcountable Reference
Contains all the boost::dll::import* reference counting functions that hold a shared pointer to the instance of boost::dll::shared_library. result_typeconst boost::dll::fs::path &Path to shared library or shared library to load function from. const char *Null-terminated C or C++ mangled name of the function to import. Can handle std::string, char*, const char*. load_mode::typeload_mode::default_modeAn mode that will be used on library load.result_typeconst boost::dll::fs::path &const std::string &load_mode::typeload_mode::default_moderesult_typeconst shared_library &const char *result_typeconst shared_library &const std::string &result_typeshared_library &&const char *result_typeshared_library &&const std::string &Returns callable object or boost::shared_ptr<T> that holds the symbol imported from the loaded library. Returned value refcounts usage of the loaded shared library, so that it won't get unload until all copies of return value are not destroyed.This call will succeed if call to boost::dll::shared_library::has(const char* ) function with the same symbol name returned true.For importing symbols by alias names use boost::dll::import_alias method.Examples: boost::function<int(int)> f = import<int(int)>("test_lib.so", "integer_func_name"); auto f_cpp11 = import<int(int)>("test_lib.so", "integer_func_name"); boost::shared_ptr<int> i = import<int>("test_lib.so", "integer_name"); Template parameter T: Type of the symbol that we are going to import. Must be explicitly specified. callable object if T is a function type, or boost::shared_ptr<T> if T is an object type. result_typeconst boost::dll::fs::path &Path to shared library or shared library to load function from. const char *Null-terminated C or C++ mangled name of the function or variable to import. Can handle std::string, char*, const char*. load_mode::typeload_mode::default_modeAn mode that will be used on library load.result_typeconst boost::dll::fs::path &const std::string &load_mode::typeload_mode::default_moderesult_typeconst shared_library &const char *result_typeconst shared_library &const std::string &result_typeshared_library &&const char *result_typeshared_library &&const std::string &Returns callable object or boost::shared_ptr<T> that holds the symbol imported from the loaded library. Returned value refcounts usage of the loaded shared library, so that it won't get unload until all copies of return value are not destroyed.This call will succeed if call to boost::dll::shared_library::has(const char* ) function with the same symbol name returned true.For importing symbols by non alias names use boost::dll::import method.Examples: boost::function<int(int)> f = import_alias<int(int)>("test_lib.so", "integer_func_alias_name"); auto f_cpp11 = import_alias<int(int)>("test_lib.so", "integer_func_alias_name"); boost::shared_ptr<int> i = import_alias<int>("test_lib.so", "integer_alias_name"); Template parameter T: Type of the symbol alias that we are going to import. Must be explicitly specified. callable object if T is a function type, or boost::shared_ptr<T> if T is an object type.
This class represents an imported class.It must be constructed via boost::dll::import_class(const smart_library& lib, std::size_t, Args...) imported_class< T > unspecifiedconst smart_library &Args ... unspecifiedconst smart_library &std::size_tArgs... unspecifiedconst smart_library &Args... unspecifiedconst smart_library &std::size_tArgs... unspecifiedsmart_library &&Args... unspecifiedsmart_library &&std::size_tArgs... imported_class< T >smart_library &&Args... imported_class< T >smart_library &&std::size_tArgs... imported_class< T >const smart_library &Args... imported_class< T >const smart_library &std::size_tArgs... T *Returns a pointer to the underlying class. boolCheck if the imported class is move-constructible. boolCheck if the imported class is move-assignable. boolCheck if the imported class is copy-constructible. boolCheck if the imported class is copy-assignable. imported_class< T >Invoke the copy constructor. Undefined behaviour if the imported object is not copy constructible. imported_class< T >Invoke the move constructor. Undefined behaviour if the imported object is not move constructible. voidconst imported_class< T > &Invoke the copy assignment. Undefined behaviour if the imported object is not copy assignable. voidimported_class< T > &Invoke the move assignment. Undefined behaviour if the imported object is not move assignable. boolCheck if the class is loaded. const std::type_info &Get a const reference to the std::type_info. unspecifiedconst std::string &Call a member function. This returns a proxy to the function. The proxy mechanic mechanic is necessary, so the signaute can be passed.Example im_class.call<void(const char*)>("function_name")("MyString"); unspecifiedconst std::string &Call a qualified member function, i.e. const and or volatile.Example im_class.call<const type_alias, void(const char*)>("function_name")("MyString"); unspecifiedunspecifiedOverload of ->* for an imported method. unspecifiedconst std::string &Import a method of the class. imported_class & imported_class &&Move constructor. imported_class &imported_class & imported_class &imported_class &&Move assignmend. imported_class< T >const smart_library &Path to shared library or shared library to load function from. std::size_tArgs...imported_class< T >const smart_library &std::size_tconst std::string &Args...imported_class< T >const smart_library &const std::string &std::size_tArgs...imported_class< T >smart_library &&Args...imported_class< T >smart_library &&const std::string &Args...imported_class< T >smart_library &&std::size_tArgs...imported_class< T >smart_library &&std::size_tconst std::string &Args...imported_class< T >smart_library &&const std::string &std::size_tArgs...Returns an instance of imported_class which allows to call or import more functions. It takes a copy of the smart_libray, so no added type_aliases will be visible, for the object.Few compilers do implement an allocating constructor, which allows the construction of the class without knowing the size. That is not portable, so the actual size of the class shall always be provided.Example: auto import_class<class type_alias, const std::string&, std::size_t>(lib, "class_name", 20, "param1", 42); In this example we construct an instance of the class "class_name" with the size 20, which has "type_alias" as an alias, through a constructor which takes a const-ref of std::string and an std::size_t parameter. class object. imported_class< T >smart_library &Args... imported_class< T >smart_library &const std::string &Args... imported_class< T >smart_library &std::size_tArgs... imported_class< T >smart_library &std::size_tconst std::string &Args... imported_class< T >smart_library &const std::string &std::size_tArgs...
result_typeconst boost::dll::fs::path &Path to shared library or shared library to load function from. const char *Null-terminated C or C++ mangled name of the function to import. Can handle std::string, char*, const char*. load_mode::typeload_mode::default_modeAn mode that will be used on library load.result_typeconst boost::dll::fs::path &const std::string &load_mode::typeload_mode::default_moderesult_typeconst smart_library &const char *result_typeconst smart_library &const std::string &result_typesmart_library &&const char *result_typesmart_library &&const std::string &result_typeconst shared_library &const char *result_typeconst shared_library &const std::string &result_typeshared_library &&const char *result_typeshared_library &&const std::string &Returns callable object or boost::shared_ptr<T> that holds the symbol imported from the loaded library. Returned value refcounts usage of the loaded shared library, so that it won't get unload until all copies of return value are not destroyed.For importing symbols by alias names use boost::dll::import_alias method.Examples: boost::function<int(int)> f = import_mangled<int(int)>("test_lib.so", "integer_func_name"); auto f_cpp11 = import_mangled<int(int)>("test_lib.so", "integer_func_name"); boost::shared_ptr<int> i = import_mangled<int>("test_lib.so", "integer_name"); Additionally you can also import overloaded symbols, including member-functions.auto fp = import_mangled<void(int), void(double)>("test_lib.so", "func"); auto fp = import_mangled<my_class, void(int), void(double)>("test_lib.so", "func"); If qualified member-functions are needed, this can be set by repeating the class name with const or volatile. All following signatures after the redifintion will use this, i.e. the latest. *auto fp = import_mangled<my_class, void(int), void(double), const my_class, void(int), void(double)>("test_lib.so", "func"); Template parameter T: Type of the symbol that we are going to import. Must be explicitly specified. callable object if T is a function type, or boost::shared_ptr<T> if T is an object type.