wvuing/wvuiprocess/Src/CCAProcessManagerFactory.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 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:  Process Manager Factory for creating the Process Manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include	"MCAProcessManager.h"
       
    23 #include	"CCAProcessManager.h"
       
    24 #include 	"CCAProcessManagerFactory.h"
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // ConstructSingletonInstanceL
       
    31 // Factory function for creating a singleton instance of commandmanager factory.
       
    32 // Returns: A void pointer to the created instance.
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 TAny* ConstructSingletonInstanceL()
       
    36     {
       
    37     return CCAProcessManagerFactory::NewL();
       
    38     }
       
    39 
       
    40 
       
    41 // ============================ MEMBER FUNCTIONS ===============================
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CCACommandManagerFactory::NewL
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 CCAProcessManagerFactory* CCAProcessManagerFactory::NewL()
       
    48     {
       
    49     CCAProcessManagerFactory* self = new( ELeave ) CCAProcessManagerFactory();
       
    50     CleanupStack::PushL( self );
       
    51     self->ConstructL();
       
    52     CleanupStack::Pop();
       
    53     return self;
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CCACommandManagerFactory::ConstructL
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 inline void CCAProcessManagerFactory::ConstructL()
       
    61     {
       
    62     iProcessManager = CCAProcessManager::NewL();
       
    63     }
       
    64 
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CCACommandManagerFactory::InstanceL
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C CCAProcessManagerFactory* CCAProcessManagerFactory::InstanceL()
       
    71     {
       
    72     return ( CCAProcessManagerFactory* ) BaseInstanceL();
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CCACommandManagerFactory::GetProcessManager
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 EXPORT_C MCAProcessManager* CCAProcessManagerFactory::GetProcessManager()
       
    80     {
       
    81     return iProcessManager;
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CCACommandManagerFactory::ReleaseResources
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 EXPORT_C void CCAProcessManagerFactory::ReleaseResources()
       
    89     {
       
    90     CCAProcessManagerFactory* instance =
       
    91         reinterpret_cast<CCAProcessManagerFactory*>( Dll::Tls() );
       
    92 
       
    93     if ( instance )
       
    94         {
       
    95         delete instance;
       
    96         }
       
    97 
       
    98     }
       
    99 
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CCACommandManagerFactory::CCAProcessManagerFactory
       
   103 // Default Constructor
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 
       
   107 inline CCAProcessManagerFactory::CCAProcessManagerFactory()
       
   108     {
       
   109     iProcessManager = NULL;
       
   110     }
       
   111 
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 // CCACommandManagerFactory::CCAProcessManagerFactory
       
   115 // Destructor
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 CCAProcessManagerFactory::~CCAProcessManagerFactory()
       
   119     {
       
   120     delete iProcessManager;
       
   121     }
       
   122 
       
   123 //    End of File
       
   124