Exporting
the Implementation Factories
An implementation collection gathers one or more interface implementations
in a DLL. It provides necessary information to the plug-in framework to use
them. The collection must export a single function that provides an array.
This array maps the UID of each implementation it contains with a pointer
to its factory instantiation function (NewL() in our example).
-
Define a UID for each implementation. This UID maps to the instantiation
function of the implementation. Construct an array of UID's for all the implementations
in the collection.
// Define the interface UIDs
const TImplementationProxy ImplementationTable[] =
{
{{0x10009DC3}, CImplementationClassOne::NewL();},
{{0x10009DC4}, CImplementationClassTwo::NewL();}
};
}
-
The signature of this exported function must be:
const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount);
-
The exported function returns a pointer to an array of
TImplementationProxy
objects.
-
Each
TImplementationProxy
contains a UID and a function
pointer.
aTableCount
should be set to the number of items in
the array.
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
{
aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
return ImplementationTable;
}
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.