Namespaces | Typedefs | Functions
class_loader_core.hpp File Reference
#include <boost/thread/recursive_mutex.hpp>
#include <cstdio>
#include <map>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
#include "Poco/SharedLibrary.h"
#include "class_loader/exceptions.hpp"
#include "class_loader/meta_object.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

namespace  class_loader
namespace  class_loader::class_loader_private

Typedefs

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

Functions

template<typename Base >
Baseclass_loader::class_loader_private::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.
std::vector< std::string > class_loader::class_loader_private::getAllLibrariesUsedByClassLoader (const ClassLoader *loader)
 This function returns the names of all libraries in use by a given class loader.
template<typename Base >
std::vector< std::string > class_loader::class_loader_private::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.
ClassLoader * class_loader::class_loader_private::getCurrentlyActiveClassLoader ()
 Gets the ClassLoader currently in scope which used when a library is being loaded.
std::string class_loader::class_loader_private::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.
FactoryMap & class_loader::class_loader_private::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.
template<typename Base >
FactoryMap & class_loader::class_loader_private::getFactoryMapForBaseClass ()
 Same as above but uses a type parameter instead of string for more safety if info is available.
BaseToFactoryMapMap & class_loader::class_loader_private::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).
LibraryVector & class_loader::class_loader_private::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.
boost::recursive_mutex & class_loader::class_loader_private::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.
boost::recursive_mutex & class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex ()
bool class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened ()
 Indicates if a library containing more than just plugins has been opened by the running process.
void class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened (bool hasIt)
 Sets a flag indicating if a library containing more than just plugins has been opened by the running process.
bool class_loader::class_loader_private::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.
bool class_loader::class_loader_private::isLibraryLoadedByAnybody (const std::string &library_path)
 Indicates if passed library has been loaded by ANY ClassLoader.
void class_loader::class_loader_private::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.
void class_loader::class_loader_private::printDebugInfoToScreen ()
template<typename Derived , typename Base >
void class_loader::class_loader_private::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.
void class_loader::class_loader_private::setCurrentlyActiveClassLoader (ClassLoader *loader)
 Sets the ClassLoader currently in scope which used when a library is being loaded.
void class_loader::class_loader_private::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.
void class_loader::class_loader_private::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.


class_loader
Author(s): Mirza Shah
autogenerated on Thu Jun 6 2019 20:43:27