Namespaces | Typedefs | Functions
class_loader_core.hpp File Reference
#include <boost/thread/recursive_mutex.hpp>
#include <cstddef>
#include <cstdio>
#include <map>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
#include "class_loader/exceptions.hpp"
#include "class_loader/meta_object.hpp"
#include "class_loader/visibility_control.hpp"
Include dependency graph for class_loader_core.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 class_loader
 
 class_loader::impl
 
 Poco
 

Typedefs

typedef std::string class_loader::impl::BaseClassName
 
typedef std::map< BaseClassName, FactoryMap > class_loader::impl::BaseToFactoryMapMap
 
typedef std::string class_loader::impl::ClassName
 
typedef std::map< ClassName, impl::AbstractMetaObjectBase * > class_loader::impl::FactoryMap
 
typedef std::pair< LibraryPath, Poco::SharedLibrary * > class_loader::impl::LibraryPair
 
typedef std::string class_loader::impl::LibraryPath
 
typedef std::vector< LibraryPair > class_loader::impl::LibraryVector
 
typedef std::vector< AbstractMetaObjectBase * > class_loader::impl::MetaObjectVector
 

Functions

template<typename Base >
Baseclass_loader::impl::createInstance (const std::string &derived_class_name, ClassLoader *loader)
 This function creates an instance of a plugin class given the derived name of the class and returns a pointer of the Base class type. More...
 
CLASS_LOADER_PUBLIC std::vector< std::string > class_loader::impl::getAllLibrariesUsedByClassLoader (const ClassLoader *loader)
 This function returns the names of all libraries in use by a given class loader. More...
 
template<typename Base >
std::vector< std::string > class_loader::impl::getAvailableClasses (ClassLoader *loader)
 This function returns all the available class_loader in the plugin system that are derived from Base and within scope of the passed ClassLoader. More...
 
CLASS_LOADER_PUBLIC ClassLoader * class_loader::impl::getCurrentlyActiveClassLoader ()
 Gets the ClassLoader currently in scope which used when a library is being loaded. More...
 
CLASS_LOADER_PUBLIC std::string class_loader::impl::getCurrentlyLoadingLibraryName ()
 When a library is being loaded, in order for factories to know which library they are being associated with, they use this function to query which library is being loaded. More...
 
template<typename Base >
FactoryMap & class_loader::impl::getFactoryMapForBaseClass ()
 Same as above but uses a type parameter instead of string for more safety if info is available. More...
 
CLASS_LOADER_PUBLIC FactoryMap & class_loader::impl::getFactoryMapForBaseClass (const std::string &typeid_base_class_name)
 This function extracts a reference to the FactoryMap for appropriate base class out of the global plugin base to factory map. This function should be used by functions in this namespace that need to access the various factories so as to make sure the right key is generated to index into the global map. More...
 
CLASS_LOADER_PUBLIC BaseToFactoryMapMap & class_loader::impl::getGlobalPluginBaseToFactoryMapMap ()
 Gets a handle to a global data structure that holds a map of base class names (Base class describes plugin interface) to a FactoryMap which holds the factories for the various different concrete classes that can be instantiated. Note that the Base class is NOT THE LITERAL CLASSNAME, but rather the result of typeid(Base).name() which sometimes is the literal class name (as on Windows) but is often in mangled form (as on Linux). More...
 
CLASS_LOADER_PUBLIC LibraryVector & class_loader::impl::getLoadedLibraryVector ()
 Gets a handle to a list of open libraries in the form of LibraryPairs which encode the library path+name and the handle to the underlying Poco::SharedLibrary. More...
 
CLASS_LOADER_PUBLIC boost::recursive_mutex & class_loader::impl::getLoadedLibraryVectorMutex ()
 To provide thread safety, all exposed plugin functions can only be run serially by multiple threads. This is implemented by using critical sections enforced by a single mutex which is locked and released with the following two functions. More...
 
CLASS_LOADER_PUBLIC boost::recursive_mutex & class_loader::impl::getPluginBaseToFactoryMapMapMutex ()
 
CLASS_LOADER_PUBLIC bool class_loader::impl::hasANonPurePluginLibraryBeenOpened ()
 Indicates if a library containing more than just plugins has been opened by the running process. More...
 
CLASS_LOADER_PUBLIC void class_loader::impl::hasANonPurePluginLibraryBeenOpened (bool hasIt)
 Sets a flag indicating if a library containing more than just plugins has been opened by the running process. More...
 
CLASS_LOADER_PUBLIC bool class_loader::impl::isLibraryLoaded (const std::string &library_path, ClassLoader *loader)
 Indicates if passed library loaded within scope of a ClassLoader. The library maybe loaded in memory, but to the class loader it may not be. More...
 
CLASS_LOADER_PUBLIC bool class_loader::impl::isLibraryLoadedByAnybody (const std::string &library_path)
 Indicates if passed library has been loaded by ANY ClassLoader. More...
 
CLASS_LOADER_PUBLIC void class_loader::impl::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 library has no effect. More...
 
CLASS_LOADER_PUBLIC void class_loader::impl::printDebugInfoToScreen ()
 
template<typename Derived , typename Base >
void class_loader::impl::registerPlugin (const std::string &class_name, const std::string &base_class_name)
 This function is called by the CLASS_LOADER_REGISTER_CLASS macro in plugin_register_macro.h to register factories. Classes that use that macro will cause this function to be invoked when the library is loaded. The function will create a MetaObject (i.e. factory) for the corresponding Derived class and insert it into the appropriate FactoryMap in the global Base-to-FactoryMap map. Note that the passed class_name is the literal class name and not the mangled version. More...
 
CLASS_LOADER_PUBLIC void class_loader::impl::setCurrentlyActiveClassLoader (ClassLoader *loader)
 Sets the ClassLoader currently in scope which used when a library is being loaded. More...
 
CLASS_LOADER_PUBLIC void class_loader::impl::setCurrentlyLoadingLibraryName (const std::string &library_name)
 When a library is being loaded, in order for factories to know which library they are being associated with, this function is called to set the name of the library currently being loaded. More...
 
CLASS_LOADER_PUBLIC void class_loader::impl::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. More...
 


class_loader
Author(s): Mirza Shah, Steven! Ragnarök
autogenerated on Fri Jan 12 2024 04:01:32