PlugInBase Class Template Reference

Inheritance diagram for PlugInBase:

ArrayIter StaticString StlIString


Public Methods

 PlugInBase (unsigned long refIn=0)
virtual ~PlugInBase ()
virtual long queryInterface (const Guid &id, void **iPtr)
virtual unsigned long addRef ()
virtual unsigned long release ()

Detailed Description

template<class I = IBase>
class PlugInBase< I >

This class can be used as a base class for simple plug-in components. That is, for components that only implement one interface and don't use aggregation or any advanced reference counting schemes. It takes the interface class to be implemented as the template parameter, and provides the implementation for the IBase functions.


Constructor & Destructor Documentation

template<class I>
PlugInBase< I >::PlugInBase unsigned long    refIn = 0 [inline]
 

This constructor takes an optional reference count argument. This is used as the initial value for the reference count of the component. Using a non-zero initial reference count is advanced usage and should be done rarely.

Parameters:
refIn The value to use as the initial reference count

template<class I>
PlugInBase< I >::~PlugInBase   [inline, virtual]
 

The destructor for this class currently contains no implementation, but is defined to establish the destructor as being virtual. This is important since the release() function calls delete to destroy the object when the reference count goes to zero.


Member Function Documentation

template<class I>
unsigned long PlugInBase< I >::addRef   [virtual]
 

This function is used to increment the reference count on this component. Each copy of an interface pointer that's in use by a client will have a corresponding reference on the component. Use the SPtr to help manage the references on components in client code.

template<class I>
long PlugInBase< I >::queryInterface const Guid &    id,
void **    iPtr
[virtual]
 

This function is used to query this component for other interfaces. The id of the desired interface is passed in and tested against the id of the interface given in the template parameter. If it matches then iPtr is set to a pointer to that interface and IBase::cOK is returned.

Parameters:
id The interface id of the desired interface.
iPtr This parameter is set to a pointer to the desired interface if this component implements it. Otherwise it's set to NULL.

template<class I>
unsigned long PlugInBase< I >::release   [virtual]
 

This function is used to increment the reference count on this component. Each copy of an interface pointer that's in use by a client will have a corresponding reference on the component. When the reference count of a component is decremented to zero then the component will delete itself. Use the SPtr to help manage the references on components in client code.


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

Return to top of page