1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMF_HW_DEVICE_INL__
17 #define __MMF_HW_DEVICE_INL__
19 #include <ecom/ecom.h>
23 Create a CMMFHwDevice object from .dll.
24 Will leave if dll cannot be loaded (KErrNotFound).
26 @param dll Implementation .dll
28 @return an instantiated CMMFHwDevice derived object from a DLL.
30 // modification to pass by reference would cause a BC break
31 // coverity[pass_by_value]
32 inline CMMFHwDevice* CMMFHwDevice::NewL(TFileName dll)
35 User::LeaveIfError(library.Load(dll));
36 TLibraryFunction entry=library.Lookup(2); // 1 ponits to implementation table
37 CMMFHwDevice* mmfHwDevice = (CMMFHwDevice*)entry();
47 CMMFHwDevice::~CMMFHwDevice()
49 // Destroy any instance variables and then
50 // inform ecom that this specific
51 // instance of the interface has been destroyed.
52 REComSession::DestroyedImplementation(iDtor_ID_Key);
57 * Create a CMMFHwDevice object with a known implementation Uid.
58 * Will leave if it is not found (KErrNotFound).
60 * @param aUid - The Uid of a plugin implementation
62 * @return An instantiated CMMFHwDevice derived object from ECom.
65 inline CMMFHwDevice* CMMFHwDevice::NewL(TUid aUid)
67 CMMFHwDevice* device = REINTERPRET_CAST(CMMFHwDevice*,
68 REComSession::CreateImplementationL(aUid, _FOFF(CMMFHwDevice,iDtor_ID_Key)));