IBase Class Reference

Inheritance diagram for IBase:

Agg ICompatibility IFactory IIter IIter<T *, G> IString FactoryBase ISequence ISequence<T *, SeqId, IterId> StringImp Factory


Public Methods

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

Public Types

enum  Status {
  cOK = 0, cFail = 1, cNoInterface = 2, cNotFound = 3,
  cLibraryNotFound = 4, cSymbolNotFound = 5, cNotImplemented = 6, cOutOfMemory = 7,
  cInvalidArg = 8, cNoAggregation = 9, cErrorInRegFile = 10, cClassNotRegistered = 11,
  cIncompatible = 12
}

Detailed Description

This is the base interface class for all interface definitions in the OpenAccess plug-in system. It should be used as the base for all third party interface definitions as well. It defines the functions required for reference counting and interface discovery. Various utility classes, such as SPtr, rely on this base class to manage interface pointers for client code. See PlugInBase for a simple, single interface implementation of IBase.


Member Function Documentation

unsigned long IBase::addRef   [pure virtual]
 

This function is used to increment the reference count on a component. Each copy of an interface pointer that is 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.

Implemented in FactoryBase, StringImp, and PlugInBase<IString>.

long IBase::queryInterface const Guid &    id,
void **    iPtr
[pure virtual]
 

This function is used to query the implementing component for other interfaces. The id of the required interface is passed, and the component tests it against the id's of the interfaces that it implements. If there is a match, the component sets the iPtr parameter to a pointer to that interface and returns IBase::cOK.

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

Implemented in FactoryBase, StringImp, and PlugInBase<IString>.

unsigned long IBase::release   [pure virtual]
 

This function is used to decrement the reference count on a component. Each copy of an interface pointer that is 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.

Implemented in FactoryBase, StringImp, and PlugInBase<IString>.


Member Enumeration Documentation

enum IBase::Status
 

This enumeration represents the possible conditions that can occur in the operation of the plug-in system, and in intraction with plug-in components.

Enumeration values:
cOK  This value indicates that the operation in question was successful.
cFail  This value indicates that the operation in question failed in such a way that detailed diagnostic information is not available, or would be meaningless outside of the implementation in which it was generated. Use of this value should be kept at an absolute minimum, especially if one of the other values in this enum is appropriate.
cNoInterface  This value is returned from IBase::queryInterface if the desired interface is not implemented by that component. It can also be returned from IFactory::createInstance if the interface requested from the new component instance is not implemented by that component.
cNotFound  This value is returned from the plug-in manager to indicate that a requested component was not found in the plug-in registry.
cLibraryNotFound  This is returned from from the plug-in manager to indicate that, while the plug-in is registered, the shared library indicated in the registry entry is not found in the system.
cSymbolNotFound  This value is returned from the plug-in manager if the required entry point is not found in the shared library indicated by the registry entry.
cNotImplemented  This is a possible value of an IPlugInException for an interface function that has not been implemented. It's possible that in a later version of this component function will be implemented.
cOutOfMemory  This can be reported by the IFactory::createInstance function to indicate that the attempt to create an instance of the new component resulted in an out of memory error. It can also be reported in the form of an IPlugInException to report that an interface function call ran out of memory while trying to perform one or more appointed tasks.
cInvalidArg  This value is generally reported from an interface function in the form of an IPlugInException to indicate that one of the input parameters to this funcition was invalid.
cNoAggregation  This value is reported by the IFactory::createInstance function if a non-NULL value is passed in for the "reserved" parameter, and the requested component does not support being aggregated.
cErrorInRegFile  There is an error in the plug-in registration file. Refer to How to Write a Plug-In for information about plug-in registration files.
cClassNotRegistered  A plug-in registration file (.plg file) was not found. Refer to How to Write a Plug-In for information about plug-in registration files.
cIncompatible  The OpenAccess version is not compatible with this Plug-in. Refer to Compatibility for OpenAccess Applications and Data for information about OpenAccess API compatibility and feature-based compatibility.


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

Return to top of page