supl/locationomasuplpostester/epos_comasuplpostestermodulecfg/src/epos_comasuplecomhandler.cpp
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Identifies all implementations for an interface.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "epos_comasuplecomhandler.h"
       
    19 #include <ecom/ecom.h>
       
    20 
       
    21 // ======== MEMBER FUNCTIONS ========
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 // Named constructor
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27  COMASuplEComHandler* COMASuplEComHandler::NewL(const TInt aInterfaceUid)
       
    28 	{
       
    29 	COMASuplEComHandler* self = new(ELeave)COMASuplEComHandler(aInterfaceUid);
       
    30 	CleanupStack::PushL(self);
       
    31 	self->ConstructL();
       
    32 	CleanupStack::Pop(self);
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // Second phase constructor
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 void COMASuplEComHandler::ConstructL()
       
    41 	{
       
    42 	InitializeImplementationListL();
       
    43 	}
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // Default constructor
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 COMASuplEComHandler::COMASuplEComHandler(const TInt aInterfaceUid)
       
    50 	{
       
    51 	iInterfaceUid = TUid::Uid(aInterfaceUid);
       
    52 	iDtorIdKey = TUid::Null();
       
    53 	}
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // Destructor
       
    57 // ---------------------------------------------------------------------------
       
    58 //	
       
    59 COMASuplEComHandler::~COMASuplEComHandler()
       
    60 	{
       
    61 	UnLoadImplementation();
       
    62 	iImplementationList.ResetAndDestroy();
       
    63 	iImplementationList.Close();
       
    64 	}
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // returns iImplementationList which contain implementations installed for
       
    68 // a particular interface Uid.
       
    69 // ---------------------------------------------------------------------------
       
    70 //	
       
    71  const RImplInfoPtrArray& COMASuplEComHandler::GetImplementationList()
       
    72 	{
       
    73 	return iImplementationList;
       
    74 	}
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // Fills iImplementationList with implementations installed for
       
    78 // a particular interface Uid.
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 void COMASuplEComHandler::InitializeImplementationListL()
       
    82 	{
       
    83 	REComSession::ListImplementationsL(iInterfaceUid, iImplementationList);
       
    84 	}
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // REComSession may be closed and garbage plug-ins will be unloaded.
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 void COMASuplEComHandler::UnLoadImplementation()
       
    91 	{
       
    92 	REComSession::FinalClose();
       
    93 	}