Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvutil::PlugInServer Class Reference

Plug-in management. More...

#include <PlugIn.h>

List of all members.

Public Methods

 PlugInServer ()
 ~PlugInServer ()

Friends

NVSG_API bool getInterface (const std::vector< std::string > &searchPath, const UPIID &piid, PlugIn *&plugIn)
 Get hold of a certain interface object. More...

NVSG_API bool queryInterfaceType (const std::vector< std::string > &searchPath, const UPITID &pitid, std::vector< UPIID > &piids)
 Query for a certain interface type. More...

NVSG_API void releaseInterface (const UPIID &piid)
 Release a certain interface. More...

NVSG_API void setPlugInFileFilter (const std::string &filter)
 Specify a file name filter to be used while searching for appropriate plug-in modules. More...


Detailed Description

Plug-in management.

The PlugInServer class provides functionality for convenient plug-in managment.

The PlugInServer is a central management tool to handle plug-ins and therefore it is implemented as a singleton object. The interface of the PlugInServer can only be accesses through an external set of wrapper functions with special access rights.


Friends And Related Function Documentation

NVSG_API bool getInterface const std::vector< std::string > &    searchPath,
const UPIID   piid,
PlugIn *&    plugIn
[friend]
 

Get hold of a certain interface object.

Searches the searchPath for a plug-in that provides an interface specified by piid. If successfull, plugIn holds the requested interface object.

While searching for appropriate plug-in modules, this function uses either the PlugInServer's default file name filter or a custom file name filter set by a call to nvutil::setPlugInFileFilter. The default file name filter for plug-in modules is "*.dll" on Microsoft(R) Windows platforms, and "*.so" on Linux platforms.

The function always returns the first matching interface found in the specified search path in consideration of the used file name filter.

If client code asks for a certain interface a second time, without releasing the interface object got with the first call to getInterface, this function will not search through the search path a second time but returning the interface object registered with the first call. This will also work this way, independent of whether the file name filter was changed in between.

Remarks:
If client code has no concrete interface ID available to query for, it should first query for a superior interface type using nvutil::queryInterfaceType to get hold of a list of interfaces all providing the superior interface type.

In order to utilize the concrete interface queried for, client code must 'reinterpret_cast' plugIn to a concrete interface pointer and use this pointer to access the interface.

To avoid resource leaks, client code should release the interface through a call to nvutil::releaseInterface, after usage.

Returns:
true if successfull, false otherwise.
Parameters:
searchPath  The path to search for the plug-ins.
piid  Identifies the interface to search for.
plugIn  Holds the interface object (plug-in), if successfull.

NVSG_API bool queryInterfaceType const std::vector< std::string > &    searchPath,
const UPITID   pitid,
std::vector< UPIID > &    piids
[friend]
 

Query for a certain interface type.

Searches the searchPath for all plug-ins that provide a certain interface type specified by pitid. If successfull, client code will receive the concrete interface IDs in piids. Each of these IDs can than be used along with nvutil::getInterface, to get an interface object.

While searching for appropriate plug-in modules, this function uses either the PlugInServer's default file name filter or a custom file name filter set by a call to nvutil::setPlugInFileFilter. The default file name filter for plug-in modules is "*.dll" on Microsoft(R) Windows platforms, and "*.so" on Linux platforms.

Returns:
true if successfull, false otherwise.
Parameters:
searchPath  The path to search for plug-ins.
pitid  Identifies the interface type to query for.
piids  Holds all interface IDs found, if successfull.

NVSG_API void releaseInterface const UPIID   piid [friend]
 

Release a certain interface.

Frees all resources acquired by the interface object identified by piid.

Parameters:
piid  Identifies the interface to be released.

NVSG_API void setPlugInFileFilter const std::string &    filter [friend]
 

Specify a file name filter to be used while searching for appropriate plug-in modules.

This function overrides the PlugInServer's default file name filter used to search for appropriate plug-in modules. The function lets you specify different file name patterns. The patterns must be separated by a semicolon.

Parameters:
filter  String of file name filter patterns all delimited by a semicolon.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:45 2005 for NVSGSDK by NVIDIA