34 #include "Poco/SharedLibrary.h" 56 return Poco::SharedLibrary::suffix();
71 CONSOLE_BRIDGE_logDebug(
72 "class_loader.ClassLoader: " 73 "Constructing new ClassLoader (%p) bound to library %s.",
74 this, library_path.c_str());
82 CONSOLE_BRIDGE_logDebug(
"%s",
83 "class_loader.ClassLoader: " 84 "Destroying class loader, unloading associated library...\n");
113 boost::recursive_mutex::scoped_lock plugin_ref_lock;
114 if (lock_plugin_ref_count) {
119 CONSOLE_BRIDGE_logWarn(
"class_loader.ClassLoader: SEVERE WARNING!!!\n" 120 "Attempting to unload %s\n" 121 "while objects created by this library still exist in the heap!\n" 122 "You should delete your objects before destroying the ClassLoader. " CLASS_LOADER_PUBLIC void loadLibrary(const std::string &library_path, ClassLoader *loader)
Loads a library into memory if it has not already been done so. Attempting to load an already loaded ...
CLASS_LOADER_PUBLIC bool isLibraryLoaded()
Indicates if a library is loaded within the scope of this ClassLoader. Note that the library may alre...
boost::recursive_mutex plugin_ref_count_mutex_
CLASS_LOADER_PUBLIC std::string systemLibraryFormat(const std::string &library_name)
Returns a platform specific version of a basic library name.
std::string library_path_
CLASS_LOADER_PUBLIC void unloadLibrary(const std::string &library_path, ClassLoader *loader)
Unloads a library if it loaded in memory and cleans up its corresponding class factories. If it is not loaded, the function has no effect.
bool ondemand_load_unload_
CLASS_LOADER_PUBLIC bool isOnDemandLoadUnloadEnabled()
Indicates if the library is to be loaded/unloaded on demand...meaning that only to load a lib when th...
CLASS_LOADER_PUBLIC std::string systemLibrarySuffix()
Returns runtime library extension for native os.
CLASS_LOADER_PUBLIC ClassLoader(const std::string &library_path, bool ondemand_load_unload=false)
Constructor for ClassLoader.
CLASS_LOADER_PUBLIC int unloadLibraryInternal(bool lock_plugin_ref_count)
As the library may be unloaded in "on-demand load/unload" mode, unload maybe called from createInstan...
CLASS_LOADER_PUBLIC bool isLibraryLoadedByAnyClassloader()
Indicates if a library is loaded by some entity in the plugin system (another ClassLoader), but not necessarily loaded by this ClassLoader.
CLASS_LOADER_PUBLIC bool isLibraryLoaded(const std::string &library_path, ClassLoader *loader)
Indicates if passed library loaded within scope of a ClassLoader. The library maybe loaded in memory...
CLASS_LOADER_PUBLIC int unloadLibrary()
Attempts to unload a library loaded within scope of the ClassLoader. If the library is not opened...
CLASS_LOADER_PUBLIC std::string getLibraryPath()
Gets the full-qualified path and name of the library associated with this class loader.
virtual CLASS_LOADER_PUBLIC ~ClassLoader()
Destructor for ClassLoader. All libraries opened by this ClassLoader are unloaded automatically...
static CLASS_LOADER_PUBLIC bool has_unmananged_instance_been_created_
CLASS_LOADER_PUBLIC std::string systemLibraryPrefix()
Returns the default library prefix for the native os.
CLASS_LOADER_PUBLIC void loadLibrary()
Attempts to load a library on behalf of the ClassLoader. If the library is already opened...
static CLASS_LOADER_PUBLIC bool hasUnmanagedInstanceBeenCreated()
Getter for if an unmanaged (i.e. unsafe) instance has been created flag.
CLASS_LOADER_PUBLIC bool isLibraryLoadedByAnybody(const std::string &library_path)
Indicates if passed library has been loaded by ANY ClassLoader.
boost::recursive_mutex load_ref_count_mutex_