devicediagnosticsfw/diagframework/src/diagpluginpool.cpp
branchRCL_3
changeset 62 19bba8228ff0
parent 0 b497e44ab2fc
equal deleted inserted replaced
61:b183ec05bd8c 62:19bba8228ff0
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Class definition of CDiagPluginPool
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // CLASS DECLARATION
       
    20 #include "diagpluginpoolimpl.h" // CDiagPluginPoolImpl
       
    21 #include <DiagFrameworkDebug.h>
       
    22 // SYSTEM INCLUDE FILES
       
    23 #include <DiagPluginPool.h>
       
    24 #include <DiagPlugin.h>             // MDiagPlugin
       
    25 
       
    26 // USER INCLUDE FILES
       
    27 
       
    28 
       
    29 // ===========================================================================
       
    30 // MEMBER FUNCTIONS
       
    31 // ===========================================================================
       
    32 
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 // CDiagPluginPool::NewL()
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 EXPORT_C CDiagPluginPool* CDiagPluginPool::NewL( 
       
    39             MDiagPluginPoolObserver& aObserver )
       
    40     {
       
    41     LOGSTRING("CDiagPluginPool* CDiagPluginPool::NewL");
       
    42     CDiagPluginPool* self = CDiagPluginPool::NewLC( aObserver );
       
    43     CleanupStack::Pop( self );
       
    44     return self;
       
    45     }
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // CDiagPluginPool::NewLC()
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 EXPORT_C CDiagPluginPool* CDiagPluginPool::NewLC( 
       
    52             MDiagPluginPoolObserver& aObserver )
       
    53     {
       
    54     LOGSTRING("CDiagPluginPool* CDiagPluginPool::NewLC");
       
    55     CDiagPluginPool* self = new( ELeave )CDiagPluginPool();
       
    56     CleanupStack::PushL( self );
       
    57     self->ConstructL( aObserver );
       
    58     return self;
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CDiagPluginPool::CDiagPluginPool
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 CDiagPluginPool::CDiagPluginPool()
       
    66     {
       
    67     }    
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CDiagPluginPool::LoadAsyncL
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C void CDiagPluginPool::LoadAsyncL( TUid /*aUid*/ )
       
    74     {    
       
    75     iPluginPoolImpl->LoadAsyncL();
       
    76     }
       
    77 
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // CDiagPluginPool::CreatePluginL
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 EXPORT_C MDiagPlugin* CDiagPluginPool::CreatePluginL( TUid aUid )
       
    84     {
       
    85     LOGSTRING("CDiagPluginPool::CreatePluginL");
       
    86     return CDiagPluginPoolImpl::CreatePluginL( aUid );
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 // CDiagPluginPool::CancelLoadPluginsL
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 EXPORT_C void CDiagPluginPool::CancelLoadPluginsL()
       
    94     {
       
    95     iPluginPoolImpl->Cancel();
       
    96     }
       
    97 
       
    98 
       
    99 // ---------------------------------------------------------------------------
       
   100 // CDiagPluginPool::FindPlugin
       
   101 // ---------------------------------------------------------------------------
       
   102 //
       
   103 EXPORT_C TInt CDiagPluginPool::FindPlugin( TUid aUid, 
       
   104             MDiagPlugin*& aPlugin ) const
       
   105     {    
       
   106     LOGSTRING("CDiagPluginPool::FindPlugin");
       
   107     return iPluginPoolImpl->FindPlugin( aUid, aPlugin );
       
   108     }
       
   109 
       
   110 // ---------------------------------------------------------------------------
       
   111 // CDiagPluginPool::FindPluginL
       
   112 // ---------------------------------------------------------------------------
       
   113 //
       
   114 EXPORT_C MDiagPlugin& CDiagPluginPool::FindPluginL( TUid aUid ) const
       
   115     {    
       
   116     MDiagPlugin* plugin = NULL;
       
   117     User::LeaveIfError( FindPlugin( aUid, plugin ) );
       
   118     return *plugin;
       
   119     }
       
   120 
       
   121 // ---------------------------------------------------------------------------
       
   122 // CDiagPluginPool::FindPlugin
       
   123 // ---------------------------------------------------------------------------
       
   124 //
       
   125 EXPORT_C TInt CDiagPluginPool::FindPlugin( const TDesC& aServiceName, 
       
   126             MDiagPlugin*& aPlugin ) const
       
   127     {
       
   128     return iPluginPoolImpl->FindPlugin( aServiceName, aPlugin );
       
   129     }
       
   130 
       
   131 // ---------------------------------------------------------------------------
       
   132 // CDiagPluginPool::FindPluginL
       
   133 // ---------------------------------------------------------------------------
       
   134 //
       
   135 EXPORT_C MDiagPlugin& CDiagPluginPool::FindPluginL( const TDesC& aServiceName ) const
       
   136     {    
       
   137     MDiagPlugin* plugin = NULL;
       
   138     User::LeaveIfError( FindPlugin( aServiceName, plugin ) );
       
   139     return *plugin;
       
   140     }
       
   141     
       
   142 // ---------------------------------------------------------------------------
       
   143 // CDiagPluginPool::ConstructL()
       
   144 // ---------------------------------------------------------------------------
       
   145 //
       
   146 void CDiagPluginPool::ConstructL( MDiagPluginPoolObserver& aObserver )
       
   147     {
       
   148     // Construct implementation class
       
   149     iPluginPoolImpl = CDiagPluginPoolImpl::NewL( aObserver );
       
   150     }    
       
   151 
       
   152 // ---------------------------------------------------------------------------
       
   153 // CDiagPluginPool::~CDiagPluginPool
       
   154 // ---------------------------------------------------------------------------
       
   155 //
       
   156 EXPORT_C CDiagPluginPool::~CDiagPluginPool()
       
   157     {
       
   158     LOGSTRING("CDiagPluginPool::~CDiagPluginPool");
       
   159     delete iPluginPoolImpl;
       
   160     }    
       
   161 
       
   162 // End of File
       
   163