telephonyprotocols/umtsgprsscpr/src/UmtsGprs_subconnProvFactory.cpp
author hgs
Thu, 29 Jul 2010 12:12:57 +0100
changeset 56 ab72d5c1d770
parent 44 8b72faa1200f
permissions -rw-r--r--
201029_05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     2
// All rights reserved.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     7
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     8
// Initial Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    10
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    11
// Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    12
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    13
// Description:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    14
// Implementation file for the Umts/Gprs SubConnection Provider Factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    15
// 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    16
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    17
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    18
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    19
 @file
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    20
 @internalComponent
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    21
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    22
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    23
#include "UmtsGprs_subconnProvFactory.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    24
#include <networking/qos3gpp_subconparams.h>
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    25
#include "UmtsGprs_defaultSubconnProv.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    26
#include <implementationproxy.h>
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    27
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    28
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    29
Data required for instantiating ECOM Plugin
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    30
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    31
const TImplementationProxy ImplementationTable[] =
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    32
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    33
	IMPLEMENTATION_PROXY_ENTRY(KUmtsGprsSubConnectionProviderFactoryId, CUmtsGprsSubConnProvdFactory::NewL),
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    34
	};
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    35
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    36
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    37
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    38
ECOM Implementation Factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    39
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    40
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    41
    {
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    42
    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    43
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    44
    return ImplementationTable;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    45
    }
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    46
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    47
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    48
CUmtsGprsSubConnProvdFactory* CUmtsGprsSubConnProvdFactory::NewL(TAny* aConstructionParameters)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    49
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    50
Constructs a Umts/Gprs SubConnection Provider Factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    51
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    52
@param aConstructionParameters construction data passed by ECOM
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    53
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    54
@returns pointer to a constructed factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    55
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    56
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    57
   CUmtsGprsSubConnProvdFactory* ptr = 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    58
      new (ELeave) CUmtsGprsSubConnProvdFactory(KUmtsGprsSubConnectionProviderFactoryId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    59
         *(reinterpret_cast<CSubConnectionFactoryContainer*>(aConstructionParameters)));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    60
                  
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    61
	return ptr;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    62
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    63
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    64
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    65
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    66
CUmtsGprsSubConnProvdFactory::CUmtsGprsSubConnProvdFactory(TUint aFactoryId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    67
                                     CSubConnectionFactoryContainer& aParentContainer)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    68
	: CSubConnectionProviderFactoryBase(aFactoryId, aParentContainer)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    69
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    70
Umts/Gprs SubConnection Provider Factory Constructor
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    71
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    72
@param aFactoryId ECOM Implementation Id
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    73
@param aParentContainer Object Owner
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    74
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    75
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    76
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    77
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    78
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    79
CUmtsGprsSubConnProvdFactory::~CUmtsGprsSubConnProvdFactory()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    80
    {
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    81
    }
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    82
    
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    83
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    84
CSubConnectionProviderBase* CUmtsGprsSubConnProvdFactory::DoCreateProviderL(
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    85
                                   CConnectionProviderBase& aConnProvider, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    86
                                   RSubConnection::TSubConnType aType)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    87
  {
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    88
  CSubConnectionProviderBase* provider = NULL;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    89
  if (aType == RSubConnection::EAttachToDefault)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    90
    {
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    91
    provider = CUmtsGprsDefaultSubConnProvd::NewL(*this, aConnProvider);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    92
    }
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    93
  else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    94
    {
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    95
    User::Leave(KErrNotSupported);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    96
    }
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    97
  return provider;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    98
  }
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    99