# PPluginManager Class Reference

`#include <pluginmgr.h>`

Inheritance diagram for PPluginManager:

List of all members.

## Public Types

| LoadingPlugIn
| UnloadingPlugIn
enum | NotificationCode { LoadingPlugIn, UnloadingPlugIn }

## Public Member Functions

PBoolean | LoadPlugin (const PString &fileName)
void | LoadPluginDirectory (const PDirectory &dir)
void | OnShutdown ()
PStringArray | GetPluginTypes () const
PStringArray | GetPluginsProviding (const PString &serviceType) const
PPluginServiceDescriptor * | GetServiceDescriptor (const PString &serviceName, const PString &serviceType) const
PObject * | CreatePluginsDevice (const PString &serviceName, const PString &serviceType, int userData=0) const
PObject * | CreatePluginsDeviceByName (const PString &deviceName, const PString &serviceType, int userData=0, const PString &serviceName=PString::Empty()) const
PStringArray | GetPluginsDeviceNames (const PString &serviceName, const PString &serviceType, int userData=0) const
PBoolean | GetPluginsDeviceCapabilities (const PString &serviceType, const PString &serviceName, const PString &deviceName, void *capabilities) const
PBoolean | RegisterService (const PString &serviceName, const PString &serviceType, PPluginServiceDescriptor *descriptor)
void | AddNotifier (const PNotifier &filterFunction, PBoolean existing=false)
| Add a notifier to the plugin manager.
void | RemoveNotifier (const PNotifier &filterFunction)

## Static Public Member Functions

static bool | AddPluginDirs (const PString &dirs)
static PStringArray | GetPluginDirs ()
static PPluginManager & | GetPluginManager ()

## Protected Member Functions

void | LoadPluginDirectory (const PDirectory &directory, const PStringList &suffixes)
void | CallNotifier (PDynaLink &dll, NotificationCode code)

## Protected Attributes

PMutex | m_pluginsMutex
PArray< PDynaLink > | m_plugins
PMutex | m_servicesMutex
PArray< PPluginService > | m_services
PMutex | m_notifiersMutex
PList< PNotifier > | m_notifiers

## Member Enumeration Documentation

enum PPluginManager::NotificationCode

Enumerator:

  LoadingPlugIn |
  UnloadingPlugIn |

## Member Function Documentation

void PPluginManager::AddNotifier | ( | const PNotifier & | filterFunction,
|  | PBoolean | existing = `false` |
| ) |  |  |

Add a notifier to the plugin manager.

The call back function is executed just after loading, or just after unloading, a plugin.

To use define: PDECLARE_NOTIFIER(PDynaLink, YourClass, YourFunction); and void YourClass::YourFunction(PDynaLink & dll, INT code) { code == 0 means loading code == 1 means unloading } and to connect to the plugin manager: PPluginManager & mgr = PPluginManager::GetPluginManager(); mgr->AddNotifier((PCREATE_NOTIFIER(YourFunction));

static bool PPluginManager::AddPluginDirs | ( | const PString & | dirs | ) | `[static]`

void PPluginManager::CallNotifier | ( | PDynaLink & | dll,
|  | NotificationCode | code |
| ) |  |  | `[protected]`

PObject* PPluginManager::CreatePluginsDevice | ( | const PString & | serviceName,
|  | const PString & | serviceType,
|  | int | userData = `0` |
| ) |  |  | const

PObject* PPluginManager::CreatePluginsDeviceByName | ( | const PString & | deviceName,
|  | const PString & | serviceType,
|  | int | userData = `0`,
|  | const PString & | serviceName = `PString::Empty()` |
| ) |  |  | const

static PStringArray PPluginManager::GetPluginDirs | ( |  | ) | `[static]`

static PPluginManager& PPluginManager::GetPluginManager | ( |  | ) | `[static]`

PBoolean PPluginManager::GetPluginsDeviceCapabilities | ( | const PString & | serviceType,
|  | const PString & | serviceName,
|  | const PString & | deviceName,
|  | void * | capabilities |
| ) |  |  | const

PStringArray PPluginManager::GetPluginsDeviceNames | ( | const PString & | serviceName,
|  | const PString & | serviceType,
|  | int | userData = `0` |
| ) |  |  | const

PStringArray PPluginManager::GetPluginsProviding | ( | const PString & | serviceType | ) | const

PStringArray PPluginManager::GetPluginTypes | ( |  | ) | const

PPluginServiceDescriptor* PPluginManager::GetServiceDescriptor | ( | const PString & | serviceName,
|  | const PString & | serviceType |
| ) |  |  | const

PBoolean PPluginManager::LoadPlugin | ( | const PString & | fileName | ) |

void PPluginManager::LoadPluginDirectory | ( | const PDirectory & | directory,
|  | const PStringList & | suffixes |
| ) |  |  | `[protected]`

void PPluginManager::LoadPluginDirectory | ( | const PDirectory & | dir | ) |

void PPluginManager::OnShutdown | ( |  | ) |

PBoolean PPluginManager::RegisterService | ( | const PString & | serviceName,
|  | const PString & | serviceType,
|  | PPluginServiceDescriptor * | descriptor |
| ) |  |  |

void PPluginManager::RemoveNotifier | ( | const PNotifier & | filterFunction | ) |

## Member Data Documentation

PList<PNotifier> PPluginManager::m_notifiers `[protected]`

PMutex PPluginManager::m_notifiersMutex `[protected]`

PArray<PDynaLink> PPluginManager::m_plugins `[protected]`

PMutex PPluginManager::m_pluginsMutex `[protected]`

PArray<PPluginService> PPluginManager::m_services `[protected]`

PMutex PPluginManager::m_servicesMutex `[protected]`

The documentation for this class was generated from the following file:

- pluginmgr.h