usbmgmt/usbmgr/device/classdrivers/ncm/classimplementation/ncmpktdrv/pktdrv/src/ncmpktdrvfactory.cpp
branchRCL_3
changeset 16 012cc2ee6408
parent 15 f92a4f87e424
equal deleted inserted replaced
15:f92a4f87e424 16:012cc2ee6408
     1 /*
       
     2 * Copyright (c) 2010 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "ncmpktdrvfactory.h"
       
    19 #include "ncmpktdrv.h"
       
    20 
       
    21 
       
    22 /**
       
    23 @file
       
    24 @internalComponent
       
    25 */
       
    26 extern "C"
       
    27     {
       
    28     IMPORT_C CPktDrvFactory * NewNcmPktDrvFactoryL(); ///< Force export
       
    29     }
       
    30 
       
    31 /**
       
    32 Library file is opened and this is the the first and only export.
       
    33 @internalComponent
       
    34 @return A pointer to CPktDrvFactory object.
       
    35 */
       
    36 EXPORT_C CPktDrvFactory* NewNcmPktDrvFactoryL()
       
    37     {
       
    38     return new (ELeave) CNcmPktDrvFactory;
       
    39     }
       
    40 
       
    41 /**
       
    42 Create the packet driver object
       
    43 @param aParent Pointer to the parent Ethint NIF class.
       
    44 @return A pointer to CPktDrvBase object.
       
    45 */
       
    46 CPktDrvBase* CNcmPktDrvFactory::NewDriverL(CLANLinkCommon* aParent)
       
    47     {
       
    48     CNcmPktDrv *drv = new (ELeave) CNcmPktDrv(*this);
       
    49     CleanupStack::PushL(drv);
       
    50     drv->ConstructL(aParent);
       
    51     CleanupStack::Pop(drv);
       
    52     return drv;
       
    53     }
       
    54 
       
    55 
       
    56 /**
       
    57 Packet Driver version number.
       
    58 @return Version number of the Packet Driver
       
    59 */
       
    60 TVersion CNcmPktDrvFactory::Version() const
       
    61     {
       
    62     return(TVersion(KNcmDrvMajorVersionNumber,KNcmDrvMinorVersionNumber,KNcmDrvBuildVersionNumber));
       
    63     }