- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FUPluginManager Class Reference
[Utility Classes.]

A generic plug-in manager. More...

`#include <FUPluginManager.h>`

List of all members.

## Public Types
typedef uint32(* | GetPluginCount )(void)
| Callback to retrieve the number of plug-ins contained within a library.
typedef const FUObjectType *(* | GetPluginType )(uint32 index)
| Callback to retrieve the type of a given library plug-in.
typedef FUPlugin *(* | CreatePlugin )(uint32 index)
| Callback to create a given library plug-in.
## Public Member Functions
| FUPluginManager (const fchar *pluginLibraryFilter)
| Constructor.
virtual | ~FUPluginManager ()
| Destructor.
void | AddPluginLibrary (FUPluginManager::GetPluginCount fnGetPluginCount, FUPluginManager::GetPluginType fnGetPluginType, FUPluginManager::CreatePlugin fnCreatePlugin)
| Add one custom plug-in library.
void | LoadPlugins (const FUObjectType &pluginType)
| Loads the plug-ins from the loaded plug-in libraries.
void | UnloadPlugins ()
| Unloads all the loaded plug-ins.
size_t | GetLoadedPluginCount ()
| Retrieves the number of loaded plug-ins.
FUPlugin ** | GetLoadedPlugins ()
| Retrieves all the loaded plug-ins.
const FUPlugin ** | GetLoadedPlugins () const
| See above.
FUPlugin * | GetLoadedPlugin (size_t index)
| Retrieves a loaded plug-in.
const FUPlugin * | GetLoadedPlugin (size_t index) const
| See above.
## Classes
struct | PluginLibrary

## Detailed Description

A generic plug-in manager.

Use this structure to attach and detach plug-in libraries as well as load and unload plug-ins. For a plug-in library to be valid, it must expose three functions:

- GetPluginCount
- GetPluginType
- CreatePlugin The implementation of these functions and their exposition is highly OS-dependant.

## Member Typedef Documentation

typedef FUPlugin*(* FUPluginManager::CreatePlugin)(uint32 index)

| Callback to create a given library plug-in. Necessary plugin function definition. Under Win32, this function MUST be a DLL export and called "CreatePlugin".

typedef uint32(* FUPluginManager::GetPluginCount)(void)

| Callback to retrieve the number of plug-ins contained within a library. Necessary plugin function definition. Under Win32, this function MUST be a DLL export and called "GetPluginCount".

typedef const FUObjectType*(* FUPluginManager::GetPluginType)(uint32 index)

| Callback to retrieve the type of a given library plug-in. Necessary plugin function definition. Under Win32, this function MUST be a DLL export and called "GetPluginType".

## Constructor & Destructor Documentation

FUPluginManager::FUPluginManager | ( | const fchar * | pluginLibraryFilter | ) |

  | Constructor. Look for the "plugins" folder within the given application filepath and attaches itself to the plug-in libraries it finds within the given file filter. Parameters:
  | pluginLibraryFilter | A filter string for plug-in library files. An example of a valid filter on Win32 is "*.fcp" or "*.fcp|*.dll".

virtual FUPluginManager::~FUPluginManager | ( |  | ) | `[virtual]`

| Destructor. Releases all the loaded plug-ins and detaches all the plug-in libraries.

## Member Function Documentation

void FUPluginManager::AddPluginLibrary | ( | FUPluginManager::GetPluginCount | fnGetPluginCount,
|  | FUPluginManager::GetPluginType | fnGetPluginType,
|  | FUPluginManager::CreatePlugin | fnCreatePlugin
| ) |

  | Add one custom plug-in library. This function is useful when dealing with static plug-in libraries. Parameters:
  | fnGetPluginCount | The library's plugin count retrieval function.
  | fnGetPluginType | The library's plugin type retrieval function.
  | fnCreatePlugin | The library's plugin creation function.

FUPlugin* FUPluginManager::GetLoadedPlugin | ( | size_t | index | ) | `[inline]`

  | Retrieves a loaded plug-in. Parameters:
  | index | The index of the loaded plug-in.
Returns: The plug-in at the given index.

size_t FUPluginManager::GetLoadedPluginCount | ( |  | ) | `[inline]`

| Retrieves the number of loaded plug-ins. Returns: The number of loaded plug-ins.

FUPlugin** FUPluginManager::GetLoadedPlugins | ( |  | ) | `[inline]`

| Retrieves all the loaded plug-ins. Returns: The loaded plug-ins list.

void FUPluginManager::LoadPlugins | ( | const FUObjectType & | pluginType | ) |

  | Loads the plug-ins from the loaded plug-in libraries. Parameters:
  | pluginType | The minimum object type for the plug-ins that must be loaded. This filters all the plug-ins within the plug-in libraries in order to creates only wanted plug-ins. When the given type is FUObject::GetClassType, then all plug-ins will always be loaded.

void FUPluginManager::UnloadPlugins | ( |  | ) |

| Unloads all the loaded plug-ins. This function releases all the loaded plug-ins, but does not detach all the plug-in libraries.

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

- FUtils/FUPluginManager.h