![]() |
Static Public Methods | |
| void | getInterface (T *object, IBase *&base) |
ILib is one of the interfaces that a DM system plug-in must implement to be used by the OpenAccess DM package. The InterfaceAccess class provides a "back door" to gain direct access to the interfaces, such as ILib, of an associated plug-in. To accomplish this, a full specialization of InterfaceAccess must be defined with the regular class as the template parameter. The getInterface() function must then be implemented (preferably not inlined, and in a cpp file) to return the IBase interface of the associated plug-in. Continuing the example above, for oaLib, the following is defined in a special header file, which must be explicitly included by code wishing direct access to the plug-in.
In file oaLibInterfaceAccess.h:
template<>
class InterfaceAccess<oa::oaLib> {
public:
static void getInterface(oa::oaLib *object,
IBase *&base);
};
And, the getInterface() function is defined in oaLib.cpp:
void
InterfaceAccess<oa::oaLib>::getInterface(oa::oaLib *object,
IBase *&base)
{
base = oa::oaLibData::get(object)->getDMILink()->iLib;
base->addRef();
}
|
||||||||||||||||
|
This function should be implemented for the specialization described above to extract the
SPtr<IBase> base; InterfaceAccess<oaLib>::getInterface(lib, base); SQPtr<IDMSystemCaps> caps(base);
In this example,
|

Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.